6 #-----------------------------------------------------------------------
7 # Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
9 # This program is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU General Public License as
11 # published by the Free Software Foundation.
13 # This program is distributed in the hope that it would be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write the Free Software Foundation,
20 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #-----------------------------------------------------------------------
28 echo "QA output created by $seq"
32 status=0 # success is the default!
33 trap "_cleanup; rm -f $tmp.* $testfile; exit \$status" 0 1 2 3 15
35 # get standard environment, filters and checks
47 sed "s#$testdir[^ :]*#<TESTFILE>#g;
48 s#$tmp[^ :]*#<TMPFILE>#g" $1
53 $ATTR_PROG $* 2>$tmp.err >$tmp.out
62 $GETFATTR_PROG $* 2>$tmp.err >$tmp.out
73 echo " *** print attributes"
74 if ! _getfattr -d -e text --absolute-names $file
76 echo " !!! error return"
82 # real QA test starts here
92 testfile=$testdir/attribute_$$
94 echo "*** list non-existant file"
97 echo "*** list empty file"
101 echo "*** query non-existant attribute"
102 _attr -g "nonexistant" $testfile 2>&1
104 echo "*** one attribute"
105 echo "fish" | _attr -s fish $testfile
108 echo "*** replace attribute"
109 echo "fish3" | _attr -s fish $testfile
112 echo "*** add attribute"
113 echo "fish2" | _attr -s snrub $testfile
116 echo "*** remove attribute"
117 _attr -r fish $testfile
120 echo "*** add lots of attributes"
122 while [ $v -lt 1000 ]
124 echo "value_$v" | attr -s "attribute_$v" $testfile >>$seq.full
127 echo "!!! failed to add \"attribute_$v\""
135 # don't print it all out...
136 getfattr --absolute-names $testfile \
142 END {print " *** " (l - 1) " attribute(s)" }'
144 echo "*** remove lots of attributes"
146 while [ $v -lt 1000 ]
148 if ! $ATTR_PROG -r "attribute_$v" $testfile >>$seq.full
150 echo "!!! failed to remove \"attribute_$v\""
159 echo "*** really long value"
160 dd if=/dev/zero bs=1024 count=100 2>/dev/null \
161 | _attr -s "long_attr" $testfile >/dev/null
163 _attr -g "long_attr" $testfile | tail -n +2 | od -t x1
164 _attr -r "long_attr" $testfile >/dev/null
167 echo "*** set/get/remove really long names (expect failure)"
169 long="$short$short$short$short$short$short$short$short$short$short"
170 vlong="$long$long$long"
172 _attr -s $vlong -V fish $testfile 2>&1 >/dev/null
173 _attr -g $vlong $testfile 2>&1 >/dev/null
174 _attr -r $vlong $testfile 2>&1 >/dev/null
176 echo "*** check final"