From 37fa5a5c0cb154630f4e244c8b2919bd908470f1 Mon Sep 17 00:00:00 2001 From: Ellis Wilson Date: Fri, 8 Oct 2021 10:27:39 -0400 Subject: [PATCH] LU-17736 tests: Fix sanityn/73 for test machines with auditd getfattr performs one stat followed by two getxattr syscalls against the provided file. Normally, the stat results in no getxattr calls internally (as it's not something stat is required to return). However, if auditd is enabled AND one of the rules includes a filesystem-specific rule such as watch directory X and record if it's modified, then for every lookup (each of the three syscalls includes one) an additional getxattr will be performed, resulting in 5 total getxattrs. Because there is significant fuzz here, revise the check to be at minimum the two "expected" getxattrs but allow for more. Comments have been added explaining this. Signed-off-by: Ellis Wilson Test-Parameters: trivial testlist=sanityn env=ONLY=73,ONLY_REPEAT=10 Change-Id: I0da5c2a5331f7dba4e65051a073e2bec05327a25 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54809 Reviewed-by: Andreas Dilger Reviewed-by: Arshad Hussain Reviewed-by: Oleg Drokin Tested-by: jenkins Tested-by: Maloo --- lustre/tests/sanityn.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lustre/tests/sanityn.sh b/lustre/tests/sanityn.sh index 4c76231..896dce9 100755 --- a/lustre/tests/sanityn.sh +++ b/lustre/tests/sanityn.sh @@ -4028,12 +4028,15 @@ test_73() { clear_stats llite.*.stats # PR lock should be cached by now on both clients getfattr -n user.attr1 $DIR1/$tfile || error "getfattr3 failed" - # 2 hits for getfattr(0)+getfattr(size) - [ $(calc_stats llite.*.stats getxattr_hits) -eq 2 ] || + # At least 2 hits for getfattr(0)+getfattr(size) + # There may be more if auditd has a filesystem-related rule enabled + (( $(calc_stats llite.*.stats getxattr_hits) >= 2 )) || error "not cached in $DIR1" + clear_stats llite.*.stats getfattr -n user.attr1 $DIR2/$tfile || error "getfattr4 failed" - # 4 hits for more getfattr(0)+getfattr(size) - [ $(calc_stats llite.*.stats getxattr_hits) -eq 4 ] || + # At least 2 hits for getfattr(0)+getfattr(size) + # There may be more if auditd has a filesystem-related rule enabled + (( $(calc_stats llite.*.stats getxattr_hits) >= 2 )) || error "not cached in $DIR2" rm -f $DIR2/$tfile -- 1.8.3.1