Fix for deprecated robot builtin keywords

Changes:
 - Run KeyWord If is deprecated since Robot
   Framework version 5.*, use 'IF' instead

Tested:
 - Checked using robot dry-run to make sure the
   syntax is not broken

Change-Id: I281e5b9a7ccdc7ad72f75ad324d1c6a09b4f01dd
Signed-off-by: Sridevi Ramesh <sridevra@in.ibm.com>
diff --git a/systest/gpu_stress_test.robot b/systest/gpu_stress_test.robot
index 697afcd..2b03864 100755
--- a/systest/gpu_stress_test.robot
+++ b/systest/gpu_stress_test.robot
@@ -47,8 +47,7 @@
     # The BMC and OS should report the same number of GPUs.
     ${failmsg01}=  Catenate  OS reports ${num_os_gpus} GPUs, but BMC
     ...  reports ${num_bmc_gpus} present and functional GPUs.
-    Run Keyword If  '${num_os_gpus}' != '${num_bmc_gpus}'
-    ...  Fail  msg=${failmsg01}
+    IF  '${num_os_gpus}' != '${num_bmc_gpus}'  Fail  msg=${failmsg01}
 
     # Show parameters for HTX stress test.
     Printn
@@ -60,8 +59,7 @@
 
     # Shutdown HTX if it is already running.
     ${status}=  Is HTX Running
-    Run Keyword If  '${status}' == 'True'
-    ...  Shutdown HTX Exerciser
+    IF  '${status}' == 'True'  Shutdown HTX Exerciser
 
     Repeat Keyword  ${HTX_LOOP} times  Execute GPU Test
 
@@ -113,23 +111,24 @@
     Rpvars  power  power_max  temperature  temperature_via_rest
     ...  temperature_max  clock  clock_max
 
-    Run Keyword If  ${power} > ${power_max}  Fail
-    ...  msg=GPU Power ${power} exceeds limit of ${power_max}.
+    IF  ${power} > ${power_max}
+        Fail  msg=GPU Power ${power} exceeds limit of ${power_max}.
+    END
 
     ${err_msg}=  Catenate  GPU temperature of ${temperature} exceeds limit
     ...  of ${temperature_max}.
-    Run Keyword If  ${temperature} > ${temperature_max}  Fail  msg=${err_msg}
+    IF  ${temperature} > ${temperature_max}  Fail  msg=${err_msg}
 
-    Run Keyword If  ${clock} > ${clock_max}  Fail
-    ...  msg=GPU clock of ${clock} exceeds limit of ${clock_max}.
+    IF  ${clock} > ${clock_max}  Fail  msg=GPU clock of ${clock} exceeds limit of ${clock_max}.
 
     ${err_msg}=  Catenate  The GPU temperature reported by REST is not within
     ...  5 degrees of the nvidia_smi reported temperature.
     ${upper_limit}=  Evaluate  ${temperature_via_rest}+5
     ${lower_limit}=  Evaluate  ${temperature_via_rest}-5
-    Run Keyword If
-    ...  ${temperature} > ${upper_limit} or ${temperature} < ${lower_limit}
-    ...  Fail  msg=${err_msg}
+
+    IF  ${temperature} > ${upper_limit} or ${temperature} < ${lower_limit}
+        Fail  msg=${err_msg}
+    END
 
     Shutdown HTX Exerciser
 
@@ -171,8 +170,7 @@
     Rpvars  num_os_gpus
 
     # If no GPUs detected, we cannot continue.
-    Run Keyword If  '${num_os_gpus}' == '${0}'  Fail
-    ...  msg=No GPUs detected so cannot run test.
+    IF  '${num_os_gpus}' == '${0}'  Fail  msg=No GPUs detected so cannot run test.
 
     Set Suite Variable  ${num_os_gpus}  children=true
 
@@ -182,8 +180,7 @@
     [Documentation]  Do the post test teardown.
 
     # 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
+    IF  '${TEST_STATUS}' == 'FAIL' and ${HTX_KEEP_RUNNING} == ${0}  Shutdown HTX Exerciser
 
     ${keyword_buf}=  Catenate  Stop SOL Console Logging
     ...  \ targ_file_path=${EXECDIR}${/}logs${/}SOL.log
diff --git a/systest/htx_hardbootme_test.robot b/systest/htx_hardbootme_test.robot
index 9e7ce18..bc3b4a6 100755
--- a/systest/htx_hardbootme_test.robot
+++ b/systest/htx_hardbootme_test.robot
@@ -81,8 +81,9 @@
     Rprint Vars  HTX_DURATION  HTX_LOOP  HTX_INTERVAL  CHECK_INVENTORY
     ...  INV_IGNORE_LIST  PREV_INV_FILE_PATH
 
-    Run Keyword If  '${PREV_INV_FILE_PATH}' != 'NONE'
-    ...  OperatingSystem.File Should Exist  ${PREV_INV_FILE_PATH}
+    IF  '${PREV_INV_FILE_PATH}' != 'NONE'
+        OperatingSystem.File Should Exist  ${PREV_INV_FILE_PATH}
+    END
 
     Set Suite Variable  ${PREV_INV_FILE_PATH}  children=true
     Set Suite Variable  ${INV_IGNORE_LIST}  children=true
@@ -136,12 +137,11 @@
     # Post Power off and on, the OS SSH session needs to be established.
     Login To OS
 
-    Run Keyword If  '${CHECK_INVENTORY}' == 'True'
-    ...  Do Inventory And Compare  ${json_initial_file_path}
-    ...  ${PREV_INV_FILE_PATH}
+    IF  '${CHECK_INVENTORY}' == 'True'
+        Do Inventory And Compare  ${json_initial_file_path}  ${PREV_INV_FILE_PATH}
+    END
 
-    Run Keyword If  '${HTX_MDT_PROFILE}' == 'mdt.bu'
-    ...  Create Default MDT Profile
+    IF  '${HTX_MDT_PROFILE}' == 'mdt.bu'  Create Default MDT Profile
 
     Run MDT Profile
 
@@ -149,9 +149,9 @@
 
     Shutdown HTX Exerciser
 
-    Run Keyword If  '${CHECK_INVENTORY}' == 'True'
-    ...  Do Inventory And Compare  ${json_final_file_path}
-    ...  ${PREV_INV_FILE_PATH}
+    IF  '${CHECK_INVENTORY}' == 'True'
+        Do Inventory And Compare  ${json_final_file_path}  ${PREV_INV_FILE_PATH}
+    END
 
     Run Keyword  ${rest_keyword} Power Off
 
@@ -179,9 +179,9 @@
     # PREV_INV_FILE_PATH   The previous inventory to compare with.
 
     Create JSON Inventory File  ${inventory_file_path}
-    Run Keyword If  '${PREV_INV_FILE_PATH}' != 'NONE'
-    ...  Compare Json Inventory Files  ${inventory_file_path}
-    ...  ${PREV_INV_FILE_PATH}
+    IF  '${PREV_INV_FILE_PATH}' != 'NONE'
+        Compare Json Inventory Files  ${inventory_file_path}  ${PREV_INV_FILE_PATH}
+    END
     ${PREV_INV_FILE_PATH}=   Set Variable  ${inventory_file_path}
     Set Suite Variable  ${PREV_INV_FILE_PATH}  children=true
 
@@ -194,11 +194,12 @@
     # file2   A file that has an inventory snapshot, to compare with file1.
 
     ${diff_rc}=  File_Diff  ${file1}
-     ...  ${file2}  ${json_diff_file_path}  ${INV_IGNORE_LIST}
-    Run Keyword If  '${diff_rc}' != '${0}'
-    ...  Report Inventory Mismatch  ${diff_rc}  ${json_diff_file_path}
-    ...  ELSE  Print Timen  Inventoy check: No differences found.
-
+    ...  ${file2}  ${json_diff_file_path}  ${INV_IGNORE_LIST}
+    IF  '${diff_rc}' != '${0}'
+        Report Inventory Mismatch  ${diff_rc}  ${json_diff_file_path}
+    ELSE
+        Print Timen  Inventoy check: No differences found.
+    END
 
 Report Inventory Mismatch
     [Documentation]  Report inventory mismatch.
@@ -253,17 +254,16 @@
 
     # Shutdown if HTX is running.
     ${status}=  Is HTX Running
-    Run Keyword If  '${status}' == 'True'
-    ...  Shutdown HTX Exerciser
+    IF  '${status}' == 'True'  Shutdown HTX Exerciser
 
 
 Test Teardown Execution
     [Documentation]  Do the post-test teardown.
 
     # 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
+    IF  '${TEST_STATUS}' == 'FAIL' and ${HTX_KEEP_RUNNING} == ${0}
+        Shutdown HTX Exerciser
+    END
 
     ${keyword_buf}=  Catenate  Stop SOL Console Logging
     ...  \ targ_file_path=${EXECDIR}${/}logs${/}SOL.log
diff --git a/systest/network_stability_test.robot b/systest/network_stability_test.robot
index af2daca..a1caf26 100755
--- a/systest/network_stability_test.robot
+++ b/systest/network_stability_test.robot
@@ -42,8 +42,7 @@
     # Post Power off and on, the OS SSH session needs to be established.
     Login To OS
 
-    Run Keyword If  '${HTX_MDT_PROFILE}' == 'mdt.bu'
-    ...  Create Default MDT Profile
+    IF  '${HTX_MDT_PROFILE}' == 'mdt.bu'  Create Default MDT Profile
 
     Run MDT Profile
 
@@ -51,8 +50,9 @@
     ${status}=  Run Until Keyword Fails  ${HTX_DURATION}  ${HTX_INTERVAL}
     ...  Start Network Test
 
-    Run Keyword If  '${status}' == 'False'
-    ...  Fail  Network is unstable. Please check for errors.
+    IF  '${status}' == 'False'
+        Fail  Network is unstable. Please check for errors.
+    END
 
     Shutdown HTX Exerciser
 
@@ -85,8 +85,7 @@
 
     # Shutdown if HTX is running.
     ${status}=  Is HTX Running
-    Run Keyword If  '${status}' == 'True'
-    ...  Shutdown HTX Exerciser
+    IF  '${status}' == 'True'  Shutdown HTX Exerciser
 
 
 Test Teardown Execution
@@ -96,8 +95,9 @@
     # 3. Close all open SSH connections.
 
     # 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
+    IF  '${TEST_STATUS}' == 'FAIL' and ${HTX_KEEP_RUNNING} == ${0}
+        Shutdown HTX Exerciser
+    END
 
     FFDC On Test Case Fail
     Close All Connections