From: Sebastien Buisson Date: Thu, 24 Nov 2016 10:34:07 +0000 (+0100) Subject: LU-8305 tests: fix fileset setup in sanity-sec X-Git-Tag: 2.9.51~24 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=947d81daa1ba218bb027b17061c1c24ccaf85c22 LU-8305 tests: fix fileset setup in sanity-sec In test_27 of sanity-sec, only set fileset on nodemap with 'set_param -P' command. This command will install the fileset info into all servers including MGS. But we need to wait into wait_nm_sync() for it to be set. Test-Parameters: trivial testlist=sanity-sec,sanity-sec,sanity-sec,sanity-sec,sanity-sec,sanity-sec,sanity-sec,sanity-sec,sanity-sec,sanity-sec Test-Parameters: trivial testlist=sanity-sec,sanity-sec,sanity-sec,sanity-sec,sanity-sec,sanity-sec,sanity-sec,sanity-sec,sanity-sec,sanity-sec Test-Parameters: trivial testlist=sanity-sec,sanity-sec,sanity-sec,sanity-sec,sanity-sec,sanity-sec,sanity-sec,sanity-sec,sanity-sec,sanity-sec Signed-off-by: Sebastien Buisson Change-Id: I811ca29f5f58385dd5f76a069556865850065e3e Reviewed-on: https://review.whamcloud.com/23936 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Kit Westneat Reviewed-by: Jian Yu Reviewed-by: Oleg Drokin --- diff --git a/lustre/tests/sanity-sec.sh b/lustre/tests/sanity-sec.sh index f229d19..a8c814d 100755 --- a/lustre/tests/sanity-sec.sh +++ b/lustre/tests/sanity-sec.sh @@ -867,6 +867,7 @@ run_test 15 "test id mapping" wait_nm_sync() { local nodemap_name=$1 local key=$2 + local value=$3 local proc_param="${nodemap_name}.${key}" [ "$nodemap_name" == "active" ] && proc_param="active" @@ -880,8 +881,12 @@ wait_nm_sync() { local mgs_ip=$(host_nids_address $mgs_HOST $NETTYPE | cut -d' ' -f1) local i - out1=$(do_facet mgs $LCTL get_param nodemap.${proc_param}) - echo "On MGS ${mgs_ip}, ${proc_param} = $out1" + if [ -z "$value" ]; then + out1=$(do_facet mgs $LCTL get_param nodemap.${proc_param}) + echo "On MGS ${mgs_ip}, ${proc_param} = $out1" + else + out1=$value; + fi # wait up to 10 seconds for other servers to sync with mgs for i in $(seq 1 10); do @@ -890,7 +895,9 @@ wait_nm_sync() { cut -d' ' -f1) is_sync=true - [ $node_ip == $mgs_ip ] && continue + if [ -z "$value" ]; then + [ $node_ip == $mgs_ip ] && continue + fi out2=$(do_node $node_ip $LCTL get_param \ nodemap.$proc_param 2>/dev/null) @@ -1664,11 +1671,9 @@ test_27() { fileset_test_setup # add fileset info to nodemap - do_facet mgs $LCTL set_param nodemap.c0.fileset=/$subdir || - error "unable to set fileset info on nodemap c0" do_facet mgs $LCTL set_param -P nodemap.c0.fileset=/$subdir || error "unable to add fileset info to nodemap c0" - wait_nm_sync c0 fileset + wait_nm_sync c0 fileset "nodemap.c0.fileset=/$subdir" # re-mount client zconf_umount_clients ${clients_arr[0]} $MOUNT ||