From: Amir Hanania Date: Tue, 13 Dec 2016 22:25:13 +0000 (-0800) Subject: dtest_suite: add option to pause the test. X-Git-Tag: dapl-2.1.10-1~1 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=4e827c065ec699e8ee9872df43c06e3aca0f5095;p=~ardavis%2Fdapl.git dtest_suite: add option to pause the test. Signed-off-by: Amir Hanania Signed-off-by: Arlin Davis --- diff --git a/test/scripts/dtest_suite.sh b/test/scripts/dtest_suite.sh index ab8ebdc..aeab730 100755 --- a/test/scripts/dtest_suite.sh +++ b/test/scripts/dtest_suite.sh @@ -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`