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 #-----------------------------------------------------------------------
31 echo "QA output created by $seq"
35 status=1 # failure is the default!
37 trap "_cleanup; exit \$status" 0 1 2 3 15
50 if [ "$FSTYP" == "xfs" ]; then
59 # get standard environment, filters and checks
63 # link correct .out file
64 # This is done bacause udf and xfs print attrs in different orders.
66 if [ "$FSTYP" == "xfs" ]; then
67 ln -s $seq.out.xfs $seq.out
69 ln -s $seq.out.udf $seq.out
72 # real QA test starts here
81 TARGET_DIR=$SCRATCH_MNT
82 [ "$FSTYP" == "xfs" ] && TARGET_DIR=$TEST_DIR
85 echo "create file foo"
89 echo "should be no EAs for foo:"
92 echo "set EA <noise,woof>:"
93 ${ATTR_PROG} -s noise -V woof foo
95 echo "set EA <colour,blue>:"
96 ${ATTR_PROG} -s colour -V blue foo
98 echo "set EA <size,small>:"
99 ${ATTR_PROG} -s size -V small foo
101 echo "list the EAs for foo: noise, colour, size"
104 echo "check the list again for foo"
107 echo "unmount the FS and see if EAs are persistent"
110 echo "check the list again for foo after umount/mount"
113 echo "get the value of the noise EA"
114 ${ATTR_PROG} -g noise foo
116 echo "get the value of the colour EA which was removed earlier"
117 ${ATTR_PROG} -g colour foo
119 echo "get the value of the size EA"
120 ${ATTR_PROG} -g size foo
122 echo "remove the colour EA on foo"
123 ${ATTR_PROG} -r colour foo
125 echo "list EAs for foo: noise, size"
128 echo "get the value of the noise EA"
129 ${ATTR_PROG} -g noise foo
131 echo "get the value of the colour EA which was removed earlier"
132 ${ATTR_PROG} -g colour foo
134 echo "get the value of the size EA"
135 ${ATTR_PROG} -g size foo
137 echo "list all the EAs again: noise, size"
140 echo "change the value of the size EA from small to huge"
141 ${ATTR_PROG} -s size -V huge foo
143 echo "get the size EA which should now have value huge"
144 ${ATTR_PROG} -g size foo
146 echo "list EAs: noise, size"
149 echo "remove the size EA from foo"
150 ${ATTR_PROG} -r size foo
152 echo "list EAs: noise (size EA has been removed)"
155 echo "get the noise EA: woof"
156 ${ATTR_PROG} -g noise foo
158 echo "try removing non-existent EA named woof"
159 ${ATTR_PROG} -r woof foo
161 echo "try removing already removed EA size"
162 ${ATTR_PROG} -r size foo
164 echo "list EAs: noise"
167 echo "try removing already removed EA colour"
168 ${ATTR_PROG} -r colour foo
170 echo "list EAs: noise"
173 echo "remove remaining EA noise"
174 ${ATTR_PROG} -r noise foo
176 echo "list EAs: should be no EAs left now"
179 echo "unmount the FS and see if EAs are persistent"
182 echo "list EAs: should still be no EAs left"
186 echo "*** Test out the root namespace ***"
189 echo "set EA <root:colour,marone>:"
190 ${ATTR_PROG} -R -s colour -V marone foo
192 echo "set EA <user:colour,beige>:"
193 ${ATTR_PROG} -s colour -V beige foo
195 echo "set EA <user:vomit,pizza>:"
196 ${ATTR_PROG} -s vomit -V pizza foo
198 echo "set EA <root:noise,whack>:"
199 ${ATTR_PROG} -R -s noise -V whack foo
201 echo "list root EAs: <root:colour,noise>:"
202 ${ATTR_PROG} -R -l foo
204 echo "list user EAs: <user:colour,vomit>:"
207 echo "get root EA colour: marone"
208 ${ATTR_PROG} -R -g colour foo
210 echo "get root EA noise: whack"
211 ${ATTR_PROG} -R -g noise foo
213 echo "get root EA vomit which is a user EA => find nothing"
214 ${ATTR_PROG} -R -g vomit foo
217 echo "unmount the FS and see if EAs are persistent"
221 echo "get root EA colour: marone"
222 ${ATTR_PROG} -R -g colour foo
224 echo "get root EA noise: whack"
225 ${ATTR_PROG} -R -g noise foo
227 echo "get user EA vomit: pizza"
228 ${ATTR_PROG} -g vomit foo
230 echo "remove the root colour EA"
231 ${ATTR_PROG} -R -r colour foo
233 echo "list root EAs: <root:noise>:"
234 ${ATTR_PROG} -R -l foo
236 echo "list user EAs: <user:colour,vomit>:"
239 echo "remove the final root EA noise"
240 ${ATTR_PROG} -R -r noise foo
242 echo "list root EAs: none"
243 ${ATTR_PROG} -R -l foo
248 # Check the filesystem
251 # optional stuff if your test has verbose output to help resolve problems
253 #echo "If failure, check $seq.full (this) and $seq.full.ok (reference)"