Print this page
NEX-5795 Rename 'wrc' as 'wbc' in the source and in the tech docs
Reviewed by: Alex Aizman <alex.aizman@nexenta.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
Reviewed by: Alek Pinchuk <alek.pinchuk@nexenta.com>
NEX-4476 WRC: Allow to use write back cache per tree of datasets
Reviewed by: Alek Pinchuk <alek.pinchuk@nexenta.com>
Reviewed by: Alex Aizman <alex.aizman@nexenta.com>
4206 history_003_pos relies on exact size of history log and entries
4207 history_008_pos depends on obsolete internal history log message
4208 Typo in zfs_main.c: "posxiuser"
4209 Populate zfstest with the remainder of the STF tests
Reviewed by: Sonu Pillai <sonu.pillai@delphix.com>
Reviewed by: Will Guyette <will.guyette@delphix.com>
Reviewed by: Eric Diven <eric.diven@delphix.com>
Reviewed by: Christopher Siden <christopher.siden@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/test/zfs-tests/tests/functional/rsend/rsend_012_pos.ksh
+++ new/usr/src/test/zfs-tests/tests/functional/rsend/rsend_012_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]
19 19 #
|
↓ open down ↓ |
19 lines elided |
↑ open up ↑ |
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 29 # Copyright (c) 2013, 2016 by Delphix. All rights reserved.
30 +# Copyright 2016 Nexenta Systems, Inc. All rights reserved.
30 31 #
31 32
32 33 . $STF_SUITE/tests/functional/rsend/rsend.kshlib
33 34
34 35 #
35 36 # DESCRIPTION:
36 37 # zfs send -R will backup all the filesystem properties correctly.
37 38 #
38 39 # STRATEGY:
39 40 # 1. Setting properties for all the filesystem and volumes randomly
40 41 # 2. Backup all the data from POOL by send -R
41 42 # 3. Restore all the data in POOL2
42 43 # 4. Verify all the perperties in two pools are same
43 44 #
44 45
45 46 verify_runnable "global"
46 47
|
↓ open down ↓ |
7 lines elided |
↑ open up ↑ |
47 48 function rand_set_prop
48 49 {
49 50 typeset dtst=$1
50 51 typeset prop=$2
51 52 shift 2
52 53 typeset value=$(random_get $@)
53 54
54 55 log_must eval "zfs set $prop='$value' $dtst"
55 56 }
56 57
58 +#
59 +# 'wbc_mode' is skipped, because the tested pools do not have
60 +# 'special' vdev, so the setting of this property will cause
61 +# test-fail
62 +#
57 63 function edited_prop
58 64 {
59 65 typeset behaviour=$1
60 66 typeset ds=$2
61 67 typeset backfile=$TESTDIR/edited_prop_$ds
62 68
63 69 case $behaviour in
64 70 "get")
65 71 typeset props=$(zfs inherit 2>&1 | \
66 - awk '$2=="YES" {print $1}' | \
72 + awk '$2=="YES" {print $1}' |
73 + egrep -v "^wbc_mode" | \
67 74 egrep -v "^vol|\.\.\.$")
68 75 for item in $props ; do
69 76 if [[ $item == "mlslabel" ]] && \
70 77 ! is_te_enabled ; then
71 78 continue
72 79 fi
73 80 zfs get -H -o property,value $item $ds >> \
74 81 $backfile
75 82 if (($? != 0)); then
76 83 log_fail "zfs get -H -o property,value"\
77 84 "$item $ds > $backfile"
78 85 fi
79 86 done
80 87 ;;
81 88 "set")
82 89 if [[ ! -f $backfile ]] ; then
83 90 log_fail "$ds need backup properties firstly."
84 91 fi
85 92
86 93 typeset prop value
87 94 while read prop value ; do
88 95 eval zfs set $prop='$value' $ds
89 96 if (($? != 0)); then
90 97 log_fail "zfs set $prop=$value $ds"
91 98 fi
92 99 done < $backfile
93 100 ;;
94 101 *)
95 102 log_fail "Unrecognized behaviour: $behaviour"
96 103 esac
97 104 }
98 105
99 106 function cleanup
100 107 {
101 108 log_must cleanup_pool $POOL
102 109 log_must cleanup_pool $POOL2
103 110
104 111 log_must edited_prop "set" $POOL
105 112 log_must edited_prop "set" $POOL2
106 113
107 114 typeset prop
108 115 for prop in $(fs_inherit_prop) ; do
109 116 log_must zfs inherit $prop $POOL
110 117 log_must zfs inherit $prop $POOL2
111 118 done
112 119
113 120 #if is_shared $POOL; then
114 121 # log_must zfs set sharenfs=off $POOL
115 122 #fi
116 123 log_must setup_test_model $POOL
117 124
118 125 if [[ -d $TESTDIR ]]; then
119 126 log_must rm -rf $TESTDIR/*
120 127 fi
121 128 }
122 129
123 130 log_assert "Verify zfs send -R will backup all the filesystem properties " \
124 131 "correctly."
125 132 log_onexit cleanup
126 133
127 134 log_must edited_prop "get" $POOL
128 135 log_must edited_prop "get" $POOL2
129 136
130 137 for fs in "$POOL" "$POOL/pclone" "$POOL/$FS" "$POOL/$FS/fs1" \
131 138 "$POOL/$FS/fs1/fs2" "$POOL/$FS/fs1/fclone" ; do
132 139 rand_set_prop $fs aclinherit "discard" "noallow" "secure" "passthrough"
133 140 rand_set_prop $fs checksum "on" "off" "fletcher2" "fletcher4" "sha256"
134 141 rand_set_prop $fs aclmode "discard" "groupmask" "passthrough"
135 142 rand_set_prop $fs atime "on" "off"
136 143 rand_set_prop $fs checksum "on" "off" "fletcher2" "fletcher4" "sha256"
137 144 rand_set_prop $fs compression "on" "off" "lzjb" "gzip" \
138 145 "gzip-1" "gzip-2" "gzip-3" "gzip-4" "gzip-5" "gzip-6" \
139 146 "gzip-7" "gzip-8" "gzip-9"
140 147 rand_set_prop $fs copies "1" "2" "3"
141 148 rand_set_prop $fs devices "on" "off"
142 149 rand_set_prop $fs exec "on" "off"
143 150 rand_set_prop $fs quota "512M" "1024M"
144 151 rand_set_prop $fs recordsize "512" "2K" "8K" "32K" "128K"
145 152 rand_set_prop $fs setuid "on" "off"
146 153 rand_set_prop $fs snapdir "hidden" "visible"
147 154 rand_set_prop $fs xattr "on" "off"
148 155 rand_set_prop $fs user:prop "aaa" "bbb" "23421" "()-+?"
149 156 done
150 157
151 158 for vol in "$POOL/vol" "$POOL/$FS/vol" ; do
152 159 rand_set_prop $vol checksum "on" "off" "fletcher2" "fletcher4" "sha256"
153 160 rand_set_prop $vol compression "on" "off" "lzjb" "gzip" \
154 161 "gzip-1" "gzip-2" "gzip-3" "gzip-4" "gzip-5" "gzip-6" \
155 162 "gzip-7" "gzip-8" "gzip-9"
156 163 rand_set_prop $vol readonly "on" "off"
157 164 rand_set_prop $vol copies "1" "2" "3"
158 165 rand_set_prop $vol user:prop "aaa" "bbb" "23421" "()-+?"
159 166 done
160 167
161 168
162 169 # Verify inherited property can be received
163 170 rand_set_prop $POOL sharenfs "on" "off" "rw"
164 171
165 172 #
166 173 # Duplicate POOL2 for testing
167 174 #
168 175 log_must eval "zfs send -R $POOL@final > $BACKDIR/pool-final-R"
169 176 log_must eval "zfs receive -d -F $POOL2 < $BACKDIR/pool-final-R"
170 177
171 178 #
172 179 # Define all the POOL/POOL2 datasets pair
173 180 #
174 181 set -A pair "$POOL" "$POOL2" \
175 182 "$POOL/$FS" "$POOL2/$FS" \
176 183 "$POOL/$FS/fs1" "$POOL2/$FS/fs1" \
177 184 "$POOL/$FS/fs1/fs2" "$POOL2/$FS/fs1/fs2" \
178 185 "$POOL/pclone" "$POOL2/pclone" \
179 186 "$POOL/$FS/fs1/fclone" "$POOL2/$FS/fs1/fclone" \
180 187 "$POOL/vol" "$POOL2/vol" \
181 188 "$POOL/$FS/vol" "$POOL2/$FS/vol"
182 189
183 190 typeset -i i=0
184 191 while ((i < ${#pair[@]})); do
185 192 log_must cmp_ds_prop ${pair[$i]} ${pair[((i+1))]}
186 193
187 194 ((i += 2))
188 195 done
189 196
190 197
191 198 zpool upgrade -v | grep "Snapshot properties" > /dev/null 2>&1
192 199 if (( $? == 0 )) ; then
193 200 i=0
194 201 while ((i < ${#pair[@]})); do
195 202 log_must cmp_ds_prop ${pair[$i]}@final ${pair[((i+1))]}@final
196 203 ((i += 2))
197 204 done
198 205 fi
199 206
200 207 log_pass "Verify zfs send -R will backup all the filesystem properties " \
201 208 "correctly."
|
↓ open down ↓ |
125 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX