Fix the HTX Shutdown syslib routine

Update the 'Shutdown HTX Exerciser' library utility, which
throws invalid List and parameter errors.
Replace obsolete Rprint and Rprintn statements used
throughout the library.
Add printout of number of error logs in hardbootme test
so can verify error logs are being checked as it runs.

Signed-off-by: Steven Sombar <ssombar@us.ibm.com>
Change-Id: I0c9de6cab7823d6238a5fb9b52ec2cc957ceabba
diff --git a/syslib/utils_os.robot b/syslib/utils_os.robot
index 0c99e91..125a3a9 100755
--- a/syslib/utils_os.robot
+++ b/syslib/utils_os.robot
@@ -2,6 +2,7 @@
 Documentation      Keywords for system test.
 
 Library            ../lib/gen_robot_keyword.py
+Library            ../lib/gen_print.py
 Library            ../lib/gen_robot_print.py
 Resource           ../lib/boot_utils.robot
 Resource           ../extended/obmc_boot_test_resource.robot
@@ -473,11 +474,11 @@
 Create Default MDT Profile
     [Documentation]  Create default mdt.bu profile and run.
 
-    Rprint Timen  Create HTX mdt profile.
+    Print Timen  Create HTX mdt profile.
 
     ${profile}  ${stderr}  ${rc}=  OS Execute Command
     ...  htxcmdline -createmdt
-    Rprintn  ${profile}
+    Printn  ${profile}
     Should Contain  ${profile}  mdts are created successfully
     ...  msg=Create MDT profile failed. response=${profile}
 
@@ -488,10 +489,10 @@
     # Description of argument(s):
     # HTX_MDT_PROFILE  MDT profile to be executed (e.g. "mdt.bu").
 
-    Rprint Timen  Start HTX mdt profile execution.
+    Print Timen  Start HTX mdt profile execution.
     ${htx_run}  ${stderr}  ${rc}=  OS Execute Command
     ...  htxcmdline -run -mdt ${HTX_MDT_PROFILE}
-    Rprintn  ${htx_run}
+    Printn  ${htx_run}
     Should Contain  ${htx_run}  Activated
     ...  msg=htxcmdline run mdt did not return "Activated" status.
 
@@ -504,14 +505,14 @@
     # sleep_time  The amount of time to sleep after checking status,
     #             for example "3s" or "2m".
 
-    Rprint Timen  Check HTX mdt Status and error.
+    Print Timen  Check HTX mdt Status and error.
     ${htx_status}  ${stderr}  ${rc}=  OS Execute Command
     ...  htxcmdline -status -mdt ${HTX_MDT_PROFILE}
-    Rprintn  ${htx_status}
+    Printn  ${htx_status}
 
     ${htx_errlog}  ${stderr}  ${rc}=  OS Execute Command
     ...  htxcmdline -geterrlog
-    Rprintn  ${htx_errlog}
+    Printn  ${htx_errlog}
 
     Should Contain  ${htx_errlog}  file </tmp/htxerr> is empty
     ...  msg=HTX geterrorlog was not empty.
@@ -524,17 +525,17 @@
 Shutdown HTX Exerciser
     [Documentation]  Shut down HTX exerciser run.
 
-    Rprint Timen  Shutdown HTX Run
+    Print Timen  Shutdown HTX Run
     ${shutdown}  ${stderr}  ${rc}=  OS Execute Command
     ...  htxcmdline -shutdown -mdt ${HTX_MDT_PROFILE}
-    Rprintn  ${shutdown}
 
-    ${match_count_no_mdt}=  Count Values In List  ${shutdown}
-    ...  No MDT is currently running
-    ${match_count_success}=  Count Values In List  ${shutdown}
-    ...  shutdown successfully
-    Run Keyword If  ${match_count_no_mdt} == 0 and ${match_count_success} == 0
-    ...  Fail  msg=Shutdown command returned unexpected message.
+    Printn  ${shutdown}
+
+    ${down1}=  Evaluate  'shutdown successfully' in $shutdown
+    Return From Keyword If  '${down1}' == 'True'
+    ${down2}=  Evaluate  'No MDT is currently running' in $shutdown
+    Return From Keyword If  '${down2}' == 'True'
+    Fail  msg=Shutdown returned unexpected message.
 
 
 Create JSON Inventory File
diff --git a/systest/htx_hardbootme_test.robot b/systest/htx_hardbootme_test.robot
index b87adeb..2ce02ce 100755
--- a/systest/htx_hardbootme_test.robot
+++ b/systest/htx_hardbootme_test.robot
@@ -210,8 +210,9 @@
 Check For ESELs
     [Documentation]  Terminate if there is an eSEL.
     ${error_logs}=  Get Error Logs
-    ${num_logs}=  Get Length  ${error_logs}
-    Run Keyword If  ${num_logs} != 0  Run Keywords
+    ${num_error_logs}=  Get Length  ${error_logs}
+    Rprint Vars  num_error_logs
+    Run Keyword If  ${num_error_logs} != 0  Run Keywords
     ...  Print Error Logs  ${error_logs}
     ...  AND  Fail  msg=Terminating run due to BMC error log(s).