3 #-----------------------------------------------------------------------
4 # Copyright (c) 2000-2004 Silicon Graphics, Inc. All Rights Reserved.
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License as
8 # published by the Free Software Foundation.
10 # This program is distributed in the hope that it would be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write the Free Software Foundation,
17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #-----------------------------------------------------------------------
21 # FS QA Test No. 098. Modified from UDFQA test 035
23 # simple attr tests for EAs:
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
88 echo "create file foo"
89 echo "file_contents" >foo
92 echo "should be no EAs for foo:"
95 echo "set EA <noise,woof>:"
96 attr -s noise -V woof foo
98 echo "set EA <colour,blue>:"
99 attr -s colour -V blue foo
101 echo "set EA <size,small>:"
102 attr -s size -V small foo
104 echo "list the EAs for foo: noise, colour, size"
107 echo "check the list again for foo"
110 echo "unmount the FS and see if EAs are persistent"
113 echo "check the list again for foo after umount/mount"
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 "remove the colour EA on foo"
128 echo "list EAs for foo: noise, size"
131 echo "get the value of the noise EA"
134 echo "get the value of the colour EA which was removed earlier"
137 echo "get the value of the size EA"
140 echo "list all the EAs again: noise, size"
143 echo "change the value of the size EA from small to huge"
144 attr -s size -V huge foo
146 echo "get the size EA which should now have value huge"
149 echo "list EAs: noise, size"
152 echo "remove the size EA from foo"
155 echo "list EAs: noise (size EA has been removed)"
158 echo "get the noise EA: woof"
161 echo "try removing non-existent EA named woof"
164 echo "try removing already removed EA size"
167 echo "list EAs: noise"
170 echo "try removing already removed EA colour"
173 echo "list EAs: noise"
176 echo "remove remaining EA noise"
179 echo "list EAs: should be no EAs left now"
182 echo "unmount the FS and see if EAs are persistent"
185 echo "list EAs: should still be no EAs left"
189 echo "*** Test out the root namespace ***"
192 echo "set EA <root:colour,marone>:"
193 attr -R -s colour -V marone foo
195 echo "set EA <user:colour,beige>:"
196 attr -s colour -V beige foo
198 echo "set EA <user:vomit,pizza>:"
199 attr -s vomit -V pizza foo
201 echo "set EA <root:noise,whack>:"
202 attr -R -s noise -V whack foo
204 echo "list root EAs: <root:colour,noise>:"
207 echo "list user EAs: <user:colour,vomit>:"
210 echo "get root EA colour: marone"
211 attr -R -g colour foo
213 echo "get root EA noise: whack"
216 echo "get root EA vomit which is a user EA => find nothing"
220 echo "unmount the FS and see if EAs are persistent"
224 echo "get root EA colour: marone"
225 attr -R -g colour foo
227 echo "get root EA noise: whack"
230 echo "get user EA vomit: pizza"
233 echo "remove the root colour EA"
234 attr -R -r colour foo
236 echo "list root EAs: <root:noise>:"
239 echo "list user EAs: <user:colour,vomit>:"
242 echo "remove the final root EA noise"
245 echo "list root EAs: none"
251 udf_db -f $SCRATCH_DEV | _db_filter
253 # Checks the udf filesystem
254 _check_udf_filesystem $SCRATCH_DEV
259 echo "delete the file foo - which will delete the associated streams"
265 udf_db -f $SCRATCH_DEV | _db_filter
267 # Checks the udf filesystem
268 _check_udf_filesystem $SCRATCH_DEV
270 # optional stuff if your test has verbose output to help resolve problems
272 #echo "If failure, check $seq.full (this) and $seq.full.ok (reference)"