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 raw sends of datasets.
28 # 1. Create an encrypted dataset
29 # 2. Snapshot the default dataset and the encrypted dataset
30 # 3. Attempt a raw send of both datasets
31 # 4. Attempt a raw send with properties of both datasets
32 # 5. Attempt a raw replication send of both datasets
33 # 6. Unmount and unload the encrypted dataset key
34 # 7. Attempt a raw send of the encrypted dataset
37 verify_runnable "both"
42 log_must zfs destroy $snap
44 datasetexists $TESTPOOL/$TESTFS1 && \
45 log_must zfs destroy -r $TESTPOOL/$TESTFS1
50 log_assert "ZFS should perform raw sends of datasets"
52 typeset passphrase="password"
53 typeset snap="$TESTPOOL/$TESTFS@snap"
54 typeset snap1="$TESTPOOL/$TESTFS1@snap"
56 log_must eval "echo $passphrase | zfs create -o encryption=on" \
57 "-o keyformat=passphrase $TESTPOOL/$TESTFS1"
59 log_must zfs snapshot $snap
60 log_must zfs snapshot $snap1
62 log_must eval "zfs send -w $snap > /dev/null"
63 log_must eval "zfs send -w $snap1 > /dev/null"
65 log_note "Verify ZFS can perform raw sends with properties"
66 log_must eval "zfs send -wp $snap > /dev/null"
67 log_must eval "zfs send -wp $snap1 > /dev/null"
69 log_note "Verify ZFS can perform raw replication sends"
70 log_must eval "zfs send -wR $snap > /dev/null"
71 log_must eval "zfs send -wR $snap1 > /dev/null"
73 log_note "Verify ZFS can perform a raw send of an encrypted datasets with" \
75 log_must zfs unmount $TESTPOOL/$TESTFS1
76 log_must zfs unload-key $TESTPOOL/$TESTFS1
77 log_must eval "zfs send -w $snap1 > /dev/null"
79 log_pass "ZFS performs raw sends of datasets"