2 # FS QA Test No. 098. Modified from UDFQA test 035
4 # simple attr tests for EAs:
13 #-----------------------------------------------------------------------
14 # Copyright (c) 2000-2004 Silicon Graphics, Inc. All Rights Reserved.
15 #-----------------------------------------------------------------------
21 echo "QA output created by $seq"
25 status=1 # failure is the default!
26 trap "_cleanup; exit \$status" 0 1 2 3 15
33 # get standard environment, filters and checks
40 /<file_entry name=/ { fe_on=1 }
41 /<timestamp/ { ts_on=1; next }
42 /<\/timestamp/ { ts_on=0; next }
48 fe_on == 1 && ts_on == 0 { print; next }
58 udf_db -f $SCRATCH_DEV | _db_filter
64 # real QA test starts here
73 echo "create file foo"
74 echo "file_contents" >foo
77 echo "should be no EAs for foo:"
80 echo "set EA <noise,woof>:"
81 attr -s noise -V woof foo
83 echo "set EA <colour,blue>:"
84 attr -s colour -V blue foo
86 echo "set EA <size,small>:"
87 attr -s size -V small foo
89 echo "list the EAs for foo: noise, colour, size"
92 echo "check the list again for foo"
95 echo "unmount the FS and see if EAs are persistent"
98 echo "check the list again for foo after umount/mount"
101 echo "get the value of the noise EA"
104 echo "get the value of the colour EA which was removed earlier"
107 echo "get the value of the size EA"
110 echo "remove the colour EA on foo"
113 echo "list EAs for foo: noise, size"
116 echo "get the value of the noise EA"
119 echo "get the value of the colour EA which was removed earlier"
122 echo "get the value of the size EA"
125 echo "list all the EAs again: noise, size"
128 echo "change the value of the size EA from small to huge"
129 attr -s size -V huge foo
131 echo "get the size EA which should now have value huge"
134 echo "list EAs: noise, size"
137 echo "remove the size EA from foo"
140 echo "list EAs: noise (size EA has been removed)"
143 echo "get the noise EA: woof"
146 echo "try removing non-existent EA named woof"
149 echo "try removing already removed EA size"
152 echo "list EAs: noise"
155 echo "try removing already removed EA colour"
158 echo "list EAs: noise"
161 echo "remove remaining EA noise"
164 echo "list EAs: should be no EAs left now"
167 echo "unmount the FS and see if EAs are persistent"
170 echo "list EAs: should still be no EAs left"
174 echo "*** Test out the root namespace ***"
177 echo "set EA <root:colour,marone>:"
178 attr -R -s colour -V marone foo
180 echo "set EA <user:colour,beige>:"
181 attr -s colour -V beige foo
183 echo "set EA <user:vomit,pizza>:"
184 attr -s vomit -V pizza foo
186 echo "set EA <root:noise,whack>:"
187 attr -R -s noise -V whack foo
189 echo "list root EAs: <root:colour,noise>:"
192 echo "list user EAs: <user:colour,vomit>:"
195 echo "get root EA colour: marone"
196 attr -R -g colour foo
198 echo "get root EA noise: whack"
201 echo "get root EA vomit which is a user EA => find nothing"
205 echo "unmount the FS and see if EAs are persistent"
209 echo "get root EA colour: marone"
210 attr -R -g colour foo
212 echo "get root EA noise: whack"
215 echo "get user EA vomit: pizza"
218 echo "remove the root colour EA"
219 attr -R -r colour foo
221 echo "list root EAs: <root:noise>:"
224 echo "list user EAs: <user:colour,vomit>:"
227 echo "remove the final root EA noise"
230 echo "list root EAs: none"
236 udf_db -f $SCRATCH_DEV | _db_filter
238 # Checks the udf filesystem
239 _check_udf_filesystem $SCRATCH_DEV
244 echo "delete the file foo - which will delete the associated streams"
250 udf_db -f $SCRATCH_DEV | _db_filter
252 # Checks the udf filesystem
253 _check_udf_filesystem $SCRATCH_DEV
255 # optional stuff if your test has verbose output to help resolve problems
257 #echo "If failure, check $seq.full (this) and $seq.full.ok (reference)"