Whamcloud - gitweb
LU-590 tests: obdfilter-survey.sh fails test 2a.
authorAndriy Skulysh <Andriy_Skulysh@xyratex.com>
Thu, 5 Jan 2012 13:04:14 +0000 (15:04 +0200)
committerOleg Drokin <green@whamcloud.com>
Mon, 16 Jan 2012 17:18:52 +0000 (12:18 -0500)
obdfilter-survey.sh fails to connect during test 2a.
Interruption to and restart of test leads to a panic.
This patch sets correct target for netdisk case, allows to
handle signals in test scripts, sets correct parameters for
obdfilter-survey cleanup.

Xyratex-bug-id: MRP-118
Change-Id: I057610ba51e9a9afb704b4467b8600fd61652a71
Signed-off-by: Andriy Skulysh <Andriy_Skulysh@xyratex.com>
Reviewed-by: Alexey Lyashkov <alexey_lyashkov@xyratex.com>
Reviewed-on: http://review.whamcloud.com/1288
Tested-by: Hudson
Reviewed-by: Yu Jian <yujian@whamcloud.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre-iokit/obdfilter-survey/libecho
lustre/tests/obdfilter-survey.sh
lustre/tests/test-framework.sh

index e12c853..23aa2b8 100644 (file)
@@ -245,7 +245,7 @@ cleanup () {
     fi
     exit $exit_status
 }
     fi
     exit $exit_status
 }
-trap cleanup SIGHUP SIGINT SIGTERM
+trap 'cleanup 0 $clean_srv_OSS $cleanup_oscs' SIGHUP SIGINT SIGTERM
 
 # gets echoclient device number and attach it to the client UUID
 # Results are  returned by an echo followed by an exit
 
 # gets echoclient device number and attach it to the client UUID
 # Results are  returned by an echo followed by an exit
index ea1af2e..42a6c0f 100644 (file)
@@ -5,7 +5,6 @@ set -e
 LUSTRE=${LUSTRE:-`dirname $0`/..}
 . $LUSTRE/tests/test-framework.sh
 init_test_env $@
 LUSTRE=${LUSTRE:-`dirname $0`/..}
 . $LUSTRE/tests/test-framework.sh
 init_test_env $@
-init_logging
 
 nobjhi=${nobjhi:-1}
 thrhi=${thrhi:-16}
 
 nobjhi=${nobjhi:-1}
 thrhi=${thrhi:-16}
@@ -13,6 +12,7 @@ size=${size:-1024}
 
 # the summary file a bit smaller than OSTSIZE
 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
 
 # the summary file a bit smaller than OSTSIZE
 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
+init_logging
 
 [ "$SLOW" = no ] && { nobjhi=1; thrhi=4; }
 thrlo=${thrlo:-$(( thrhi / 2))}
 
 [ "$SLOW" = no ] && { nobjhi=1; thrhi=4; }
 thrlo=${thrlo:-$(( thrhi / 2))}
@@ -33,6 +33,11 @@ if [ $(( size * 1024 )) -ge $minsize  ]; then
     echo min kbytesavail: $minsize using size=${size} MBytes per obd instance
 fi
 
     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
 get_targets () {
         local targets
         local devs
@@ -40,12 +45,12 @@ get_targets () {
         local oss
 
         for oss in $(osts_nodes); do
         local oss
 
         for oss in $(osts_nodes); do
-                devs=$(do_node $oss "lctl dl |grep obdfilter |sort" | awk '{print $4}')
+                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
                 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` ]] || target=$nid:$target
+                        [[ $oss = `hostname` && "$1" == "netdisk" ]] || target=$nid:$target
                         targets="$targets $target"
                 done
         done
                         targets="$targets $target"
                 done
         done
@@ -58,8 +63,8 @@ obdflter_survey_targets () {
        local targets
 
        case $case in
        local targets
 
        case $case in
-               disk)    targets=$(get_targets);;
-               netdisk) targets=$(get_targets);;
+               disk)    targets=$(get_targets $case);;
+               netdisk) targets=$(get_targets $case);;
                network) targets=$(host_nids_address $(comma_list $(osts_nodes)) $NETTYPE);;
                *) error "unknown obdflter-survey case!" ;;
        esac
                network) targets=$(host_nids_address $(comma_list $(osts_nodes)) $NETTYPE);;
                *) error "unknown obdflter-survey case!" ;;
        esac
index 0016a50..15fe46a 100644 (file)
@@ -3336,7 +3336,7 @@ run_one_logged() {
 
     echo
     log_sub_test_begin test_${1}
 
     echo
     log_sub_test_begin test_${1}
-    (run_one $1 "$2") 2>&1 | tee $test_log
+    (run_one $1 "$2") 2>&1 | tee -i $test_log
     local RC=${PIPESTATUS[0]}
 
     [ $RC -ne 0 ] && [ ! -f $LOGDIR/err ] && \
     local RC=${PIPESTATUS[0]}
 
     [ $RC -ne 0 ] && [ ! -f $LOGDIR/err ] && \