btrfs-progs: tests: fix no acl support
PATCH v2 1/2 btrfs-progs: tests: add helper check_kernel_support_acl
In reply to Anand JainSome test cases are failing because ACL is not compiled on the system. Instead, they should be marked as 'not_run'.
---
v2:
Work on David's comments regarding function names. Also use /proc/config.gz to verify ACL support.
tests/common | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
tests/common +18 -0
@@ -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" + 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" + fi + run_check_umount_test_dev +} + prepare_test_dev() { # num[K/M/G/T...]
Signature · 1 line
2.39.3
v2 cover btrfs-progs: tests: fix no acl support
v2:
Works on David's comments regarding function names. Also use /proc/config.gz to verify ACL support and merging individual test case fixes into a single patch.
Btrfs ACL support is a compiling time optional feature, instead of failing the test cases, let them say notrun. This set fixes it.
Patch 1/2 is preparatory adds helper to check for btrfs acl support. Patches 2/2 are actual fixes.
Thanks.
Anand Jain (2):
btrfs-progs: tests: add helper check_kernel_support_acl
btrfs-progs: tests: check for btrfs ACL support
tests/common | 18 ++++++++++++++++++ tests/convert-tests/001-ext2-basic/test.sh | 1 + tests/convert-tests/003-ext4-basic/test.sh | 1 + .../005-delete-all-rollback/test.sh | 1 + .../006-large-hole-extent/test.sh | 1 + .../057-btrfstune-free-space-tree/test.sh | 1 + 6 files changed, 23 insertions(+)
Signature · 1 line
2.39.3
PATCH v2 2/2 btrfs-progs: tests: check for btrfs ACL support
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 1Similar 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().
---
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(+)
tests/convert-tests/001-ext2-basic/test.sh +1 -0
@@ -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
tests/convert-tests/003-ext4-basic/test.sh +1 -0
@@ -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
tests/convert-tests/005-delete-all-rollback/test.sh +1 -0
@@ -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
tests/convert-tests/006-large-hole-extent/test.sh +1 -0
@@ -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"
tests/misc-tests/057-btrfstune-free-space-tree/test.sh +1 -0
@@ -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
Signature · 1 line
2.39.3
Quoted 9 lines · Anand Jain
v2:
Works on David's comments regarding function names. Also use/proc/config.gzto verify ACL support and merging individual test case fixes into a single patch.Btrfs ACL support is a compiling time optional feature, instead of failing the test cases, let them say notrun. This set fixes it.
Quoted 8 lines
Patch 1/2 is preparatory adds helper to check for btrfs acl support. Patches 2/2 are actual fixes.
Thanks.
Anand Jain (2):
btrfs-progs: tests: add helpercheck_kernel_support_acl
btrfs-progs: tests: check for btrfs ACL support
Added to devel, thanks. I'll queue the kernel part for 6.6.