diff mbox series

[2/2,v2] btrfs-progs: tests: check for btrfs ACL support

Message ID 7e35dc221bee1810d2a549edb7420378d866ff52.1687419918.git.anand.jain@oracle.com (mailing list archive)
State New, archived
Headers show
Series btrfs-progs: tests: fix no acl support | expand

Commit Message

Anand Jain June 22, 2023, 8:18 a.m. UTC
Fix failures caused by the lack of ACL support in btrfs. For example:

  $ make test
    ::
    [TEST/misc]   057-btrfstune-free-space-tree
    failed: setfacl -m u:root:x /Volumes/ws/btrfs-progs/tests/mnt/acls/acls.1
    test failed for case 057-btrfstune-free-space-tree
    make: *** [Makefile:493: test-misc] Error 1

Similar failures occurred in the test cases convert/001-ext2-basic,
convert/003-ext4-basic, convert/005-delete-all-rollback, and
convert/006-large-hole-extent.

Resolve it by adding a check for ACL support using the
check_kernel_support_acl() helper function. It gracefully handles the case
when ACL support is not compiled by calling _not_run().

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
v2:
 Merge individual test case fixes into a single patch.

 tests/convert-tests/001-ext2-basic/test.sh             | 1 +
 tests/convert-tests/003-ext4-basic/test.sh             | 1 +
 tests/convert-tests/005-delete-all-rollback/test.sh    | 1 +
 tests/convert-tests/006-large-hole-extent/test.sh      | 1 +
 tests/misc-tests/057-btrfstune-free-space-tree/test.sh | 1 +
 5 files changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/tests/convert-tests/001-ext2-basic/test.sh b/tests/convert-tests/001-ext2-basic/test.sh
index 4e8aaecb2f55..3ed3ed0b82c9 100755
--- a/tests/convert-tests/001-ext2-basic/test.sh
+++ b/tests/convert-tests/001-ext2-basic/test.sh
@@ -8,6 +8,7 @@  check_global_prereq mke2fs
 
 setup_root_helper
 prepare_test_dev
+check_kernel_support_acl
 
 # Iterate over defaults and options that are not tied to hardware capabilities
 # or number of devices
diff --git a/tests/convert-tests/003-ext4-basic/test.sh b/tests/convert-tests/003-ext4-basic/test.sh
index 8a0b2e333554..dd7bb59181b0 100755
--- a/tests/convert-tests/003-ext4-basic/test.sh
+++ b/tests/convert-tests/003-ext4-basic/test.sh
@@ -8,6 +8,7 @@  check_global_prereq mke2fs
 
 setup_root_helper
 prepare_test_dev
+check_kernel_support_acl
 
 # Iterate over defaults and options that are not tied to hardware capabilities
 # or number of devices
diff --git a/tests/convert-tests/005-delete-all-rollback/test.sh b/tests/convert-tests/005-delete-all-rollback/test.sh
index 0b668a6fc1de..17bf8a379b6b 100755
--- a/tests/convert-tests/005-delete-all-rollback/test.sh
+++ b/tests/convert-tests/005-delete-all-rollback/test.sh
@@ -10,6 +10,7 @@  check_global_prereq mke2fs
 
 setup_root_helper
 prepare_test_dev
+check_kernel_support_acl
 
 # simple wrapper for a convert test
 # $1: btrfs features, argument to -O
diff --git a/tests/convert-tests/006-large-hole-extent/test.sh b/tests/convert-tests/006-large-hole-extent/test.sh
index 872b4a6f6175..7d92eb463af8 100755
--- a/tests/convert-tests/006-large-hole-extent/test.sh
+++ b/tests/convert-tests/006-large-hole-extent/test.sh
@@ -13,6 +13,7 @@  check_global_prereq mke2fs
 
 setup_root_helper
 prepare_test_dev
+check_kernel_support_acl
 
 default_mke2fs="mke2fs -t ext4 -b 4096"
 convert_test_preamble '' 'large hole extent test' 16k "$default_mke2fs"
diff --git a/tests/misc-tests/057-btrfstune-free-space-tree/test.sh b/tests/misc-tests/057-btrfstune-free-space-tree/test.sh
index 93ff4307fca9..8d9a858ddc2f 100755
--- a/tests/misc-tests/057-btrfstune-free-space-tree/test.sh
+++ b/tests/misc-tests/057-btrfstune-free-space-tree/test.sh
@@ -10,6 +10,7 @@  check_prereq btrfs
 
 setup_root_helper
 prepare_test_dev
+check_kernel_support_acl
 
 run_check_mkfs_test_dev -O ^free-space-tree
 run_check_mount_test_dev