mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
Update QA tests to work with new attribute code (trusted namespace).
This commit is contained in:
@@ -96,7 +96,7 @@ mkfs_xfs $SCRATCH_DEV | _filter_mkfs 2>$tmp.mkfs
|
|||||||
mount -t xfs $SCRATCH_DEV $SCRATCH_MNT || _fail "mount failed"
|
mount -t xfs $SCRATCH_DEV $SCRATCH_MNT || _fail "mount failed"
|
||||||
_create_test_bed
|
_create_test_bed
|
||||||
|
|
||||||
for nsp in user xfsroot; do
|
for nsp in user trusted; do
|
||||||
for inode in reg dir lnk dev/b dev/c dev/p; do
|
for inode in reg dir lnk dev/b dev/c dev/p; do
|
||||||
|
|
||||||
echo; echo "=== TYPE $inode; NAMESPACE $nsp"; echo
|
echo; echo "=== TYPE $inode; NAMESPACE $nsp"; echo
|
||||||
@@ -137,7 +137,7 @@ for nsp in user xfsroot; do
|
|||||||
getfattr -m $nsp -e hex -n $nsp.name2 $SCRATCH_MNT/$inode
|
getfattr -m $nsp -e hex -n $nsp.name2 $SCRATCH_MNT/$inode
|
||||||
|
|
||||||
echo "*** final list (strings, type=$inode, nsp=$nsp)"
|
echo "*** final list (strings, type=$inode, nsp=$nsp)"
|
||||||
getfattr -m '^user|^xfsroot' -e hex $SCRATCH_MNT/$inode
|
getfattr -m '^user|^trusted' -e hex $SCRATCH_MNT/$inode
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -155,8 +155,8 @@ _extend_test_bed()
|
|||||||
mkdir -p $SCRATCH_MNT/descend/down/here
|
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.x -v yz
|
||||||
find $SCRATCH_MNT/descend | xargs setfattr -n user.1 -v 23
|
find $SCRATCH_MNT/descend | xargs setfattr -n user.1 -v 23
|
||||||
find $SCRATCH_MNT/here | xargs setfattr -n xfsroot.a -v bc
|
find $SCRATCH_MNT/here | xargs setfattr -n trusted.a -v bc
|
||||||
find $SCRATCH_MNT/here | xargs setfattr -n xfsroot.9 -v 87
|
find $SCRATCH_MNT/here | xargs setfattr -n trusted.9 -v 87
|
||||||
# whack a symlink in the middle, just to be difficult
|
# whack a symlink in the middle, just to be difficult
|
||||||
ln -s $SCRATCH_MNT/here/up $SCRATCH_MNT/descend/and
|
ln -s $SCRATCH_MNT/here/up $SCRATCH_MNT/descend/and
|
||||||
# dump out our new starting point
|
# dump out our new starting point
|
||||||
@@ -167,11 +167,11 @@ _extend_test_bed
|
|||||||
|
|
||||||
echo
|
echo
|
||||||
echo "*** directory descent with us following symlinks"
|
echo "*** directory descent with us following symlinks"
|
||||||
getfattr -h -L -R -m '^user|^xfsroot' -e hex $SCRATCH_MNT
|
getfattr -h -L -R -m '^user|^trusted' -e hex $SCRATCH_MNT
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "*** directory descent without following symlinks"
|
echo "*** directory descent without following symlinks"
|
||||||
getfattr -h -P -R -m '^user|^xfsroot' -e hex $SCRATCH_MNT
|
getfattr -h -P -R -m '^user|^trusted' -e hex $SCRATCH_MNT
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -194,7 +194,7 @@ _backup $tmp.backup1
|
|||||||
echo "*** clear out the scratch device"
|
echo "*** clear out the scratch device"
|
||||||
rm -fr $SCRATCH_MNT/*
|
rm -fr $SCRATCH_MNT/*
|
||||||
echo "AFTER REMOVE" >>$seq.full
|
echo "AFTER REMOVE" >>$seq.full
|
||||||
getfattr -L -R -m '^user|^xfsroot' $SCRATCH_MNT >>$seq.full
|
getfattr -L -R -m '^user|^trusted' $SCRATCH_MNT >>$seq.full
|
||||||
|
|
||||||
echo "*** reset test bed with no extended attributes"
|
echo "*** reset test bed with no extended attributes"
|
||||||
_create_test_bed
|
_create_test_bed
|
||||||
@@ -205,7 +205,7 @@ setfattr -h --restore=$tmp.backup1
|
|||||||
_backup $tmp.backup2
|
_backup $tmp.backup2
|
||||||
|
|
||||||
echo "AFTER RESTORE" >>$seq.full
|
echo "AFTER RESTORE" >>$seq.full
|
||||||
getfattr -L -R -m '^user|^xfsroot' $SCRATCH_MNT >>$seq.full
|
getfattr -L -R -m '^user|^trusted' $SCRATCH_MNT >>$seq.full
|
||||||
|
|
||||||
echo "*** compare before and after backups"
|
echo "*** compare before and after backups"
|
||||||
diff $tmp.backup1 $tmp.backup2
|
diff $tmp.backup1 $tmp.backup2
|
||||||
|
|||||||
+2
-2
@@ -1170,10 +1170,10 @@ _get_eas_on_path()
|
|||||||
done
|
done
|
||||||
|
|
||||||
echo "Root names"
|
echo "Root names"
|
||||||
getfattr --absolute-names -Rh -m xfsroot $_path |\
|
getfattr --absolute-names -Rh -m trusted $_path |\
|
||||||
perl -wn -e '
|
perl -wn -e '
|
||||||
if (m/^# file: (\S+)/) { $file = $1 }
|
if (m/^# file: (\S+)/) { $file = $1 }
|
||||||
elsif (m/^xfsroot\.(\w+)/) { print $file, " ",$1,"\n" }' |\
|
elsif (m/^trusted\.(\w+)/) { print $file, " ",$1,"\n" }' |\
|
||||||
sort |\
|
sort |\
|
||||||
while read file ea_name; do
|
while read file ea_name; do
|
||||||
attr -R -g $ea_name $file
|
attr -R -g $ea_name $file
|
||||||
|
|||||||
Reference in New Issue
Block a user