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 echo "QA output created by $seq"
38 status=1 # failure is the default!
39 trap "_cleanup; exit \$status" 0 1 2 3 15
46 # get standard environment, filters and checks
53 /<file_entry name=/ { fe_on=1 }
54 /<timestamp/ { ts_on=1; next }
55 /<\/timestamp/ { ts_on=0; next }
61 fe_on == 1 && ts_on == 0 { print; next }
71 udf_db -f $SCRATCH_DEV | _db_filter
77 # real QA test starts here
86 echo "create file foo"
87 echo "file_contents" >foo
90 echo "should be no EAs for foo:"
93 echo "set EA <noise,woof>:"
94 ${ATTR_PROG} -s noise -V woof foo
96 echo "set EA <colour,blue>:"
97 ${ATTR_PROG} -s colour -V blue foo
99 echo "set EA <size,small>:"
100 ${ATTR_PROG} -s size -V small foo
102 echo "list the EAs for foo: noise, colour, size"
105 echo "check the list again for foo"
108 echo "unmount the FS and see if EAs are persistent"
111 echo "check the list again for foo after umount/mount"
114 echo "get the value of the noise EA"
115 ${ATTR_PROG} -g noise foo
117 echo "get the value of the colour EA which was removed earlier"
118 ${ATTR_PROG} -g colour foo
120 echo "get the value of the size EA"
121 ${ATTR_PROG} -g size foo
123 echo "remove the colour EA on foo"
124 ${ATTR_PROG} -r colour foo
126 echo "list EAs for foo: noise, size"
129 echo "get the value of the noise EA"
130 ${ATTR_PROG} -g noise foo
132 echo "get the value of the colour EA which was removed earlier"
133 ${ATTR_PROG} -g colour foo
135 echo "get the value of the size EA"
136 ${ATTR_PROG} -g size foo
138 echo "list all the EAs again: noise, size"
141 echo "change the value of the size EA from small to huge"
142 ${ATTR_PROG} -s size -V huge foo
144 echo "get the size EA which should now have value huge"
145 ${ATTR_PROG} -g size foo
147 echo "list EAs: noise, size"
150 echo "remove the size EA from foo"
151 ${ATTR_PROG} -r size foo
153 echo "list EAs: noise (size EA has been removed)"
156 echo "get the noise EA: woof"
157 ${ATTR_PROG} -g noise foo
159 echo "try removing non-existent EA named woof"
160 ${ATTR_PROG} -r woof foo
162 echo "try removing already removed EA size"
163 ${ATTR_PROG} -r size foo
165 echo "list EAs: noise"
168 echo "try removing already removed EA colour"
169 ${ATTR_PROG} -r colour foo
171 echo "list EAs: noise"
174 echo "remove remaining EA noise"
175 ${ATTR_PROG} -r noise foo
177 echo "list EAs: should be no EAs left now"
180 echo "unmount the FS and see if EAs are persistent"
183 echo "list EAs: should still be no EAs left"
187 echo "*** Test out the root namespace ***"
190 echo "set EA <root:colour,marone>:"
191 ${ATTR_PROG} -R -s colour -V marone foo
193 echo "set EA <user:colour,beige>:"
194 ${ATTR_PROG} -s colour -V beige foo
196 echo "set EA <user:vomit,pizza>:"
197 ${ATTR_PROG} -s vomit -V pizza foo
199 echo "set EA <root:noise,whack>:"
200 ${ATTR_PROG} -R -s noise -V whack foo
202 echo "list root EAs: <root:colour,noise>:"
203 ${ATTR_PROG} -R -l foo
205 echo "list user EAs: <user:colour,vomit>:"
208 echo "get root EA colour: marone"
209 ${ATTR_PROG} -R -g colour foo
211 echo "get root EA noise: whack"
212 ${ATTR_PROG} -R -g noise foo
214 echo "get root EA vomit which is a user EA => find nothing"
215 ${ATTR_PROG} -R -g vomit foo
218 echo "unmount the FS and see if EAs are persistent"
222 echo "get root EA colour: marone"
223 ${ATTR_PROG} -R -g colour foo
225 echo "get root EA noise: whack"
226 ${ATTR_PROG} -R -g noise foo
228 echo "get user EA vomit: pizza"
229 ${ATTR_PROG} -g vomit foo
231 echo "remove the root colour EA"
232 ${ATTR_PROG} -R -r colour foo
234 echo "list root EAs: <root:noise>:"
235 ${ATTR_PROG} -R -l foo
237 echo "list user EAs: <user:colour,vomit>:"
240 echo "remove the final root EA noise"
241 ${ATTR_PROG} -R -r noise foo
243 echo "list root EAs: none"
244 ${ATTR_PROG} -R -l foo
249 udf_db -f $SCRATCH_DEV | _db_filter
251 # Checks the udf filesystem
252 _check_udf_filesystem $SCRATCH_DEV
257 echo "delete the file foo - which will delete the associated streams"
263 udf_db -f $SCRATCH_DEV | _db_filter
265 # Checks the udf filesystem
266 _check_udf_filesystem $SCRATCH_DEV
268 # optional stuff if your test has verbose output to help resolve problems
270 #echo "If failure, check $seqres.full (this) and $seqres.full.ok (reference)"