Shutdown HTX exerciser if running.

As part of the test setup, check if HTX is running. If found running
shutdown the exerciser.

Resolves  openbmc/openbmc-test-automation#611

Change-Id: Ic617ab644720231d6b0d40300039d8a09a899dfd
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/syslib/utils_os.robot b/syslib/utils_os.robot
index ba4dc40..71b57fe 100755
--- a/syslib/utils_os.robot
+++ b/syslib/utils_os.robot
@@ -64,3 +64,9 @@
     ${out}=  Execute Command On OS  ls ${file_path}
     Log To Console  \n File Exist: ${out}
 
+
+Is HTX Running
+    [Documentation]  Check if the HTX exerciser is currently running.
+
+    ${status}=  Execute Command On OS  htxcmdline -status
+    Should Not Contain  ${status}  Daemon state is <IDLE>
diff --git a/systest/htx_hardbootme_test.robot b/systest/htx_hardbootme_test.robot
index 2164b42..bc2363e 100644
--- a/systest/htx_hardbootme_test.robot
+++ b/systest/htx_hardbootme_test.robot
@@ -108,6 +108,11 @@
     Boot To OS
     HTX Tool Exist
 
+    # Shutdown if HTX is running.
+    ${status}=  Run Keyword And Return Status  Is HTX Running
+    Run Keyword If  '${status}' == 'True'
+    ...  Shutdown HTX Exerciser
+
 
 Post Test Case Execution
     [Documentation]  Do the post test teardown.