Add xfsdump support for the security extended attributes namespace.
[xfstests-dev.git] / 062
diff --git a/062 b/062
index 1b7e885dd78f716f463fa439783c7f3f9b75eb96..63014d37701e1df0e8ef3907320f3430fec51fda 100755 (executable)
--- a/062
+++ b/062
@@ -1,6 +1,5 @@
 #! /bin/sh
 # XFS QA Test No. 062
-# $Id: 1.1 $
 #
 # Exercises the getfattr/setfattr tools
 # Derived from tests originally written by Andreas Gruenbacher for ext2
@@ -92,11 +91,16 @@ _require_scratch
 rm -f $tmp.backup1 $tmp.backup2 $seq.full
 
 # real QA test starts here
-mkfs_xfs $SCRATCH_DEV | _filter_mkfs 2>$tmp.mkfs
-mount -t xfs $SCRATCH_DEV $SCRATCH_MNT || _fail "mount failed"
+_scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs
+_scratch_mount || _fail "mount failed"
 _create_test_bed
 
-for nsp in user trusted; do
+if [ "$USE_ATTR_SECURE" = yes ]; then
+    ATTR_MODES="user security trusted"
+else
+    ATTR_MODES="user trusted"
+fi
+for nsp in $ATTR_MODES; do
        for inode in reg dir lnk dev/b dev/c dev/p; do
 
                echo; echo "=== TYPE $inode; NAMESPACE $nsp"; echo
@@ -137,7 +141,7 @@ for nsp in user trusted; do
                getfattr -m $nsp -e hex -n $nsp.name2 $SCRATCH_MNT/$inode
 
                echo "*** final list (strings, type=$inode, nsp=$nsp)"
-               getfattr -m '^user|^trusted' -e hex $SCRATCH_MNT/$inode
+               getfattr -m '.' -e hex $SCRATCH_MNT/$inode
        done
 done
 
@@ -167,11 +171,11 @@ _extend_test_bed
 
 echo
 echo "*** directory descent with us following symlinks"
-getfattr -h -L -R -m '^user|^trusted' -e hex $SCRATCH_MNT
+getfattr -h -L -R -m '.' -e hex $SCRATCH_MNT
 
 echo
 echo "*** directory descent without following symlinks"
-getfattr -h -P -R -m '^user|^trusted' -e hex $SCRATCH_MNT
+getfattr -h -P -R -m '.' -e hex $SCRATCH_MNT
 
 
 # 
@@ -182,7 +186,7 @@ echo; echo
 _backup()
 {
        # NB: no filtering of scratch here... (need to restore too)
-       /usr/bin/getfattr --absolute-names -dh -R -m '^user|^system' $SCRATCH_MNT >$1
+       /usr/bin/getfattr --absolute-names -dh -R -m '.' $SCRATCH_MNT >$1
        echo BACKUP $1 >>$seq.full
        cat $1 >> $seq.full
        [ ! -s $1 ] && echo "warning: $1 (backup file) is empty"
@@ -194,7 +198,7 @@ _backup $tmp.backup1
 echo "*** clear out the scratch device"
 rm -fr $SCRATCH_MNT/*
 echo "AFTER REMOVE" >>$seq.full
-getfattr -L -R -m '^user|^trusted' $SCRATCH_MNT >>$seq.full
+getfattr -L -R -m '.' $SCRATCH_MNT >>$seq.full
 
 echo "*** reset test bed with no extended attributes"
 _create_test_bed
@@ -205,7 +209,7 @@ setfattr -h --restore=$tmp.backup1
 _backup $tmp.backup2
 
 echo "AFTER RESTORE" >>$seq.full
-getfattr -L -R -m '^user|^trusted' $SCRATCH_MNT >>$seq.full
+getfattr -L -R -m '.' $SCRATCH_MNT >>$seq.full
 
 echo "*** compare before and after backups"
 diff $tmp.backup1 $tmp.backup2