6 #-----------------------------------------------------------------------
7 # Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
8 #-----------------------------------------------------------------------
14 echo "QA output created by $seq"
18 status=0 # success is the default!
19 trap "_cleanup; rm -f $tmp.* $testfile; exit \$status" 0 1 2 3 15
21 # get standard environment, filters and checks
32 sed "s#$testdir[^ :]*#<TESTFILE>#g;
33 s#$tmp[^ :]*#<TMPFILE>#g" $1
38 attr $* 2>$tmp.err >$tmp.out
47 getfattr $* 2>$tmp.err >$tmp.out
58 echo " *** print attributes"
59 if ! _getfattr -d -e text --absolute-names $file
61 echo " !!! error return"
67 # real QA test starts here
71 [ -x /usr/bin/attr ] || _notrun "attr is not installed"
72 [ -x /usr/bin/getfattr ] || _notrun "getfattr is not installed"
78 testfile=$testdir/attribute_$$
80 echo "*** list non-existant file"
83 echo "*** list empty file"
87 echo "*** query non-existant attribute"
88 _attr -g "nonexistant" $testfile 2>&1
90 echo "*** one attribute"
91 echo "fish" | _attr -s fish $testfile
94 echo "*** replace attribute"
95 echo "fish3" | _attr -s fish $testfile
98 echo "*** add attribute"
99 echo "fish2" | _attr -s snrub $testfile
102 echo "*** remove attribute"
103 _attr -r fish $testfile
106 echo "*** add lots of attributes"
108 while [ $v -lt 1000 ]
110 echo "value_$v" | attr -s "attribute_$v" $testfile >>$seq.full
113 echo "!!! failed to add \"attribute_$v\""
121 # don't print it all out...
122 getfattr --absolute-names $testfile \
128 END {print " *** " (l - 1) " attribute(s)" }'
130 echo "*** remove lots of attributes"
132 while [ $v -lt 1000 ]
134 if ! attr -r "attribute_$v" $testfile >>$seq.full
136 echo "!!! failed to remove \"attribute_$v\""
145 echo "*** really long value"
146 dd if=/dev/zero bs=1024 count=100 2>/dev/null \
147 | _attr -s "long_attr" $testfile >/dev/null
149 _attr -g "long_attr" $testfile | tail -n +2 | od -t x1
150 _attr -r "long_attr" $testfile >/dev/null
153 echo "*** set/get/remove really long names (expect failure)"
155 long="$short$short$short$short$short$short$short$short$short$short"
156 vlong="$long$long$long"
158 _attr -s $vlong -V fish $testfile 2>&1 >/dev/null
159 _attr -g $vlong $testfile 2>&1 >/dev/null
160 _attr -r $vlong $testfile 2>&1 >/dev/null
162 echo "*** check final"