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_008_pos.ksh
+++ new/usr/src/test/zfs-tests/tests/functional/rsend/rsend_008_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 promote' can be properly received.
37 37 #
38 38 # STRATEGY:
39 39 # 1. Seperatly promote pool clone, filesystem clone and volume clone.
40 40 # 2. Recursively backup all the POOL and restore in POOL2
41 41 # 3. Verify all the datesets and property be properly received.
42 42 #
43 43
44 44 verify_runnable "both"
45 45
46 46 # Origin Clone
47 47 #
48 48 set -A dtst "$POOL" "$POOL/pclone" \
49 49 "$POOL/$FS/fs1/fs2" "$POOL/$FS/fs1/fclone"
50 50 if is_global_zone ; then
51 51 typeset -i n=${#dtst[@]}
52 52 dtst[((n))]="$POOL/$FS/vol"; dtst[((n+1))]="$POOL/$FS/vclone"
|
↓ open down ↓ |
13 lines elided |
↑ open up ↑ |
53 53 fi
54 54
55 55 function cleanup
56 56 {
57 57 typeset origin
58 58 typeset -i i=0
59 59 while ((i < ${#dtst[@]})); do
60 60 origin=$(get_prop origin ${dtst[$i]})
61 61
62 62 if [[ $origin != "-" ]]; then
63 - log_must $ZFS promote ${dtst[$i]}
63 + log_must zfs promote ${dtst[$i]}
64 64 fi
65 65
66 66 ((i += 2))
67 67 done
68 68
69 69 origin=$(get_prop origin $POOL2)
70 70 if [[ $origin != "-" ]]; then
71 - log_must $ZFS promote $POOL2
71 + log_must zfs promote $POOL2
72 72 fi
73 73 log_must cleanup_pool $POOL2
74 74 }
75 75
76 76 log_assert "Changes made by 'zfs promote' can be properly received."
77 77 log_onexit cleanup
78 78
79 79 typeset -i i=0
80 80 while ((i < ${#dtst[@]})); do
81 - log_must $ZFS promote ${dtst[((i+1))]}
81 + log_must zfs promote ${dtst[((i+1))]}
82 82
83 83 ((i += 2))
84 84 done
85 85
86 86 #
87 87 # Verify zfs send -R should succeed
88 88 #
89 -log_must eval "$ZFS send -R $POOL@final > $BACKDIR/pool-final-R"
90 -log_must eval "$ZFS receive -d -F $POOL2 < $BACKDIR/pool-final-R"
89 +log_must eval "zfs send -R $POOL@final > $BACKDIR/pool-final-R"
90 +log_must eval "zfs receive -d -F $POOL2 < $BACKDIR/pool-final-R"
91 91
92 92 dstds=$(get_dst_ds $POOL $POOL2)
93 93 #
94 94 # Define all the POOL/POOL2 datasets pair
95 95 #
96 96 set -A pair "$POOL" "$dstds" \
97 97 "$POOL/$FS" "$dstds/$FS" \
98 98 "$POOL/$FS/fs1" "$dstds/$FS/fs1" \
99 99 "$POOL/$FS/fs1/fs2" "$dstds/$FS/fs1/fs2" \
100 100 "$POOL/pclone" "$dstds/pclone" \
101 101 "$POOL/$FS/fs1/fclone" "$dstds/$FS/fs1/fclone"
102 102
103 103 if is_global_zone ; then
104 104 typeset -i n=${#pair[@]}
105 105 pair[((n))]="$POOL/vol"; pair[((n+1))]="$dstds/vol"
106 106 pair[((n+2))]="$POOL/$FS/vol" pair[((n+3))]="$dstds/$FS/vol"
107 107 fi
108 108
109 109 #
110 110 # Verify all the sub-datasets can be properly received.
111 111 #
|
↓ open down ↓ |
11 lines elided |
↑ open up ↑ |
112 112 log_must cmp_ds_subs $POOL $dstds
113 113 typeset -i i=0
114 114 while ((i < ${#pair[@]})); do
115 115 log_must cmp_ds_cont ${pair[$i]} ${pair[((i+1))]}
116 116 log_must cmp_ds_prop ${pair[$i]} ${pair[((i+1))]}
117 117
118 118 ((i += 2))
119 119 done
120 120
121 121 # Verify the original filesystem can be promoted
122 -log_must $ZFS promote $dstds
122 +log_must zfs promote $dstds
123 123 if is_global_zone ; then
124 - log_must $ZFS promote $dstds/$FS/vol
124 + log_must zfs promote $dstds/$FS/vol
125 125 fi
126 -log_must $ZFS promote $dstds/$FS/fs1/fs2
126 +log_must zfs promote $dstds/$FS/fs1/fs2
127 127
128 128 log_pass "Changes made by 'zfs promote' can be properly received."
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX