From 1fb1ae8ebb364b02e198d2f69d616f11a2f4e4f2 Mon Sep 17 00:00:00 2001 From: Anand Jain Date: Thu, 22 Jun 2023 16:18:11 +0800 Subject: [PATCH] btrfs-progs: tests: add helper to check if ACLs are supported Some test cases are failing when ACL is not compiled in the system. Instead, they should be marked as 'not_run'. Signed-off-by: Anand Jain Signed-off-by: David Sterba --- tests/common | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/common b/tests/common index d985ef72..602a4122 100644 --- a/tests/common +++ b/tests/common @@ -575,6 +575,24 @@ setup_root_helper() SUDO_HELPER=root_helper } +# Check if btrfs is compiled with CONFIG_BTRFS_FS_POSIX_ACL, may need TEST_DEV. +check_kernel_support_acl() +{ + 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 + + run_check_mkfs_test_dev + run_check_mount_test_dev + + if grep "$TEST_MNT" /proc/self/mounts | grep -q noacl; then + run_check_umount_test_dev + _not_run "ACL is not compiled in" + fi + run_check_umount_test_dev +} + prepare_test_dev() { # num[K/M/G/T...]