Merge of xfs-cmds-2.4.18:slinx:111985a by nathans.
authorfsgqa <fsgqa>
Mon, 25 Feb 2002 22:33:42 +0000 (22:33 +0000)
committerfsgqa <fsgqa>
Mon, 25 Feb 2002 22:33:42 +0000 (22:33 +0000)
  getfattr/setfattr fixes

020
020.out
021
021.out
053.out
057
062
062.out

diff --git a/020 b/020
index 938b22b4c3cdfed06d735c1c9f0b0417812b336b..a5f99d01e4f5099b06923b2aa9ab5049a35d65b2 100755 (executable)
--- a/020
+++ b/020
@@ -81,7 +81,7 @@ _attr_list()
     file=$1
     
     echo "   *** print attributes"
-    if ! _getfattr -ad $file >$tmp.raw
+    if ! _getfattr -ad $file
     then
         echo "      !!! error return"
         return 1
@@ -93,6 +93,8 @@ _attr_list()
 
 # real QA test starts here
 
+rm -f $seq.full
+
 testfile=$TEST_DIR/attribute_$$
 
 echo "*** list non-existant file"
@@ -128,7 +130,7 @@ echo "*** add lots of attributes"
 v=0
 while [ $v -lt 1000 ]
 do
-    echo "value_$v" | attr -s "attribute_$v" $testfile >/dev/null
+    echo "value_$v" | attr -s "attribute_$v" $testfile >>$seq.full
     if [ $? -ne 0 ]
     then
         echo "!!! failed to add \"attribute_$v\""
@@ -140,14 +142,19 @@ done
 
 echo "*** check"
 # don't print it all out...
-getfattr $testfile \
-    | $AWK_PROG '{ l++ } END {print "   *** " (l - 1) " attribute(s)" }'
+getfattr -a $testfile \
+    | tee -a $seq.full \
+    | $AWK_PROG '
+       /^#/ { next }
+       /^[     ]*$/ { next }
+        { l++ } 
+       END {print "   *** " (l - 1) " attribute(s)" }'
 
 echo "*** remove lots of attributes"
 v=0
 while [ $v -lt 1000 ]
 do
-    if ! attr -r "attribute_$v" $testfile >/dev/null
+    if ! attr -r "attribute_$v" $testfile >>$seq.full
     then
         echo "!!! failed to remove \"attribute_$v\""
         exit 1
diff --git a/020.out b/020.out
index 97fd946afd2a63cf6c4c6036951b766b47720220..ff385f4d7fef8ad7780cfd4b2f9453809ab72ecb 100644 (file)
--- a/020.out
+++ b/020.out
@@ -1,17 +1,12 @@
 QA output created by 020
 *** list non-existant file
    *** print attributes
-attr_list: No such file or directory
-Could not list attributes for <TESTFILE>
+getfattr: <TESTFILE>: No such file or directory
       !!! error return
 *** list non-xfs file (in /proc)
    *** print attributes
-attr_list: Operation not supported
-Could not list attributes for <PROCFILE>
-      !!! error return
 *** list empty file
    *** print attributes
-      *** 0 attribute(s)
 *** query non-existant attribute
 attr_get: No data available
 Could not get "nonexistant" for <TESTFILE>
@@ -20,62 +15,54 @@ Attribute "fish" set to a 5 byte value for <TESTFILE>:
 fish
 
    *** print attributes
-      *** 1 attribute(s)
-         *** field: fish length: 5
-            ::: fish
-            ::: 
+# file: <TESTFILE>
+user.fish="fish\012"
+
 *** replace attribute
 Attribute "fish" set to a 6 byte value for <TESTFILE>:
 fish3
 
    *** print attributes
-      *** 1 attribute(s)
-         *** field: fish length: 6
-            ::: fish3
-            ::: 
+# file: <TESTFILE>
+user.fish="fish3\012"
+
 *** add attribute
 Attribute "snrub" set to a 6 byte value for <TESTFILE>:
 fish2
 
    *** print attributes
-      *** 2 attribute(s)
-         *** field: fish length: 6
-            ::: fish3
-            ::: 
-         *** field: snrub length: 6
-            ::: fish2
-            ::: 
+# file: <TESTFILE>
+user.fish="fish3\012"
+user.snrub="fish2\012"
+
 *** remove attribute
    *** print attributes
-      *** 1 attribute(s)
-         *** field: snrub length: 6
-            ::: fish2
-            ::: 
+# file: <TESTFILE>
+user.snrub="fish2\012"
+
 *** add lots of attributes
 *** check
-   *** 1001 attribute(s)
+   *** 1000 attribute(s)
 *** remove lots of attributes
    *** print attributes
-      *** 1 attribute(s)
-         *** field: snrub length: 6
-            ::: fish2
-            ::: 
+# file: <TESTFILE>
+user.snrub="fish2\012"
+
 *** really long value
 0000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 *
 0200000 0a
 0200001
 *** set/get/remove really long names (expect failure)
-attr_set: Bad address
+attr_set: Invalid argument
 Could not set "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" for <TESTFILE>
-attr_get: Bad address
+attr_get: Invalid argument
 Could not get "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" for <TESTFILE>
-attr_remove: Bad address
+attr_remove: Invalid argument
 Could not remove "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" for <TESTFILE>
 *** check final
    *** print attributes
-      *** 1 attribute(s)
-         *** field: snrub length: 6
-            ::: fish2
-            ::: 
+# file: <TESTFILE>
+user.snrub="fish2\012"
+
 *** delete
diff --git a/021 b/021
index 2c7a9ce8ed7beea6623d9a547039d3b0b11b204a..f06d8286756dad7033073730a09780c057dc8cf3 100755 (executable)
--- a/021
+++ b/021
@@ -111,11 +111,19 @@ echo "*** make test file 2"
 touch $testfile.2
 echo "value_1" | _attr -s "a1" $testfile.2 >/dev/null
 echo "value_2" | _attr -s "a2-----" $testfile.2 >/dev/null
-
 (echo start ; dd if=/dev/zero bs=65525 count=1 ; echo end ) \
     | _attr -s "a3" $testfile.2 >/dev/null
-    
 _getfattr -a $testfile.2
+
+# print name and size from 1st line of output
+_attr -g "a3" $testfile.2 | head -1
+
+# print out the rest of the data apart from the header
+# the size is +1 for an extra \n at the end
+echo -n "size of attr value = "
+_attr -g "a3" $testfile.2 | tail -3 | wc -c
+echo ""
+
 inum_2=`ls -li $testfile.2 | $AWK_PROG '{ print $1 }'`
     
 echo "*** unmount FS"
@@ -131,5 +139,4 @@ echo "*** dump attributes (2)"
 xfs_db -r -c "inode $inum_2" -c "a a.bmx[0].startblock" -c "print" $SCRATCH_DEV
     
 echo "*** done"
-rm $seq.full
 exit
diff --git a/021.out b/021.out
index 34864b41b8515d6832606f00236c3a7bd3b989ed..8a871c168442213c7e51711fc7025bbf918d80d9 100644 (file)
--- a/021.out
+++ b/021.out
@@ -2,14 +2,21 @@ QA output created by 021
 *** mkfs
 *** mount FS
 *** make test file 1
-Attribute "a1" has a 3 byte value for <TESTFILE>.1
-Attribute "a2--" has a 5 byte value for <TESTFILE>.1
+# file: <TESTFILE>.1
+user.a1
+user.a2--
+
 *** make test file 2
 1+0 records in
 1+0 records out
-Attribute "a1" has a 8 byte value for <TESTFILE>.2
-Attribute "a3" has a 65535 byte value for <TESTFILE>.2
-Attribute "a2-----" has a 8 byte value for <TESTFILE>.2
+# file: <TESTFILE>.2
+user.a1
+user.a2-----
+user.a3
+
+Attribute "a3" had a 65535 byte value for <TESTFILE>.2:
+size of attr value =   65536
+
 *** unmount FS
 *** dump attributes (1)
 a.sfattr.hdr.totsize = 24
diff --git a/053.out b/053.out
index 1764d0647cfe4a0557c5dbe9a32da6050eaef5d7..cd71cbbaf321897f624e23d101b21a6556d7a243 100644 (file)
--- a/053.out
+++ b/053.out
@@ -7,9 +7,9 @@ $SCRATCH_MNT/test.1 [u::r-x,g::---,o::---]
 $SCRATCH_MNT/test.2 [u::---,g::r-x,o::---]
 $SCRATCH_MNT/test.3 [u::---,g::---,o::r-x]
 $SCRATCH_MNT/test.4 [u::---,g::r-x,o::rwx]
-$SCRATCH_MNT/test.5 [u::---,g::---,o::---,u:id2:r-x,m::rwx]
+$SCRATCH_MNT/test.5 [u::---,u:id2:r-x,g::---,m::rwx,o::---]
 $SCRATCH_MNT/test.6 [u::rwx,g::r-x,o::r--]
-$SCRATCH_MNT/test.7 [u::---,g::---,o::---,g:id2:r-x,m::-w-]
+$SCRATCH_MNT/test.7 [u::---,g::---,g:id2:r-x,m::-w-,o::---]
 unmount $SCRATCH_DEV... done
 repair filesystem... done
 mount filesytem... done
@@ -19,6 +19,6 @@ $SCRATCH_MNT/test.1 [u::r-x,g::---,o::---]
 $SCRATCH_MNT/test.2 [u::---,g::r-x,o::---]
 $SCRATCH_MNT/test.3 [u::---,g::---,o::r-x]
 $SCRATCH_MNT/test.4 [u::---,g::r-x,o::rwx]
-$SCRATCH_MNT/test.5 [u::---,g::---,o::---,u:id2:r-x,m::rwx]
+$SCRATCH_MNT/test.5 [u::---,u:id2:r-x,g::---,m::rwx,o::---]
 $SCRATCH_MNT/test.6 [u::rwx,g::r-x,o::r--]
-$SCRATCH_MNT/test.7 [u::---,g::---,o::---,g:id2:r-x,m::-w-]
+$SCRATCH_MNT/test.7 [u::---,g::---,g:id2:r-x,m::-w-,o::---]
diff --git a/057 b/057
index 13602acc5f03516f932f66011a8dbfc2fa89c759..09a73d956c67b0ee3be208e9ccbb5f1c16459fc6 100755 (executable)
--- a/057
+++ b/057
@@ -98,6 +98,8 @@ _acl_on()
 }
 
 # real QA test starts here
+_notrun "irix get semantics no longer required"
+
 rm -f $seq.full
 
 _need_to_be_root
diff --git a/062 b/062
index 50fff13b917dd0754465f0cc2ca1b8a72dd14a07..6034f45bcf58f3ba4b0ca5080fe5e0d5d1d07021 100755 (executable)
--- a/062
+++ b/062
@@ -155,8 +155,8 @@ _extend_test_bed()
        mkdir -p $SCRATCH_MNT/descend/down/here
        find $SCRATCH_MNT/descend | xargs setfattr -n user.x -v yz
        find $SCRATCH_MNT/descend | xargs setfattr -n user.1 -v 23
-       find $SCRATCH_MNT/here | xargs setfattr -n root.a -v bc
-       find $SCRATCH_MNT/here | xargs setfattr -n root.9 -v 87
+       find $SCRATCH_MNT/here | xargs setfattr -n xfsroot.a -v bc
+       find $SCRATCH_MNT/here | xargs setfattr -n xfsroot.9 -v 87
        # whack a symlink in the middle, just to be difficult
        ln -s $SCRATCH_MNT/here/up $SCRATCH_MNT/descend/and
        # dump out our new starting point
diff --git a/062.out b/062.out
index bdf591cf1df8836d312f0bbde14e09bbf4fff938..2a765d4273306a19428ae109e38c75715fed14dc 100644 (file)
--- a/062.out
+++ b/062.out
@@ -587,8 +587,6 @@ SCRATCH_MNT/dev/p: xfsroot.name2: No such attribute
 # file: SCRATCH_MNT/dev/p
 user.name="\272\276"
 user.name3="\336\372\316"
-
-# file: SCRATCH_MNT/dev/p
 xfsroot.name="\272\276"
 xfsroot.name3="\336\372\316"
 
@@ -735,8 +733,8 @@ user.1=0x3233
 user.x=0x797a
 
 # file: SCRATCH_MNT/descend/and/ascend
-root.9=0x3837
-root.a=0x6263
+xfsroot.9=0x3837
+xfsroot.a=0x6263
 
 # file: SCRATCH_MNT/descend
 user.1=0x3233
@@ -771,8 +769,6 @@ xfsroot.name3=0xdeface
 # file: SCRATCH_MNT/dev/p
 user.name=0xbabe
 user.name3=0xdeface
-
-# file: SCRATCH_MNT/dev/p
 xfsroot.name=0xbabe
 xfsroot.name3=0xdeface