dtest_suite: add option to pause the test.
authorAmir Hanania <amir.hanania@intel.com>
Tue, 13 Dec 2016 22:25:13 +0000 (14:25 -0800)
committerArlin Davis <arlin.r.davis@intel.com>
Tue, 13 Dec 2016 22:25:13 +0000 (14:25 -0800)
Signed-off-by: Amir Hanania <amir.hanania@intel.com>
Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
test/scripts/dtest_suite.sh

index ab8ebdc..aeab730 100755 (executable)
@@ -105,6 +105,7 @@ user_b_options="none"
 dog_file=/tmp/dog.log
 dog_ser=/tmp/dog.ser
 dog_cli=/tmp/dog.cli
+pausing=1
 i=1
 while [ $i -lt 5000000 ]; do
   b_options_for_perf_test+=" $i"
@@ -129,6 +130,7 @@ control_c()
                 exit 1
         fi
         let "ctrl_c+=1"
+        pausing=0
         echo -en "\n*** Will break after this test case ***\n\n"
 }
 
@@ -362,6 +364,9 @@ function testcase(){
 
   read  -t 0.01 -n 1 -s u_input
   ret=$?
+  if [ $ret -eq 0 ] && [ "$u_input" == "p" ]; then
+    pause_test
+  fi
   if [ $ret -eq 0 ] && [ "$u_input" == "i" ]; then
     print_round_info
   fi
@@ -410,6 +415,19 @@ function wait_for_it(){
   echo " done in $test_run_time sec"
 }
 
+function pause_test(){
+  echo -ne "Pausing - Press p to continue - "
+  while [ $pausing -eq 1 ]; do
+    echo -ne "P" 
+    read  -t 0.01 -n 1 -s u_input
+    ret=$?
+    if [ $ret -eq 0 ] && [ "$u_input" == "p" ]; then
+      echo
+      break
+    fi
+    sleep 5
+  done
+}
 
 function print_round_info(){
   now=`date +%s`