Whamcloud - gitweb
LU-6863 tests: change obdfilter-survey.sh for CLIENTONLY mode 31/15631/11
authorElena Gryaznova <c17455@cray.com>
Fri, 23 Feb 2018 18:17:35 +0000 (21:17 +0300)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 3 Mar 2018 04:28:58 +0000 (04:28 +0000)
obdfilter-survey.sh requires server access and can not be
used for CLIENTONLY mode:
get_devs $oss -> do_nodes $oss "lctl dl"
host_nids_address $oss -> do_nodes $oss "$LCTL list_nids"
Patch fixes the script to compose the targets list
without access to servers.

Test-Parameters: trivial testlist=obdfilter-survey
Signed-off-by: Elena Gryaznova <c17455@cray.com>
Cray-bug-id: MRP-1757
Reviewed-by: Alexey Lyashkov <c17817@cray.com>
Reviewed-by: Vitaly Fertman <c17818@cray.com>
Change-Id: I910afc940a29ea4f5d8928131652f9b6ef809ce7
Reviewed-on: https://review.whamcloud.com/15631
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre-iokit/obdfilter-survey/obdfilter-survey
lustre/tests/obdfilter-survey.sh

index 8b43ce5..d75ac47 100755 (executable)
@@ -14,7 +14,7 @@ set -e
 # one can specify only case=disk or case=network or case=netdisk through
 # command line.
 
-# Perquisite: For "disk" case and "netdisk" case you need to have lustre setup
+# Prerequisite: For "disk" case and "netdisk" case you need to have lustre setup
 #             with one or more ost's. For "network" case  you need to have all
 #             modules (those llmount.sh loades) loaded in kernel. And the
 #             'lctl dl' output must be blank.
index 94a5182..a2f3ccc 100644 (file)
@@ -33,28 +33,28 @@ if [ $(( size * 1024 )) -ge $minsize  ]; then
     echo min kbytesavail: $minsize using size=${size} MBytes per obd instance
 fi
 
-get_devs() {
-        echo $(do_nodes $1 'lctl dl | grep obdfilter' | \
-             awk '{print $4}' | sort -u)
-}
-
 get_targets () {
-        local targets
-        local devs
-        local nid
-        local oss
-
-        for oss in $(osts_nodes); do
-                devs=$(get_devs $oss)
-                nid=$(host_nids_address $oss $NETTYPE)
-                for d in $devs; do
-                        # if oss is local -- obdfilter-survey needs dev wo/ host
-                        target=$d
-                        [[ $oss = `hostname` && "$1" == "disk" ]] || target=$nid:$target
-                        targets="$targets $target"
-                done
-        done
-
+       local targets
+       local target
+       local dev
+       local nid
+       local osc
+
+       for osc in $($LCTL get_param -N osc.${FSNAME}-*osc-*); do
+               nid=$($LCTL get_param $osc.import |
+                       awk '/current_connection:/ {sub(/@.*/,""); print $2}')
+               dev=$(echo $osc | sed -e 's/^osc\.//' -e 's/-osc.*//')
+               target=$dev
+
+               # For local disk obdfilter-survey requires target devs w/o nid.
+               # obdfilter-survey :
+               # case 1 (local disk):
+               #    $ nobjhi=2 thrhi=2 size=1024
+               #         targets="lustre-OST0000 lustre-OST0001 ..."
+               #                 sh obdfilter-survey
+               local_node && [ "$1" == "disk" ] || target=$nid:$target
+               targets="$targets $target"
+       done
        echo $targets
 }
 
@@ -202,10 +202,16 @@ run_test 2b "Stripe F/S over the Network, async journal"
 
 # README.obdfilter-survey: In network test only automated run is supported.
 test_3a () {
+       # obdfilter-survey Prerequisite:
+       #    For "network" case  you need to have all
+       #    modules (those llmount.sh loads) loaded in kernel. And the
+       #    'lctl dl' output must be blank.
+       # Skipping test for CLIENTONLY mode because of
+       # cleanupall()->stopall() does not cleanup the servers on this mode.
+       [ "$CLIENTONLY" ] && skip "CLIENTONLY mode" && return
+
        remote_servers || { skip "Local servers" && return 0; }
 
-       # The Network survey test needs:
-       # Start lctl and check for the device list. The device list must be empty.
        cleanupall
 
        obdflter_survey_run network