Whamcloud - gitweb
LU-9980 tests: save specific facet in save_lustre_params() 47/29147/2
authorElena Gryaznova <elena.gryaznova@seagate.com>
Wed, 13 Sep 2017 05:58:07 +0000 (22:58 -0700)
committerJohn L. Hammond <john.hammond@intel.com>
Wed, 11 Oct 2017 19:52:03 +0000 (19:52 +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

Lustre-change: https://review.whamcloud.com/28963
Lustre-commit: 7921d0d8db942057eb10042291d6d90448e5c197

Change-Id: Icba3fc532f4c67f02272c39e8e64d49325dad0e7
Signed-off-by: Elena Gryaznova <elena.gryaznova@seagate.com>
Signed-off-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: James Nunez <james.a.nunez@intel.com>
Signed-off-by: Minh Diep <minh.diep@intel.com>
Reviewed-on: https://review.whamcloud.com/29147
Tested-by: Jenkins
Reviewed-by: Elena Gryaznova <c17455@cray.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
lustre/tests/test-framework.sh

index 4f809a7..725f725 100755 (executable)
@@ -6247,16 +6247,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
 }