mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
Update to allow this test to be easily extended for exercising the security namespace.
This commit is contained in:
@@ -95,7 +95,7 @@ _scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs
|
||||
_scratch_mount || _fail "mount failed"
|
||||
_create_test_bed
|
||||
|
||||
for nsp in user trusted; do
|
||||
for nsp in user trusted; do # security
|
||||
for inode in reg dir lnk dev/b dev/c dev/p; do
|
||||
|
||||
echo; echo "=== TYPE $inode; NAMESPACE $nsp"; echo
|
||||
@@ -136,7 +136,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
|
||||
|
||||
@@ -166,11 +166,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
|
||||
|
||||
|
||||
#
|
||||
@@ -181,7 +181,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"
|
||||
@@ -193,7 +193,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
|
||||
@@ -204,7 +204,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
|
||||
|
||||
Reference in New Issue
Block a user