2 # FS QA Test No. 097. Modifed from UDFQA test 033.
4 # simple attr tests for EAs:
11 #-----------------------------------------------------------------------
12 # Copyright (c) 2000-2004 Silicon Graphics, Inc. All Rights Reserved.
14 # This program is free software; you can redistribute it and/or
15 # modify it under the terms of the GNU General Public License as
16 # published by the Free Software Foundation.
18 # This program is distributed in the hope that it would be useful,
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 # GNU General Public License for more details.
23 # You should have received a copy of the GNU General Public License
24 # along with this program; if not, write the Free Software Foundation,
25 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27 #-----------------------------------------------------------------------
33 echo "QA output created by $seq"
37 status=1 # failure is the default!
39 trap "_cleanup; exit \$status" 0 1 2 3 15
52 if [ "$FSTYP" == "xfs" ]; then
61 # get standard environment, filters and checks
65 # link correct .out file
66 # This is done bacause udf and xfs print attrs in different orders.
68 if [ "$FSTYP" == "xfs" ]; then
69 ln -s $seq.out.xfs $seq.out
71 ln -s $seq.out.udf $seq.out
74 # real QA test starts here
83 TARGET_DIR=$SCRATCH_MNT
84 [ "$FSTYP" == "xfs" ] && TARGET_DIR=$TEST_DIR
87 echo "create file foo"
91 echo "should be no EAs for foo:"
94 echo "set EA <noise,woof>:"
95 ${ATTR_PROG} -s noise -V woof foo
97 echo "set EA <colour,blue>:"
98 ${ATTR_PROG} -s colour -V blue foo
100 echo "set EA <size,small>:"
101 ${ATTR_PROG} -s size -V small foo
103 echo "list the EAs for foo: noise, colour, size"
106 echo "check the list again for foo"
109 echo "unmount the FS and see if EAs are persistent"
112 echo "check the list again for foo after umount/mount"
115 echo "get the value of the noise EA"
116 ${ATTR_PROG} -g noise foo
118 echo "get the value of the colour EA which was removed earlier"
119 ${ATTR_PROG} -g colour foo
121 echo "get the value of the size EA"
122 ${ATTR_PROG} -g size foo
124 echo "remove the colour EA on foo"
125 ${ATTR_PROG} -r colour foo
127 echo "list EAs for foo: noise, size"
130 echo "get the value of the noise EA"
131 ${ATTR_PROG} -g noise foo
133 echo "get the value of the colour EA which was removed earlier"
134 ${ATTR_PROG} -g colour foo
136 echo "get the value of the size EA"
137 ${ATTR_PROG} -g size foo
139 echo "list all the EAs again: noise, size"
142 echo "change the value of the size EA from small to huge"
143 ${ATTR_PROG} -s size -V huge foo
145 echo "get the size EA which should now have value huge"
146 ${ATTR_PROG} -g size foo
148 echo "list EAs: noise, size"
151 echo "remove the size EA from foo"
152 ${ATTR_PROG} -r size foo
154 echo "list EAs: noise (size EA has been removed)"
157 echo "get the noise EA: woof"
158 ${ATTR_PROG} -g noise foo
160 echo "try removing non-existent EA named woof"
161 ${ATTR_PROG} -r woof foo
163 echo "try removing already removed EA size"
164 ${ATTR_PROG} -r size foo
166 echo "list EAs: noise"
169 echo "try removing already removed EA colour"
170 ${ATTR_PROG} -r colour foo
172 echo "list EAs: noise"
175 echo "remove remaining EA noise"
176 ${ATTR_PROG} -r noise foo
178 echo "list EAs: should be no EAs left now"
181 echo "unmount the FS and see if EAs are persistent"
184 echo "list EAs: should still be no EAs left"
188 echo "*** Test out the root namespace ***"
191 echo "set EA <root:colour,marone>:"
192 ${ATTR_PROG} -R -s colour -V marone foo
194 echo "set EA <user:colour,beige>:"
195 ${ATTR_PROG} -s colour -V beige foo
197 echo "set EA <user:vomit,pizza>:"
198 ${ATTR_PROG} -s vomit -V pizza foo
200 echo "set EA <root:noise,whack>:"
201 ${ATTR_PROG} -R -s noise -V whack foo
203 echo "list root EAs: <root:colour,noise>:"
204 ${ATTR_PROG} -R -l foo
206 echo "list user EAs: <user:colour,vomit>:"
209 echo "get root EA colour: marone"
210 ${ATTR_PROG} -R -g colour foo
212 echo "get root EA noise: whack"
213 ${ATTR_PROG} -R -g noise foo
215 echo "get root EA vomit which is a user EA => find nothing"
216 ${ATTR_PROG} -R -g vomit foo
219 echo "unmount the FS and see if EAs are persistent"
223 echo "get root EA colour: marone"
224 ${ATTR_PROG} -R -g colour foo
226 echo "get root EA noise: whack"
227 ${ATTR_PROG} -R -g noise foo
229 echo "get user EA vomit: pizza"
230 ${ATTR_PROG} -g vomit foo
232 echo "remove the root colour EA"
233 ${ATTR_PROG} -R -r colour foo
235 echo "list root EAs: <root:noise>:"
236 ${ATTR_PROG} -R -l foo
238 echo "list user EAs: <user:colour,vomit>:"
241 echo "remove the final root EA noise"
242 ${ATTR_PROG} -R -r noise foo
244 echo "list root EAs: none"
245 ${ATTR_PROG} -R -l foo
250 # Check the filesystem
253 # optional stuff if your test has verbose output to help resolve problems
255 #echo "If failure, check $seq.full (this) and $seq.full.ok (reference)"