diff options
author | Anand Jain <anand.jain@oracle.com> | 2023-11-08 16:51:20 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2023-11-09 15:26:44 +0100 |
commit | 6049b56971a0ed33ce069fa149c370c7aed70342 (patch) | |
tree | be0470b04fd2a99fe2736ea1ad35cf42a7c050e2 | |
parent | d7c6baf82f2da9d8ce1c0ea83c2ae75c041f1888 (diff) | |
download | btrfs-progs-6049b56971a0ed33ce069fa149c370c7aed70342.tar.gz |
btrfs-progs: tests: use new sysfs interface to check prereq ACL
With the kernel commit 070bb0011ccf ("btrfs: sysfs: show if ACL
support has been compiled in") we can now check if ACL is compiled
without requiring a btrfs device. Retain older method for older
kernels.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r-- | tests/common | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/common b/tests/common index 9621600c..771acaa3 100644 --- a/tests/common +++ b/tests/common @@ -578,11 +578,20 @@ setup_root_helper() # Check if btrfs is compiled with CONFIG_BTRFS_FS_POSIX_ACL, may need TEST_DEV. check_kernel_support_acl() { + if [ -f /sys/fs/btrfs/features/acl ]; then + if grep -q 0 /sys/fs/btrfs/features/acl; then + _not_run "ACL is not compiled in" + fi + return + fi + + # It is an older kernel without acl sysfs interface. if [ -f /proc/config.gz ] && \ ! zgrep -q "^CONFIG_BTRFS_FS_POSIX_ACL=y" /proc/config.gz; then _not_run "ACL is not compiled in" fi + # If kernel is without the /proc/config.gz file. run_check_mkfs_test_dev run_check_mount_test_dev |