Option for user to halt HTX on error

By default HTX_HALT is set to 0. If user set 1 or pass via "-v"
params from robot, on error HTX exerciser will not be sutdown.

Resolves openbmc/openbmc-test-automation#579

Change-Id: I29d04c14ffb5d14cda173e0c669313664ba7dad8
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/systest/htx_hardbootme_test.robot b/systest/htx_hardbootme_test.robot
index 6896815..2164b42 100644
--- a/systest/htx_hardbootme_test.robot
+++ b/systest/htx_hardbootme_test.robot
@@ -12,11 +12,14 @@
 ${stack_mode}        skip
 
 # Default duration and interval of HTX exerciser to run.
-${HTX_DURATION}     2 hours
-${HTX_INTERVAL}     15 min
+${HTX_DURATION}      2 hours
+${HTX_INTERVAL}      15 min
 
 # Default hardbootme loop times HTX exerciser to run.
-${HTX_LOOP}         4
+${HTX_LOOP}          4
+
+# User defined halt on error.
+${HTX_KEEP_RUNNING}  ${0}
 
 *** Test Cases ***
 
@@ -112,7 +115,8 @@
     # 2. Capture FFDC on test failure.
     # 3. Close all open SSH connections.
 
-    Run Keyword If  '${TEST_STATUS}' == 'FAIL'
+    # Keep HTX running if user set HTX_KEEP_RUNNING to 1.
+    Run Keyword If  '${TEST_STATUS}' == 'FAIL' and ${HTX_KEEP_RUNNING} == ${0}
     ...  Shutdown HTX Exerciser
 
     FFDC On Test Case Fail