mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
fstests: check for filesystem FS_IOC_FSSETXATTR support
With "_require_xfs_io_command chattr <letter>", check that flag can be set/cleared using FS_IOC_FSSETXATTR ioctl, similar to "_require_chattr <letter>" and FS_IOC_SETFLAGS ioctl. Update the documentation and the tests that use "_require_xfs_io_command chattr" to test filesystem support and not only xfs_io support. Signed-off-by: Amir Goldstein <amir73il@gmail.com> Reviewed-by: Eryu Guan <guaneryu@gmail.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
committed by
Eryu Guan
parent
8de6e5535b
commit
e28c4e69a4
@@ -2090,6 +2090,16 @@ _require_xfs_io_command()
|
||||
local testfile=$TEST_DIR/$$.xfs_io
|
||||
local testio
|
||||
case $command in
|
||||
"chattr")
|
||||
if [ -z "$param" ]; then
|
||||
param=s
|
||||
fi
|
||||
# Test xfs_io chattr support AND
|
||||
# filesystem FS_IOC_FSSETXATTR support
|
||||
testio=`$XFS_IO_PROG -F -f -c "chattr +$param" $testfile 2>&1`
|
||||
$XFS_IO_PROG -F -f -r -c "chattr -$param" $testfile 2>&1
|
||||
param_checked="+$param"
|
||||
;;
|
||||
"chproj")
|
||||
testio=`$XFS_IO_PROG -F -f -c "chproj 0" $testfile 2>&1`
|
||||
;;
|
||||
|
||||
@@ -69,7 +69,7 @@ _require_xfs_io_command <name> [<switch>]
|
||||
switch. For example:
|
||||
|
||||
_require_xfs_io_command "falloc"
|
||||
_require_xfs_io_command "chattr" "+/-x"
|
||||
_require_xfs_io_command "chattr" "x"
|
||||
|
||||
The first requires that xfs_io support the falloc command and the second
|
||||
that it supports the chattr command and that the chattr command supports
|
||||
|
||||
+2
-3
@@ -21,7 +21,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 7 15
|
||||
workdir="$TEST_DIR/test-$seq"
|
||||
_cleanup()
|
||||
{
|
||||
$CHATTR_PROG -i $workdir/immutable > /dev/null 2>&1
|
||||
$XFS_IO_PROG -f -r -c "chattr -i" $workdir/immutable >/dev/null 2>&1
|
||||
cd /
|
||||
rm -f $tmp.*
|
||||
}
|
||||
@@ -37,9 +37,8 @@ _supported_fs generic
|
||||
rm -f $seqres.full
|
||||
|
||||
_require_test
|
||||
_require_chattr i
|
||||
_require_xfs_io_command "copy_range"
|
||||
_require_xfs_io_command "chattr"
|
||||
_require_xfs_io_command "chattr" "i"
|
||||
|
||||
rm -rf $workdir
|
||||
mkdir $workdir
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ _supported_os Linux
|
||||
_require_scratch_dax
|
||||
_require_test_program "feature"
|
||||
_require_test_program "t_mmap_dio"
|
||||
_require_xfs_io_command "chattr" "+/-x"
|
||||
_require_xfs_io_command "chattr" "x"
|
||||
_require_xfs_io_command "falloc"
|
||||
|
||||
prep_files()
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ rm -f $seqres.full
|
||||
# Modify as appropriate.
|
||||
_supported_fs xfs
|
||||
_supported_os Linux
|
||||
_require_xfs_io_command "chattr"
|
||||
_require_xfs_io_command "chattr" "t"
|
||||
_require_xfs_io_command "fsync"
|
||||
_require_xfs_io_command "pwrite"
|
||||
_require_scratch
|
||||
|
||||
Reference in New Issue
Block a user