Print this page
7290 ZFS test suite needs to control what utilities it can run
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/test/zfs-tests/tests/functional/rsend/rsend_011_pos.ksh
+++ new/usr/src/test/zfs-tests/tests/functional/rsend/rsend_011_pos.ksh
1 1 #!/bin/ksh -p
2 2 #
3 3 # CDDL HEADER START
4 4 #
5 5 # The contents of this file are subject to the terms of the
6 6 # Common Development and Distribution License (the "License").
7 7 # You may not use this file except in compliance with the License.
8 8 #
9 9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 # or http://www.opensolaris.org/os/licensing.
11 11 # See the License for the specific language governing permissions
12 12 # and limitations under the License.
13 13 #
14 14 # When distributing Covered Code, include this CDDL HEADER in each
15 15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 # If applicable, add the following below this CDDL HEADER, with the
17 17 # fields enclosed by brackets "[]" replaced with your own identifying
18 18 # information: Portions Copyright [yyyy] [name of copyright owner]
|
↓ open down ↓ |
18 lines elided |
↑ open up ↑ |
19 19 #
20 20 # CDDL HEADER END
21 21 #
22 22
23 23 #
24 24 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
25 25 # Use is subject to license terms.
26 26 #
27 27
28 28 #
29 -# Copyright (c) 2013 by Delphix. All rights reserved.
29 +# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
30 30 #
31 31
32 32 . $STF_SUITE/tests/functional/rsend/rsend.kshlib
33 33
34 34 #
35 35 # DESCRIPTION:
36 36 # Changes made by 'zfs inherit' can be properly received.
37 37 #
38 38 # STRATEGY:
39 39 # 1. Inherit property for filesystem and volume
40 40 # 2. Send and restore them in the target pool
41 41 # 3. Verify all the datasets can be properly backup and receive
42 42 #
43 43
44 44 verify_runnable "both"
45 45
46 46 function cleanup
47 47 {
48 48 export __ZFS_POOL_RESTRICT="$POOL $POOL2"
49 - log_must $ZFS unmount -a
49 + log_must zfs unmount -a
50 50 unset __ZFS_POOL_RESTRICT
51 51 log_must cleanup_pool $POOL
52 52 log_must cleanup_pool $POOL2
53 53
54 54 log_must setup_test_model $POOL
55 55 }
56 56
57 57 log_assert "Verify changes made by 'zfs inherit' can be properly received."
58 58 log_onexit cleanup
59 59
60 60 #
61 61 # Setting all the $FS properties as local value,
62 62 #
63 63 for prop in $(fs_inherit_prop); do
64 64 value=$(get_prop $prop $POOL/$FS)
65 - log_must $ZFS set $prop=$value $POOL/$FS
65 + log_must zfs set $prop=$value $POOL/$FS
66 66 done
67 67
68 68 #
69 69 # Inherit propertes in sub-datasets
70 70 #
71 71 for ds in "$POOL/$FS/fs1" "$POOL/$FS/fs1/fs2" "$POOL/$FS/fs1/fclone" ; do
72 72 for prop in $(fs_inherit_prop) ; do
73 - $ZFS inherit $prop $ds
73 + zfs inherit $prop $ds
74 74 if (($? !=0 )); then
75 - log_fail "$ZFS inherit $prop $ds"
75 + log_fail "zfs inherit $prop $ds"
76 76 fi
77 77 done
78 78 done
79 79 if is_global_zone ; then
80 80 for prop in $(vol_inherit_prop) ; do
81 - $ZFS inherit $prop $POOL/$FS/vol
81 + zfs inherit $prop $POOL/$FS/vol
82 82 if (($? !=0 )); then
83 - log_fail "$ZFS inherit $prop $POOL/$FS/vol"
83 + log_fail "zfs inherit $prop $POOL/$FS/vol"
84 84 fi
85 85 done
86 86 fi
87 87
88 88 #
89 89 # Verify datasets can be backup and restore correctly
90 90 # Unmount $POOL/$FS to avoid two fs mount in the same mountpoint
91 91 #
92 -log_must eval "$ZFS send -R $POOL@final > $BACKDIR/pool-R"
93 -log_must $ZFS unmount -f $POOL/$FS
94 -log_must eval "$ZFS receive -d -F $POOL2 < $BACKDIR/pool-R"
92 +log_must eval "zfs send -R $POOL@final > $BACKDIR/pool-R"
93 +log_must zfs unmount -f $POOL/$FS
94 +log_must eval "zfs receive -d -F $POOL2 < $BACKDIR/pool-R"
95 95
96 96 dstds=$(get_dst_ds $POOL $POOL2)
97 97 #
98 98 # Define all the POOL/POOL2 datasets pair
99 99 #
100 100 set -A pair "$POOL" "$dstds" \
101 101 "$POOL/$FS" "$dstds/$FS" \
102 102 "$POOL/$FS/fs1" "$dstds/$FS/fs1" \
103 103 "$POOL/$FS/fs1/fs2" "$dstds/$FS/fs1/fs2" \
104 104 "$POOL/pclone" "$dstds/pclone" \
105 105 "$POOL/$FS/fs1/fclone" "$dstds/$FS/fs1/fclone"
106 106
107 107 if is_global_zone ; then
108 108 typeset -i n=${#pair[@]}
109 109 pair[((n))]="$POOL/vol"; pair[((n+1))]="$dstds/vol"
110 110 pair[((n+2))]="$POOL/$FS/vol" pair[((n+3))]="$dstds/$FS/vol"
111 111 fi
112 112
113 113 #
114 114 # Verify all the sub-datasets can be properly received.
115 115 #
116 116 log_must cmp_ds_subs $POOL $dstds
117 117 typeset -i i=0
118 118 while ((i < ${#pair[@]})); do
119 119 log_must cmp_ds_cont ${pair[$i]} ${pair[((i+1))]}
120 120 log_must cmp_ds_prop ${pair[$i]} ${pair[((i+1))]}
121 121
122 122 ((i += 2))
123 123 done
124 124
125 125 log_pass "Changes made by 'zfs inherit' can be properly received."
|
↓ open down ↓ |
21 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX