dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / test / zfs-tests / tests / functional / rsend / send-c_recv_dedup.ksh
blobeb8c050bf8df8a5d9ba4178246cedea3bbb87ea3
1 #!/usr/bin/ksh
4 # This file and its contents are supplied under the terms of the
5 # Common Development and Distribution License ("CDDL"), version 1.0.
6 # You may only use this file in accordance with the terms of version
7 # 1.0 of the CDDL.
9 # A full copy of the text of the CDDL should have accompanied this
10 # source. A copy of the CDDL is also available via the Internet at
11 # http://www.illumos.org/license/CDDL.
15 # Copyright (c) 2016 by Delphix. All rights reserved.
18 . $STF_SUITE/tests/functional/rsend/rsend.kshlib
21 # Description:
22 # Verify that we can receive a compressed stream into a deduped filesystem.
24 # Strategy:
25 # 1. Write heavily duplicated data to a filesystem and create a compressed
26 # full stream.
27 # 2. Verify that the stream can be received correctly into a dedup=verify
28 # filesystem.
31 verify_runnable "both"
33 log_pass "Verify a compressed stream can be received into a deduped filesystem"
34 log_onexit cleanup_pool $POOL2
36 typeset sendfs=$POOL2/sendfs
37 typeset recvfs=$POOL2/recvfs
38 typeset stream0=$BACKDIR/stream.0
39 typeset stream1=$BACKDIR/stream.1
40 typeset inc=$BACKDIR/stream.inc
42 log_must zfs create -o compress=lz4 $sendfs
43 log_must zfs create -o compress=lz4 -o dedup=verify $recvfs
44 typeset dir=$(get_prop mountpoint $sendfs)
45 for i in {0..10}; do
46 log_must cp /kernel/genunix $dir/file.$i
47 done
48 log_must zfs snapshot $sendfs@snap0
49 log_must eval "zfs send -c $sendfs@snap0 >$stream0"
51 # Finally, make sure the receive works correctly.
52 log_must eval "zfs recv -d $recvfs <$stream0"
53 cmp_ds_cont $sendfs $recvfs
55 log_pass "The compressed stream could be received into a deduped filesystem"