5 # This file and its contents are supplied under the terms of the
6 # Common Development and Distribution License ("CDDL"), version 1.0.
7 # You may only use this file in accordance with the terms of version
10 # A full copy of the text of the CDDL should have accompanied this
11 # source. A copy of the CDDL is also available via the Internet at
12 # http://www.illumos.org/license/CDDL.
18 # Copyright (c) 2017, Datto, Inc. All rights reserved.
21 . $STF_SUITE/include/libtest.shlib
25 # ZFS should perform unencrypted sends of encrypted datasets, unless the '-p'
26 # or '-R' options are specified.
29 # 1. Create an encrypted dataset
30 # 6. Create a child encryption root
31 # 2. Snapshot the dataset
33 # 4. Attempt a send with properties
34 # 5. Attempt a replication send
35 # 7. Unmount the parent and unload its key
36 # 8. Attempt a send of the parent dataset
37 # 9. Attempt a send of the child encryption root
40 verify_runnable "both"
44 datasetexists $TESTPOOL/$TESTFS1 && \
45 log_must zfs destroy -r $TESTPOOL/$TESTFS1
50 log_assert "ZFS should perform unencrypted sends of encrypted datasets, " \
51 "unless the '-p' or '-R' options are specified"
53 typeset passphrase="password"
54 typeset passphrase1="password1"
55 typeset snap="$TESTPOOL/$TESTFS1@snap"
57 log_must eval "echo $passphrase | zfs create -o encryption=on" \
58 "-o keyformat=passphrase $TESTPOOL/$TESTFS1"
60 log_must eval "echo $passphrase1 | zfs create -o encryption=on" \
61 "-o keyformat=passphrase $TESTPOOL/$TESTFS1/child"
63 log_must zfs snapshot -r $snap
65 log_must eval "zfs send $snap > /dev/null"
66 log_mustnot eval "zfs send -p $snap > /dev/null"
67 log_mustnot eval "zfs send -R $snap > /dev/null"
69 log_must zfs unmount $TESTPOOL/$TESTFS1
70 log_must zfs unload-key $TESTPOOL/$TESTFS1
72 log_mustnot eval "zfs send $snap > /dev/null"
73 log_must eval "zfs send $TESTPOOL/$TESTFS1/child@snap > /dev/null"
75 log_pass "ZFS performs unencrypted sends of encrypted datasets, unless the" \
76 "'-p' or '-R' options are specified"