Whamcloud - gitweb
LU-9980 tests: save specific facet in save_lustre_params() 63/28963/2
authorElena Gryaznova <elena.gryaznova@seagate.com>
Wed, 13 Sep 2017 05:58:07 +0000 (22:58 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 18 Sep 2017 05:25:16 +0000 (05:25 +0000)
In save_lustre_params(), while there are multiple server facets
having the same host, and the parameter has wildcard, duplicate
parameters with wrong facets will be saved.

This patch fixes the above issue by greping service name to save
the parameter with specific facet.

Test-Parameters: clientcount=4 osscount=2 mdscount=2 mdtcount=1 \
austeroptions=-R failover=true iscsi=1 testlist=replay-vbr

Change-Id: Icba3fc532f4c67f02272c39e8e64d49325dad0e7
Signed-off-by: Elena Gryaznova <elena.gryaznova@seagate.com>
Signed-off-by: Jian Yu <jian.yu@intel.com>
Reviewed-on: https://review.whamcloud.com/28963
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Nunez <james.a.nunez@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/test-framework.sh

index f302656..c020375 100755 (executable)
@@ -6245,16 +6245,17 @@ calc_osc_kbytes () {
 save_lustre_params() {
        local facets=$1
        local facet
-       local nodes
-       local node
+       local facet_svc
 
        for facet in ${facets//,/ }; do
-               node=$(facet_active_host $facet)
-               [[ *\ $node\ * = " $nodes " ]] && continue
-               nodes="$nodes $node"
-
-               do_node $node "$LCTL get_param $2 |
-                       while read s; do echo $facet \\\$s; done"
+               facet_svc=$(facet_svc $facet)
+               do_facet $facet \
+                       "params=\\\$($LCTL get_param $2);
+                        [[ -z \\\"$facet_svc\\\" ]] && param= ||
+                        param=\\\$(grep $facet_svc <<< \\\"\\\$params\\\");
+                        [[ -z \\\$param ]] && param=\\\"\\\$params\\\";
+                        while read s; do echo $facet \\\$s;
+                        done <<< \\\"\\\$param\\\""
        done
 }