Whamcloud - gitweb
LU-4458 test: take fail_val into account for pause_bulk() 05/13205/2
authorMikhail Pershin <mike.pershin@intel.com>
Tue, 30 Dec 2014 08:05:17 +0000 (11:05 +0300)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 16 Jan 2015 03:30:03 +0000 (03:30 +0000)
pause_bulk(), set_nodes_failloc() and reset_fail_loc() should
care about fail_val as well for compatibility with master

Signed-off-by: Mikhail Pershin <mike.pershin@intel.com>
Change-Id: I283a23c67a633a5db479e421c96c164e1e07d05c
Reviewed-on: http://review.whamcloud.com/13205
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Li Wei <wei.g.li@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/test-framework.sh

index 92eec63..22ff37c 100644 (file)
@@ -4255,12 +4255,15 @@ drop_update_reply() {
 
 pause_bulk() {
 #define OBD_FAIL_OST_BRW_PAUSE_BULK      0x214
-    RC=0
-    do_facet ost1 lctl set_param fail_loc=0x214
-    do_facet client "$1" || RC=$?
-    do_facet client "sync"
-    do_facet ost1 lctl set_param fail_loc=0
-    return $RC
+       RC=0
+
+       local timeout=${2:-0}
+       # default is (obd_timeout / 4) if unspecified
+       do_facet ost1 lctl set_param fail_val=$timeout fail_loc=0x80000214
+       do_facet client "$1" || RC=$?
+       do_facet client "sync"
+       do_facet ost1 lctl set_param fail_loc=0
+       return $RC
 }
 
 drop_ldlm_cancel() {
@@ -4317,7 +4320,7 @@ clear_failloc() {
 }
 
 set_nodes_failloc () {
-    do_nodes $(comma_list $1)  lctl set_param fail_loc=$2
+       do_nodes $(comma_list $1)  lctl set_param fail_val=0 fail_loc=$2
 }
 
 cancel_lru_locks() {
@@ -4654,9 +4657,10 @@ check_mds() {
 }
 
 reset_fail_loc () {
-    echo -n "Resetting fail_loc on all nodes..."
-    do_nodes $(comma_list $(nodes_list)) "lctl set_param -n fail_loc=0 2>/dev/null || true"
-    echo done.
+       echo -n "Resetting fail_loc on all nodes..."
+       do_nodes $(comma_list $(nodes_list)) "lctl set_param -n fail_loc=0 \
+               fail_val=0 2>/dev/null || true"
+       echo done.
 }