Fix deprecated keyword used in openpower suite

Changes:
    - Run KeyWord If is deprecated since Robot
      Framework version 5.*, use 'IF' instead
    - Keyword name Check If BMC is Up does not
      follow case convention

Tested:
   - Tested the scripts on BMC environment

Change-Id: I5effd40ec81e8840fe9aae792929244f33c1bc8b
Signed-off-by: Sridevi Ramesh <sridevra@in.ibm.com>
diff --git a/openpower/ipmi/test_ipmi_sdr.robot b/openpower/ipmi/test_ipmi_sdr.robot
index 8fb12fa..da9a2e3 100755
--- a/openpower/ipmi/test_ipmi_sdr.robot
+++ b/openpower/ipmi/test_ipmi_sdr.robot
@@ -26,11 +26,11 @@
 
     ${state_ipmi}=  Get SDR Presence Via IPMI  turbo_allowed${SPACE}
 
-    Run Keyword If  '${state_ipmi}' == 'Disabled'
-    ...    Should Be True  ${state_rest} == ${0}
-    ...  ELSE IF  '${state_ipmi}' == 'State Asserted'
-    ...    Should Be True  ${state_rest} == ${1}
-
+    IF  '${state_ipmi}' == 'Disabled'
+        Should Be True  ${state_rest} == ${0}
+    ELSE IF  '${state_ipmi}' == 'State Asserted'
+        Should Be True  ${state_rest} == ${1}
+    END
 
 *** Keywords ***
 
diff --git a/openpower/localuser/test_ipmi_redfish_user.robot b/openpower/localuser/test_ipmi_redfish_user.robot
index 5740c40..77b144d 100644
--- a/openpower/localuser/test_ipmi_redfish_user.robot
+++ b/openpower/localuser/test_ipmi_redfish_user.robot
@@ -184,8 +184,9 @@
     Run IPMI Standard Command  user enable ${random_userid}
 
     # Set given privilege and enable IPMI messaging for newly created user.
-    Run Keyword If  '${privilege}' != '0'
-    ...  Set Channel Access  ${random_userid}  ipmi=on privilege=${privilege}
+    IF  '${privilege}' != '0'
+        Set Channel Access  ${random_userid}  ipmi=on privilege=${privilege}
+    END
 
     RETURN  ${random_username}  ${random_userid}
 
@@ -248,8 +249,12 @@
         ${is_empty}=  Run Keyword And Return Status
         ...  Should Match Regexp  ${name_line}  ${empty_name_pattern}
 
-        Exit For Loop If  ${is_empty} == ${True}
+        IF  ${is_empty} == ${True}  BREAK
     END
-    Run Keyword If  '${index}' == '299'  Fail  msg=A free user ID could not be found.
+
+    IF  '${index}' == '299'
+        Fail  msg=A free user ID could not be found.
+    END
+
     RETURN  ${random_userid}
 
diff --git a/openpower/pel/test_bmc_pel.robot b/openpower/pel/test_bmc_pel.robot
index 7ec00da..1e7036e 100644
--- a/openpower/pel/test_bmc_pel.robot
+++ b/openpower/pel/test_bmc_pel.robot
@@ -784,10 +784,10 @@
     ${percent_diff}=  Evaluate  ${disk_usage_percentage} - ${max_allocated_space_percentage}
     ${percent_diff}=   Evaluate  abs(${percent_diff})
 
-    ${trimmed_as_expected}=  Run Keyword If  ${disk_usage_percentage} > ${max_allocated_space_percentage}
-    ...  Evaluate  ${percent_diff} <= 0.5
-    ...  ELSE
-    ...  Set Variable  True
+    ${eval_value}=  Evaluate  ${percent_diff} <= 0.5
+
+    ${trimmed_as_expected}=  Set Variable If  ${disk_usage_percentage} > ${max_allocated_space_percentage}
+    ...  ${eval_value}  True
 
     # Check PEL log count via peltool command and compare it with actual generated log count.
     ${pel_records}=  peltool  -n
@@ -795,9 +795,9 @@
     # Number of logs can be 80% of the total logs created after trimming.
     ${expected_max_record}=   Evaluate  3000 * 0.8
 
-    Run Keyword If  ${trimmed_as_expected} == False
-    ...  Should Be True  ${no_pel_records} <= ${expected_max_record}
-
+    IF  ${trimmed_as_expected} == False
+        Should Be True  ${no_pel_records} <= ${expected_max_record}
+    END
 
 Create Error Log
     [Documentation]  Create an error log.
@@ -875,7 +875,7 @@
 
       ${pel_section_output}=  Get From Dictionary  ${pel_output}  ${pel_section}
       ${pel_field_output}=  Get From Dictionary  ${pel_section_output}  ${pel_field}
-      Run Keyword If  '${pel_field_output}' in @{pel_field_value}  Append To List  ${pel_id_list}  ${id}
+      IF  '${pel_field_output}' in @{pel_field_value}  Append To List  ${pel_id_list}  ${id}
     END
     Sort List  ${pel_id_list}
 
@@ -943,21 +943,23 @@
     # expected_transmission_state        Expected host transmission state of PEL log.
 
     # Get system in required state.
-    Run Keyword If  '${host_state}' == 'Off'
-    ...  Redfish Power Off  stack_mode=skip
-    ...  ELSE IF  '${host_state}' == 'On'
-    ...  Run Keywords  Redfish Power On  stack_mode=skip  AND
-    ...  Wait For Host To Ping  ${OS_HOST}  5 min  10 sec
+    IF  '${host_state}' == 'Off'
+        Redfish Power Off  stack_mode=skip
+    ELSE IF  '${host_state}' == 'On'
+        Redfish Power On  stack_mode=skip
+        Wait For Host To Ping  ${OS_HOST}  5 min  10 sec
+    END
 
     Redfish Purge Event Log
 
     # Inject required error log.
-    Run Keyword If  "${error_type}" == "informational_error"
-    ...  BMC Execute Command  ${CMD_INFORMATIONAL_ERROR}
-    ...  ELSE IF  "${error_type}" == "unrecoverable_error"
-    ...  BMC Execute Command  ${CMD_UNRECOVERABLE_ERROR}
-    ...  ELSE IF  "${error_type}" == "predictive_error"
-    ...  BMC Execute Command  ${CMD_PREDICTIVE_ERROR}
+    IF  "${error_type}" == "informational_error"
+        BMC Execute Command  ${CMD_INFORMATIONAL_ERROR}
+    ELSE IF  "${error_type}" == "unrecoverable_error"
+        BMC Execute Command  ${CMD_UNRECOVERABLE_ERROR}
+    ELSE IF  "${error_type}" == "predictive_error"
+       BMC Execute Command  ${CMD_PREDICTIVE_ERROR}
+    END
 
     ${pel_records}=  Get Pel Data From Bmc  True  True
     ${ids}=  Get Dictionary Keys  ${pel_records}
@@ -965,16 +967,17 @@
 
     # Check host transmission state for the cases where PEL is
     # expected to be  offloaded to HOST.
-    Run Keyword If  "${expected_transmission_state}" == "Acked"
-    ...  Wait Until Keyword Succeeds  15 min  10 sec
-    ...  Check If PEL Transmission State Is Expected  ${pel_id}  Acked
+    IF  "${expected_transmission_state}" == "Acked"
+         Wait Until Keyword Succeeds  15 min  10 sec
+         ...  Check If PEL Transmission State Is Expected  ${pel_id}  Acked
+    END
 
     # Adding delay before checking host transmission for the cases where PEL is
     # not expected to be offloaded to HOST.
-    Run Keyword If  "${expected_transmission_state}" == "Not sent"
-    ...  Run Keywords  Sleep  120s  AND
-    ...  Check If PEL Transmission State Is Expected  ${pel_id}  Not sent
-
+    IF  "${expected_transmission_state}" == "Not sent"
+        Sleep  120s
+        Check If PEL Transmission State Is Expected  ${pel_id}  Not sent
+    END
 
 Check If PEL Transmission State Is Expected
     [Documentation]  Check if PEL's host transmission state is matching expected state.