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
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) 2015 by Delphix. All rights reserved.
18 .
$STF_SUITE/tests
/functional
/rsend
/rsend.kshlib
22 # Verify a pool without the lz4 feature enabled can create compressed send
23 # streams, and that they can be received into pools with or without the
27 # 1. For each of an uncompressed, and gzip dataset created from a pool with
28 # the lz4 feature disabled, receive the stream into a pool with and without
29 # the feature enabled.
32 verify_runnable
"both"
34 log_assert
"Verify compressed streams are rejected if incompatible."
36 typeset send_ds
=$POOL2/testds
37 typeset recv_ds
=$POOL3/testds
41 poolexists
$POOL2 && destroy_pool
$POOL2
42 poolexists
$POOL3 && destroy_pool
$POOL3
43 log_must zpool create
$POOL2 $DISK2
47 datasetexists
$POOL2 && log_must zpool destroy
$POOL2
48 log_must zpool create
-d $POOL2 $DISK2
50 for compress in off
gzip; do
51 for pool_opt
in '' -d; do
52 poolexists
$POOL3 && destroy_pool
$POOL3
53 log_must zpool create
$pool_opt $POOL3 $DISK3
55 datasetexists
$send_ds && log_must zfs destroy
-r $send_ds
56 datasetexists
$recv_ds && log_must zfs destroy
-r $recv_ds
58 log_must zfs create
-o compress=$compress $send_ds
59 typeset dir
=$
(get_prop mountpoint
$send_ds)
60 write_compressible
$dir 16m
61 log_must zfs snapshot
$send_ds@full
63 log_must
eval "zfs send -c $send_ds@full >$BACKDIR/full-c"
64 log_must
eval "zfs recv $recv_ds <$BACKDIR/full-c"
66 log_must zfs destroy
-r $recv_ds
68 log_must
eval "zfs send $send_ds@full >$BACKDIR/full"
69 log_must
eval "zfs recv $recv_ds <$BACKDIR/full"
73 log_pass
"Compressed streams are rejected if incompatible."