Whamcloud - gitweb
LU-8305 tests: fix fileset setup in sanity-sec 36/23936/2
authorSebastien Buisson <sbuisson@ddn.com>
Thu, 24 Nov 2016 10:34:07 +0000 (11:34 +0100)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 17 Dec 2016 05:48:43 +0000 (05:48 +0000)
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 <sbuisson@ddn.com>
Change-Id: I811ca29f5f58385dd5f76a069556865850065e3e
Reviewed-on: https://review.whamcloud.com/23936
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Kit Westneat <kit.westneat@gmail.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/sanity-sec.sh

index f229d19..a8c814d 100755 (executable)
@@ -867,6 +867,7 @@ run_test 15 "test id mapping"
 wait_nm_sync() {
        local nodemap_name=$1
        local key=$2
 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"
 
        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
 
        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
 
        # 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
                                    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)
 
                    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
        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"
        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 ||
 
        # re-mount client
        zconf_umount_clients ${clients_arr[0]} $MOUNT ||