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.
16 # This program is free software; you can redistribute it and/or
17 # modify it under the terms of the GNU General Public License as
18 # published by the Free Software Foundation.
20 # This program is distributed in the hope that it would be useful,
21 # but WITHOUT ANY WARRANTY; without even the implied warranty of
22 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 # GNU General Public License for more details.
25 # You should have received a copy of the GNU General Public License
26 # along with this program; if not, write the Free Software Foundation,
27 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 #-----------------------------------------------------------------------
33 seqres=$RESULT_DIR/$seq
34 seqres=$RESULT_DIR/$seq
35 seqres=$RESULT_DIR/$seq
36 echo "QA output created by $seq"
40 status=1 # failure is the default!
41 trap "_cleanup; exit \$status" 0 1 2 3 15
48 # get standard environment, filters and checks
55 /<file_entry name=/ { fe_on=1 }
56 /<timestamp/ { ts_on=1; next }
57 /<\/timestamp/ { ts_on=0; next }
63 fe_on == 1 && ts_on == 0 { print; next }
73 udf_db -f $SCRATCH_DEV | _db_filter
79 # real QA test starts here
90 echo "create file foo"
91 echo "file_contents" >foo
94 echo "should be no EAs for foo:"
97 echo "set EA <noise,woof>:"
98 ${ATTR_PROG} -s noise -V woof foo
100 echo "set EA <colour,blue>:"
101 ${ATTR_PROG} -s colour -V blue foo
103 echo "set EA <size,small>:"
104 ${ATTR_PROG} -s size -V small foo
106 echo "list the EAs for foo: noise, colour, size"
109 echo "check the list again for foo"
112 echo "unmount the FS and see if EAs are persistent"
115 echo "check the list again for foo after umount/mount"
118 echo "get the value of the noise EA"
119 ${ATTR_PROG} -g noise foo
121 echo "get the value of the colour EA which was removed earlier"
122 ${ATTR_PROG} -g colour foo
124 echo "get the value of the size EA"
125 ${ATTR_PROG} -g size foo
127 echo "remove the colour EA on foo"
128 ${ATTR_PROG} -r colour foo
130 echo "list EAs for foo: noise, size"
133 echo "get the value of the noise EA"
134 ${ATTR_PROG} -g noise foo
136 echo "get the value of the colour EA which was removed earlier"
137 ${ATTR_PROG} -g colour foo
139 echo "get the value of the size EA"
140 ${ATTR_PROG} -g size foo
142 echo "list all the EAs again: noise, size"
145 echo "change the value of the size EA from small to huge"
146 ${ATTR_PROG} -s size -V huge foo
148 echo "get the size EA which should now have value huge"
149 ${ATTR_PROG} -g size foo
151 echo "list EAs: noise, size"
154 echo "remove the size EA from foo"
155 ${ATTR_PROG} -r size foo
157 echo "list EAs: noise (size EA has been removed)"
160 echo "get the noise EA: woof"
161 ${ATTR_PROG} -g noise foo
163 echo "try removing non-existent EA named woof"
164 ${ATTR_PROG} -r woof foo
166 echo "try removing already removed EA size"
167 ${ATTR_PROG} -r size foo
169 echo "list EAs: noise"
172 echo "try removing already removed EA colour"
173 ${ATTR_PROG} -r colour foo
175 echo "list EAs: noise"
178 echo "remove remaining EA noise"
179 ${ATTR_PROG} -r noise foo
181 echo "list EAs: should be no EAs left now"
184 echo "unmount the FS and see if EAs are persistent"
187 echo "list EAs: should still be no EAs left"
191 echo "*** Test out the root namespace ***"
194 echo "set EA <root:colour,marone>:"
195 ${ATTR_PROG} -R -s colour -V marone foo
197 echo "set EA <user:colour,beige>:"
198 ${ATTR_PROG} -s colour -V beige foo
200 echo "set EA <user:vomit,pizza>:"
201 ${ATTR_PROG} -s vomit -V pizza foo
203 echo "set EA <root:noise,whack>:"
204 ${ATTR_PROG} -R -s noise -V whack foo
206 echo "list root EAs: <root:colour,noise>:"
207 ${ATTR_PROG} -R -l foo
209 echo "list user EAs: <user:colour,vomit>:"
212 echo "get root EA colour: marone"
213 ${ATTR_PROG} -R -g colour foo
215 echo "get root EA noise: whack"
216 ${ATTR_PROG} -R -g noise foo
218 echo "get root EA vomit which is a user EA => find nothing"
219 ${ATTR_PROG} -R -g vomit foo
222 echo "unmount the FS and see if EAs are persistent"
226 echo "get root EA colour: marone"
227 ${ATTR_PROG} -R -g colour foo
229 echo "get root EA noise: whack"
230 ${ATTR_PROG} -R -g noise foo
232 echo "get user EA vomit: pizza"
233 ${ATTR_PROG} -g vomit foo
235 echo "remove the root colour EA"
236 ${ATTR_PROG} -R -r colour foo
238 echo "list root EAs: <root:noise>:"
239 ${ATTR_PROG} -R -l foo
241 echo "list user EAs: <user:colour,vomit>:"
244 echo "remove the final root EA noise"
245 ${ATTR_PROG} -R -r noise foo
247 echo "list root EAs: none"
248 ${ATTR_PROG} -R -l foo
253 udf_db -f $SCRATCH_DEV | _db_filter
255 # Checks the udf filesystem
256 _check_udf_filesystem $SCRATCH_DEV
261 echo "delete the file foo - which will delete the associated streams"
267 udf_db -f $SCRATCH_DEV | _db_filter
269 # Checks the udf filesystem
270 _check_udf_filesystem $SCRATCH_DEV
272 # optional stuff if your test has verbose output to help resolve problems
274 #echo "If failure, check $seqres.full (this) and $seqres.full.ok (reference)"