OS test lib utils

Added:
    - HTX tool existence check
    - Booting to OS ( similar variant in utils but specific for syslib )
    - OS related variable to tox run

Resolves openbmc/openbmc-test-automation#558

Change-Id: I2d8bc25de5630dfbeefef88fdf44d3752ea3c29f
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/syslib/utils_os.robot b/syslib/utils_os.robot
index 9bbb37a..6dae469 100755
--- a/syslib/utils_os.robot
+++ b/syslib/utils_os.robot
@@ -3,7 +3,10 @@
 ...                utils.robot. This resource file keywords  is specifically
 ...                define for system test use cases.
 
+Library            ../lib/gen_robot_keyword.py
+Resource           ../extended/obmc_boot_test_resource.robot
 Resource           ../lib/utils.robot
+Resource           ../lib/state_manager.robot
 
 *** Variables ***
 
@@ -12,6 +15,8 @@
 Execute Command On OS
     [Documentation]  Execute given command on OS and return output.
     [Arguments]  ${command}
+    # Description of argument(s):
+    # command  Shell command to be executed on OS.
     ${stdout}  ${stderr}=  Execute Command  ${command}  return_stderr=True
     Should Be Empty  ${stderr}
     [Return]  ${stdout}
@@ -21,12 +26,30 @@
     [Documentation]  Login to OS Host.
     [Arguments]  ${os_host}=${OS_HOST}  ${os_username}=${OS_USERNAME}
     ...          ${os_password}=${OS_PASSWORD}
-    # Desription of arguments:
-    # ${os_host} IP address of the OS Host.
-    # ${os_username}  OS Host Login user name.
-    # ${os_password}  OS Host Login passwrd.
+    # Description of argument(s):
+    # os_host      IP address of the OS Host.
+    # os_username  OS Host Login user name.
+    # os_password  OS Host Login passwrd.
 
+    Ping Host  ${os_host}
     Open Connection  ${os_host}
-    ${resp}=  Login  ${os_username}  ${os_password}
-    [Return]  ${resp}
+    Login  ${os_username}  ${os_password}
+
+
+HTX Tool Exist
+    [Documentation]  Check whether HTX exerciser is installed on OS.
+    Login To OS
+    ${output}=  Execute Command On OS  which htxcmdline
+    Should Contain  ${output}  htxcmdline
+    ...  msg=Please install HTX exerciser.
+
+
+Boot To OS
+    [Documentation]  Boot host OS.
+    Run Key  OBMC Boot Test \ REST Power On
+
+
+Power Off Host
+    [Documentation]  Power off host.
+    Run Key  OBMC Boot Test \ REST Power Off
 
diff --git a/tools/generate_argumentfile.sh b/tools/generate_argumentfile.sh
index 0d70f0d..f662990 100755
--- a/tools/generate_argumentfile.sh
+++ b/tools/generate_argumentfile.sh
@@ -18,3 +18,6 @@
 echo "--variable IPMI_COMMAND:$IPMI_COMMAND" >> $ARG_FILE
 echo "--variable ITERATION:$ITERATION" >> $ARG_FILE
 echo "--variable LOOP_TEST_COMMAND:$LOOP_TEST_COMMAND" >> $ARG_FILE
+echo "--variable OS_HOST:$OS_HOST" >> $ARG_FILE
+echo "--variable OS_USERNAME:$OS_USERNAME" >> $ARG_FILE
+echo "--variable OS_PASSWORD:$OS_PASSWORD" >> $ARG_FILE