From 174b9684c3f48c7f7f845b14d9452d0bf1ceaece Mon Sep 17 00:00:00 2001 From: Elena Gryaznova Date: Thu, 3 Sep 2020 16:00:09 +0300 Subject: [PATCH] LU-13944 tests: add ability to set clients parameters Patch adds the ability to set clients parameters via CLIENT_LCTL_SETPARAM_PARAM. Example: CLIENT_LCTL_SETPARAM_PARAM="lbug_on_eviction=1 debug=-1 " sets lbug_on_eviction=1 and debug=-1 on all clients. Test-Parameters: trivial HPE-bug-id: LUS-9052 Signed-off-by: Elena Gryaznova Reviewed-by: Vladimir Saveliev Reviewed-by: Andriy Skulysh Change-Id: Ifb06e7992c2f1db94f0a1503cfc31e00d4674804 Reviewed-on: https://review.whamcloud.com/39816 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/tests/test-framework.sh | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 9354b38..06a81f6 100755 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -1617,6 +1617,22 @@ set_default_debug_facet () { set_default_debug_nodes $node "$debug" "$subsys" $debug_size } +set_params_nodes () { + [[ $# -ge 2 ]] || return 0 + + local nodes=$1 + shift + do_nodes $nodes $LCTL set_param $@ +} + +set_params_clients () { + local clients=${1:-$CLIENTS} + local params=${2:-$CLIENT_LCTL_SETPARAM_PARAM} + + [[ -n $params ]] || return 0 + set_params_nodes $clients $params +} + set_hostid () { local hostid=${1:-$(hostid)} @@ -2329,6 +2345,7 @@ zconf_mount() { fi set_default_debug_nodes $client + set_params_clients $client return 0 } @@ -2555,6 +2572,7 @@ exit \\\$rc" || return ${PIPESTATUS[0]} do_nodes $clients "mount | grep $mnt' '" set_default_debug_nodes $clients + set_params_clients $clients return 0 } @@ -5448,17 +5466,18 @@ check_and_setup_lustre() { export I_MOUNTED2=yes fi - if $do_check; then - # FIXME: what to do if check_config failed? - # i.e. if: - # 1) remote client has mounted other Lustre fs? - # 2) lustre is mounted on remote_clients atall ? - check_config_clients $MOUNT - init_facets_vars - init_param_vars + if $do_check; then + # FIXME: what to do if check_config failed? + # i.e. if: + # 1) remote client has mounted other Lustre fs? + # 2) lustre is mounted on remote_clients atall ? + check_config_clients $MOUNT + init_facets_vars + init_param_vars - set_default_debug_nodes $(comma_list $(nodes_list)) - fi + set_default_debug_nodes $(comma_list $(nodes_list)) + set_params_clients + fi if [ -z "$CLIENTONLY" -a $(lower $OSD_TRACK_DECLARES_LBUG) == 'yes' ]; then local facets="" -- 1.8.3.1