Added new test cast for os install and bootme

Added error checking to "Install HTX On Redhat"

Change-Id: Ieeafb5a04ad466cfabeaf72d58274432112116db
Signed-off-by: Joy Onyerikwu <onyekachukwu.joy.onyerikwu@ibm.com>
diff --git a/syslib/utils_install.robot b/syslib/utils_install.robot
index 4f1d37e..cb71dd3 100755
--- a/syslib/utils_install.robot
+++ b/syslib/utils_install.robot
@@ -78,9 +78,11 @@
     #            (e.g. http://server.com/projects/htx_package.rpm )
 
 
-    OS Execute Command  wget ${htx_rpm}  ignore_err=1
+    ${stdout}  ${stderr}  ${rc}  OS Execute Command
+    ...  wget ${htx_rpm}  ignore_err=1
+    Should Not Contain  ${stderr}  ERROR
     @{str}=  Split String From Right  ${htx_rpm}  /  1
-    SSHLibrary.File Should Exist  ${str[1]}
+
     # Remove the old version.
     OS Execute Command  rpm -e `rpm -qa | grep htx`  ignore_err=1
     OS Execute Command  rpm -Uvh ${str[1]}
diff --git a/syslib/utils_os.robot b/syslib/utils_os.robot
index 942d26e..ac61680 100755
--- a/syslib/utils_os.robot
+++ b/syslib/utils_os.robot
@@ -426,6 +426,10 @@
 
 Check HTX Run Status
     [Documentation]  Get HTX exerciser status and check for error.
+    [Arguments]  ${sleep_time}=${EMPTY}
+
+    # Description of argument(s):
+    # sleep_time  The amount of time to sleep after checking status.
 
     Rprint Timen  Check HTX mdt Status and error.
     ${htx_status}=  Execute Command On OS
@@ -438,6 +442,10 @@
     Should Contain  ${htx_errlog}  file </tmp/htxerr> is empty
     ...  msg=HTX geterrorlog was not empty.
 
+    Return From Keyword If  ${sleep_time} == ${EMPTY}
+
+    Run Key U  Sleep \ ${sleep-time}
+
 
 Shutdown HTX Exerciser
     [Documentation]  Shut down HTX exerciser run.
diff --git a/systest/os_install_boot_stress.robot b/systest/os_install_boot_stress.robot
new file mode 100644
index 0000000..cee9510
--- /dev/null
+++ b/systest/os_install_boot_stress.robot
@@ -0,0 +1,78 @@
+*** Settings ***
+
+Documentation  Install RHEL OS and run an HTX bootme.
+
+# TEST PARAMETERS:
+#   OPENBMC_HOST                The BMC host name or IP address.
+#   OPENBMC_USERNAME            The BMC user name.
+#   OPENBMC_PASSWORD            The BMC password.
+#   OS_HOST                     The OS host name or IP address.
+#   OS_USERNAME                 The OS Host user name.
+#   OS_PASSWORD                 The OS Host password.
+#   FTP_USERNAME                The FTP username.
+#   FTP_PASSWORD                The FTP password.
+#   OS_REPO_URL                 The URL for the OS to be installed.
+#                               (e.g "ftp.com/redhat/RHEL/Server/os/").
+#   Optional Paramters:
+#     HTX_DURATION              The duration of the HTX run (e.g 2h,3m)
+#                               Defaults to 2h.
+#     HTX_INTERVAL              The time delay between checks of HTX
+#                               status, defaults to 10m.
+#     HTX_LOOPS                 The number of times to loop through
+#                               htx, defualts to 2.
+#     DEBUG                     If this is set, extra debug information
+#                               will be printed out, defaults to 1.
+
+Resource             ../syslib/utils_install.robot
+
+Suite Teardown  Collect HTX Log Files
+
+*** Variables ***
+${HTX_DURATION}      2h
+${HTX_INTERVAL}      10m
+${HTX_LOOPS}         2
+${DEBUG}             1
+
+
+*** Test Cases ***
+OS Install
+    [Documentation]  Install the given OS through the network.
+    [Tags]  OS_Install
+
+    ${cmd}=  Catenate  sol_utils.tcl --os_host=${OS_HOST}
+    ...  --os_password=${OS_PASSWORD} --os_username=${OS_USERNAME}
+    ...  --openbmc_host=${OPENBMC_HOST}
+    ...  --openbmc_password=${OPENBMC_PASSWORD}
+    ...  --openbmc_username=${OPENBMC_USERNAME}
+    ...  --proc_name=install_os  --debug=${DEBUG}
+    ...  --ftp_username=${FTP_USERNAME}  --ftp_password=${FTP_PASSWORD}
+    ...  --os_repo_url=${os_repo_url}
+    ${rc}  ${out_buf}=  Cmd Fnc  ${cmd}
+
+
+ Configure Yum Repository For FTP3
+    [Documentation]  Configure Yum repository for ftp3 server on pegas.
+    ...  This is needed for HTX to be installed.
+    [Tags]  Configure_Yum_Repository_For_FTP3
+
+    ${cmd}=  Catenate
+     ...  printf "[pegas-ga-ftp3-server]\nname=pegas-ga-ftp3-server
+     ...  \nbaseurl=ftp://${FTP_USERNAME}:${FTP_PASSWORD}@${OS_REPO_URL}
+     ...  \nenabled=1\ngpgcheck=0"  > /etc/yum.repos.d/pegas_ga.repo
+    ${stdout}  ${stderr}  ${rc}=  OS Execute Command  ${cmd}
+    ${stdout}  ${stderr}  ${rc}=  OS Execute Command  yum update
+    Should Be Empty  ${stderr}
+    ...  msg=Yum update returned an error. Verify ftp credentials.
+
+
+Install HTX And Run Bootme
+    [Documentation]  Install HTX and start extended bootme run.
+    [Tags]  Install_HTX_And_Run_Bootme
+
+    Install HTX On RedHat  ${htx_rpm}
+    Login To OS
+    Repeat Keyword  ${HTX_LOOPS} times  Run Keywords
+    ...  Run MDT Profile
+    ...  AND  Repeat Keyword  ${HTX_DURATION}
+    ...  Check HTX Run Status  ${HTX_INTERVAL}
+    ...  AND  Shutdown HTX Exerciser
\ No newline at end of file