From 129ac1bbd779249f681270616737d1dda993c83b Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Fri, 10 Jan 2025 17:16:00 -0700 Subject: [PATCH] LU-17778 tests: fix conf-sanity/76d issues There was a race between remounting a client and the MGS parameter settings being applied, so ensure the parameter setting is rechecked if it is not correct the first time. Also, the parameter checking for $MOUNT2 was not necessarily checking the right instance of the parameter on the client. Use the instance name for the mountpoint to ensure this is checked correctly. Test-Parameters: trivial Fixes: fa1bff8f6f ("LU-9399 llite: register mountpoint before process llog") Signed-off-by: Andreas Dilger Change-Id: Ib6acdc80b880dfc90b0c10406a0f868211433f58 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/58215 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Emoly Liu Reviewed-by: Nushafreen Palsetia Reviewed-by: Oleg Drokin --- lustre/tests/conf-sanity.sh | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index 158688d..e7ccc91 100755 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -7011,27 +7011,33 @@ run_test 76c "verify changelog_mask is applied with lctl set_param -P" test_76d() { #LU-9399 setupall - local xattr_cache="llite.*.xattr_cache" - local cmd="$LCTL get_param -n $xattr_cache | head -1" + local xattr_cache='llite.$inst.xattr_cache' + local inst=($(lfs getname $MOUNT)) + local cmd="$LCTL get_param -n $xattr_cache" local new=$((($(eval $cmd) + 1) % 2)) echo "lctl set_param -P llite.*.xattr_cache=$new" - do_facet mgs $LCTL set_param -P $xattr_cache=$new || + do_facet mgs $LCTL set_param -P llite.*.xattr_cache=$new || error "Can't change xattr_cache" - wait_update $HOSTNAME "$cmd" "$new" + stack_trap "do_facet mgs $LCTL set_param -P -d llite.*.xattr_cache || true" + wait_update $HOSTNAME "$cmd" "$new" || + error "$xattr_cache != $new on original client $MOUNT" echo "Check $xattr_cache on client $MOUNT" umount_client $MOUNT || error "umount $MOUNT failed" mount_client $MOUNT || error "mount $MOUNT failed" - [ $(eval $cmd) -eq $new ] || - error "$xattr_cache != $new on client $MOUNT" + inst=($(lfs getname $MOUNT)) + wait_update $HOSTNAME "$cmd" "$new" || + error "$xattr_cache != $new on remount client $MOUNT" echo "Check $xattr_cache on the new client $MOUNT2" mount_client $MOUNT2 || error "mount $MOUNT2 failed" - [ $(eval $cmd) -eq $new ] || - error "$xattr_cache != $new on client $MOUNT2" + inst=($(lfs getname $MOUNT2)) + wait_update $HOSTNAME "$cmd" "$new" || + error "$xattr_cache != $new on second client $MOUNT2" umount_client $MOUNT2 || error "umount $MOUNT2 failed" + do_facet mgs $LCTL set_param -P -d llite.*.xattr_cache stopall } run_test 76d "verify llite.*.xattr_cache can be set by 'lctl set_param -P' correctly" -- 1.8.3.1