dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / test / zfs-tests / tests / functional / rsend / rsend_010_pos.ksh
blobe76f5c5c86204e396a05858429bc0d7413bce7ae
1 #!/bin/ksh -p
3 # CDDL HEADER START
5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License (the "License").
7 # You may not use this file except in compliance with the License.
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
20 # CDDL HEADER END
24 # Copyright 2008 Sun Microsystems, Inc. All rights reserved.
25 # Use is subject to license terms.
29 # Copyright (c) 2013, 2016 by Delphix. All rights reserved.
32 . $STF_SUITE/tests/functional/rsend/rsend.kshlib
35 # DESCRIPTION:
36 # ZFS can handle stream with multiple identical (same GUID) snapshots
38 # STRATEGY:
39 # 1. Recursively backup snapshot
40 # 2. Restore it to the given filesystem
41 # 3. Resend the snapshot again
42 # 4. Verify this stream can be restore to this filesystem again
45 verify_runnable "both"
47 log_assert "ZFS can handle stream with multiple identical (same GUID) snapshots"
48 log_onexit cleanup_pool $POOL2
50 log_must zfs create $POOL2/$FS
51 log_must zfs snapshot $POOL2/$FS@snap
54 # First round restore the stream
56 log_must eval "zfs send -R $POOL2/$FS@snap > $BACKDIR/fs-R"
57 log_must eval "zfs receive -d -F $POOL2/$FS < $BACKDIR/fs-R"
60 # In order to avoid 'zfs send -R' failed, create snapshot for
61 # all the sub-systems
63 list=$(zfs list -r -H -o name -t filesystem $POOL2/$FS)
64 for item in $list ; do
65 if datasetnonexists $item@snap ; then
66 log_must zfs snapshot $item@snap
68 done
71 # Second round restore the stream
73 log_must eval "zfs send -R $POOL2/$FS@snap > $BACKDIR/fs-R"
74 dstds=$(get_dst_ds $POOL2/$FS $POOL2/$FS)
75 log_must eval "zfs receive -d -F $dstds < $BACKDIR/fs-R"
77 log_pass "ZFS can handle stream with multiple identical (same GUID) snapshots"