From 0ef22b3c44599f9e1586ec00c3c5e7637c4235df Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Tue, 20 Jan 2026 12:31:15 -0800 Subject: [PATCH] Add basic ACL consistency test case. This test case is used to detect and reproduce a customer issue we're seeing where the new .get_acl() method API and underlying changes in el9_6+ are causing ACL cache fetching to return inconsistent results, which shows as missing ACLs on directories. This particular sequence is consistent enough that it warrants making it into a specific test. Signed-off-by: Auke Kok --- tests/golden/basic-acl-consistency | 6 ++ tests/sequence | 1 + tests/tests/basic-acl-consistency.sh | 117 +++++++++++++++++++++++++++ 3 files changed, 124 insertions(+) create mode 100644 tests/golden/basic-acl-consistency create mode 100644 tests/tests/basic-acl-consistency.sh diff --git a/tests/golden/basic-acl-consistency b/tests/golden/basic-acl-consistency new file mode 100644 index 00000000..c890c104 --- /dev/null +++ b/tests/golden/basic-acl-consistency @@ -0,0 +1,6 @@ +== make scratch fs +== create uid/gids +== set acls and permissions +== compare output +== drop caches and compare again +== cleanup scratch fs diff --git a/tests/sequence b/tests/sequence index 18eff7cf..8091b1b1 100644 --- a/tests/sequence +++ b/tests/sequence @@ -2,6 +2,7 @@ export-get-name-parent.sh basic-block-counts.sh basic-bad-mounts.sh basic-posix-acl.sh +basic-acl-consistency.sh inode-items-updated.sh simple-inode-index.sh simple-staging.sh diff --git a/tests/tests/basic-acl-consistency.sh b/tests/tests/basic-acl-consistency.sh new file mode 100644 index 00000000..b8355caa --- /dev/null +++ b/tests/tests/basic-acl-consistency.sh @@ -0,0 +1,117 @@ + +# +# Test basic clustered posix acl consistency. +# + +t_require_commands getfacl setfacl + +GETFACL="getfacl --absolute-names" + +filter_scratch() { + sed "s@$T_MSCR@t_mscr@g" +} + +acl_compare() +{ + diff -u - <($GETFACL $T_MSCR/data/dir_a/dir_b | filter_scratch) < /dev/null 2>&1 +useradd -g 7101 -u 7101 t_usr_1 > /dev/null 2>&1 +groupadd -g 7102 t_grp_2 > /dev/null 2>&1 +groupadd -g 7103 t_grp_3 > /dev/null 2>&1 +useradd -g 7103 -u 7103 t_usr_3 > /dev/null 2>&1 + +echo "== set acls and permissions" +mkdir -p $T_MSCR/data/dir_a/dir_b +chown t_usr_3:t_grp_3 $T_MSCR/data/dir_a/dir_b +chmod 2770 $T_MSCR/data/dir_a/dir_b +setfacl -m g:t_grp_2:rx $T_MSCR/data/dir_a/dir_b +setfacl -m d:g:t_grp_2:rx $T_MSCR/data/dir_a/dir_b +setfacl -m d:g:t_grp_3:rwx $T_MSCR/data/dir_a/dir_b + +mkdir -p $T_MSCR/data/dir_a/dir_b/dir_c +chown t_usr_3:t_grp_2 $T_MSCR/data/dir_a/dir_b/dir_c +setfacl -x g:t_grp_3 $T_MSCR/data/dir_a/dir_b/dir_c + +mkdir -p $T_MSCR/data/dir_a/dir_b/dir_c/dir_d +chown t_usr_1:t_grp_1 $T_MSCR/data/dir_a/dir_b/dir_c/dir_d +setfacl -x g:t_grp_3 $T_MSCR/data/dir_a/dir_b/dir_c/dir_d + +echo "== compare output" +acl_compare + +echo "== drop caches and compare again" +sync +echo 3 > /proc/sys/vm/drop_caches +acl_compare + +echo "== cleanup scratch fs" +t_scratch_umount + +t_pass