#! /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
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
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
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
#
_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"
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
_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