fstests: explicitly specify xattr namespace
authorFrank van der Linden <fllinden@amazon.com>
Thu, 10 Sep 2020 19:43:55 +0000 (19:43 +0000)
committerEryu Guan <guaneryu@gmail.com>
Sun, 13 Sep 2020 16:45:14 +0000 (00:45 +0800)
Explicitly specify the xattr namespace required for tests.
This allows tests to be skipped correctly for filesystems
that don't support all xattr namespaces.

This changes all tests that require anything other than
the "user" xattr namespace. When called without arguments
as before, _require_attrs() still defaults to the "user"
namespace, so those tests do not need to be changed.

Signed-off-by: Frank van der Linden <fllinden@amazon.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
15 files changed:
tests/generic/062
tests/generic/093
tests/generic/097
tests/generic/403
tests/generic/449
tests/overlay/011
tests/overlay/026
tests/overlay/038
tests/overlay/041
tests/overlay/045
tests/overlay/046
tests/overlay/056
tests/xfs/063
tests/xfs/267
tests/xfs/268

index cab4b4faac7c87188ba2dfb7d3d6c0374d7f2d6b..78c1c95cc84e8d6ab3e870f90bdf32dc7c96f927 100755 (executable)
@@ -82,6 +82,10 @@ else
     ATTR_MODES="user trusted"
     ATTR_FILTER="^(user|trusted)"
 fi
+
+_require_attrs $ATTR_MODES
+
+
 for nsp in $ATTR_MODES; do
        for inode in reg dir lnk dev/b dev/c dev/p; do
 
index 10fdcfc788fbeaeaf457f674b7714f28b21ee839..7ffcfb7d90f8b122746ab4a88ccba24670a07d5a 100755 (executable)
@@ -35,7 +35,7 @@ _supported_fs generic
 _supported_os Linux
 
 _require_test
-_require_attrs
+_require_attrs security
 _require_user
 _require_test_program "writemod"
 _require_command "$SETCAP_PROG" "setcap"
index 39730bb054602e580ae09bc974ad3a03f90e7d1b..c2c82460b292ea17babb19f44d5440f3c7602b94 100755 (executable)
@@ -48,7 +48,7 @@ _supported_fs generic
 _supported_os Linux
 
 _require_test
-_require_attrs
+_require_attrs user trusted
 
 echo -e "\ncreate file foo"
 rm -f $file
index 39c64061935f0be53e586682c6c7af0ab8d5d9d8..9d9ea53942c0e6e6b60a5902cd1f4c239a51002a 100755 (executable)
@@ -36,7 +36,7 @@ rm -f $seqres.full
 _supported_fs generic
 _supported_os Linux
 _require_scratch
-_require_attrs
+_require_attrs trusted
 
 _scratch_mkfs > $seqres.full 2>&1 || _fail "mkfs"
 _scratch_mount
index 21b920bf6a50f79410cdd7bbb1b68f12a357aaa2..129ac9a89799c78bcdebc46119558950366dc131 100755 (executable)
@@ -39,7 +39,7 @@ _supported_os Linux
 _require_scratch
 _require_test
 _require_acls
-_require_attrs
+_require_attrs trusted
 
 _scratch_mkfs_sized $((256 * 1024 * 1024)) >> $seqres.full 2>&1
 _scratch_mount || _fail "mount failed"
index 1d09341b250aec311163064657ccf6f8399960a2..b491c37adf0c295de12a399da4a05de02aef78d3 100755 (executable)
@@ -37,7 +37,7 @@ _supported_fs overlay
 _supported_os Linux
 _require_test
 _require_scratch
-_require_attrs
+_require_attrs trusted
 
 # Remove all files from previous tests
 _scratch_mkfs
index d0d2a5bf9f2a621c8696a3a4b1b2f1f97e858315..84fc2412d806009aeefcdf039b7a0e5ffec8ae51 100755 (executable)
@@ -53,7 +53,7 @@ rm -f $seqres.full
 _supported_fs overlay
 _supported_os Linux
 _require_scratch
-_require_attrs
+_require_attrs trusted
 
 # Remove all files from previous tests
 _scratch_mkfs
index 25f9979bec9be50d0354024e1420870a23fcff02..98267d336b290045432f978108b5192ba88e308e 100755 (executable)
@@ -32,7 +32,7 @@ _supported_os Linux
 # Use non-default scratch underlying overlay dirs, we need to check
 # them explicity after test.
 _require_scratch_nocheck
-_require_attrs
+_require_attrs trusted
 _require_test_program "t_dir_type"
 
 rm -f $seqres.full
index 277fb913016deec1d50ad5edd6c17539e4b01bad..d23de4f920940e924c93b45e9c6aec9f17d2f350 100755 (executable)
@@ -35,7 +35,7 @@ _supported_os Linux
 # them explicity after test.
 _require_scratch_nocheck
 _require_test
-_require_attrs
+_require_attrs trusted
 _require_test_program "t_dir_type"
 
 rm -f $seqres.full
index 34b7ce4c3bf24b2cc787aec0d5ee5e41019fd340..e5e65734a376fc84cc35d92d7238e9f80b6e2d4b 100755 (executable)
@@ -33,7 +33,7 @@ rm -f $seqres.full
 _supported_fs overlay
 _supported_os Linux
 _require_scratch_nocheck
-_require_attrs
+_require_attrs trusted
 _require_command "$FSCK_OVERLAY_PROG" fsck.overlay
 
 OVL_XATTR_OPAQUE_VAL=y
index 36c7420790103bb003d6269391cc576e36ea5f13..fe912ff3a088b432487e8bb5bc8a2b0cf113ec57 100755 (executable)
@@ -33,7 +33,7 @@ rm -f $seqres.full
 _supported_fs overlay
 _supported_os Linux
 _require_scratch_nocheck
-_require_attrs
+_require_attrs trusted
 _require_command "$FSCK_OVERLAY_PROG" fsck.overlay
 
 # remove all files from previous tests
index dc7b98cbe4120fa760f5737634a00fd261206e4d..35169c36ae3295cabb77b87c22708264c12e4e84 100755 (executable)
@@ -33,7 +33,7 @@ rm -f $seqres.full
 _supported_fs overlay
 _supported_os Linux
 _require_scratch_nocheck
-_require_attrs
+_require_attrs trusted
 _require_command "$FSCK_OVERLAY_PROG" fsck.overlay
 
 OVL_XATTR_IMPURE_VAL=y
index b6d4c03ad9e7c5aa84a046096c5b35cbaaa28360..85ab1aa8b508eb346788ca1fc69a675ebe193978 100755 (executable)
@@ -32,7 +32,7 @@ _cleanup()
 _supported_fs xfs
 _supported_os Linux
 
-_require_attrs
+_require_attrs trusted user
 
 # create files with EAs
 _create_dumpdir_fill_ea
index d13ec19a53dfa6c5b8d3e7070af8e7ce9f133c87..f0c60350bdc6db90a7eb7d9ab43cedd0c9ef5c40 100755 (executable)
@@ -52,7 +52,7 @@ _supported_fs xfs
 _supported_os Linux
 
 _require_tape $TAPE_DEV
-_require_attrs
+_require_attrs trusted
 
 _create_files
 _erase_hard
index fa5b9283dc036f3a5082ae75493e401f08dface8..070346717e8d17efb40b7993665a1106b1e15905 100755 (executable)
@@ -55,7 +55,7 @@ _supported_fs xfs
 _supported_os Linux
 
 _require_tape $TAPE_DEV
-_require_attrs
+_require_attrs trusted user
 
 _create_files
 _erase_hard