Whamcloud - gitweb
LU-17778 tests: fix conf-sanity/76d issues 15/58215/2
authorAndreas Dilger <adilger@whamcloud.com>
Sat, 11 Jan 2025 00:16:00 +0000 (17:16 -0700)
committerOleg Drokin <green@whamcloud.com>
Thu, 6 Mar 2025 08:10:03 +0000 (08:10 +0000)
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 <adilger@whamcloud.com>
Change-Id: Ib6acdc80b880dfc90b0c10406a0f868211433f58
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/58215
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Emoly Liu <emoly@whamcloud.com>
Reviewed-by: Nushafreen Palsetia <npalsetia@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/conf-sanity.sh

index 158688d..e7ccc91 100755 (executable)
@@ -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"