Fix deprecrated Run Keyword If for systems
Changes:
- Run Keyword If is deprecated since
Robot Framework version 5.*, use IF and END or Inline IF
Tested:
- Checked using robot dry-run to make sure the
syntax is not broken
Change-Id: I9bd9ba2706772fb288c62fa43016eaa343fc7324
Signed-off-by: Sridevi Ramesh <sridevra@in.ibm.com>
diff --git a/openpower/ext_interfaces/test_client_identifier.robot b/openpower/ext_interfaces/test_client_identifier.robot
index 99c9924..7195fcd 100644
--- a/openpower/ext_interfaces/test_client_identifier.robot
+++ b/openpower/ext_interfaces/test_client_identifier.robot
@@ -100,11 +100,12 @@
${before_reboot_xauth_token}= Set Variable ${XAUTH_TOKEN}
- Run Keyword If '${reboot_flag}' == 'True'
- ... Run Keywords Redfish BMC Reset Operation AND
- ... Set Global Variable ${XAUTH_TOKEN} ${before_reboot_xauth_token} AND
- ... Is BMC Standby AND
- ... Verify A Session Created With ClientID ${client_ids} ${session_info}
+ IF '${reboot_flag}' == 'True'
+ Redfish BMC Reset Operation
+ Set Global Variable ${XAUTH_TOKEN} ${before_reboot_xauth_token}
+ Is BMC Standby
+ Verify A Session Created With ClientID ${client_ids} ${session_info}
+ END
Redfish Delete List Of Session ${session_info}
diff --git a/openpower/ext_interfaces/test_discovery.robot b/openpower/ext_interfaces/test_discovery.robot
index d2e8a5f..863d282 100644
--- a/openpower/ext_interfaces/test_discovery.robot
+++ b/openpower/ext_interfaces/test_discovery.robot
@@ -167,7 +167,7 @@
# If the value is False, skip the step to disable the AvahiDaemon.
Verify Existence Of BMC Record From List ${service_type}
- Run Keyword If '${skip}' == 'True' Set AvahiDaemon Service command=stop
+ IF '${skip}' == 'True' Set AvahiDaemon Service command=stop
Redfish OBMC Reboot (off)
Verify AvahiDaemon Service Status message=start
Login To OS ${AVAHI_CLIENT} ${AVAHI_CLIENT_USERNAME} ${AVAHI_CLIENT_PASSWORD}
diff --git a/openpower/ext_interfaces/test_lock_management.robot b/openpower/ext_interfaces/test_lock_management.robot
index 2ff19d9..023e1a5 100644
--- a/openpower/ext_interfaces/test_lock_management.robot
+++ b/openpower/ext_interfaces/test_lock_management.robot
@@ -464,10 +464,11 @@
... expected_status=any
Should Be Equal As Strings ${resp.status_code} ${status_code}
- Run Keyword If ${status_code} == ${HTTP_BAD_REQUEST}
- ... Valid Value ${BAD_REQUEST} ['${resp.content}']
- ... ELSE
- ... Run Keyword And Return Return Description Of Response ${resp.content}
+ IF ${status_code} == ${HTTP_BAD_REQUEST}
+ Valid Value ${BAD_REQUEST} ['${resp.content}']
+ ELSE
+ Run Keyword And Return Return Description Of Response ${resp.content}
+ END
RETURN ${resp}
@@ -487,10 +488,11 @@
... expected_status=any
Should Be Equal As Strings ${resp.status_code} ${status_code}
- Run Keyword If ${status_code} == ${HTTP_CONFLICT}
- ... Should Be Equal As Strings ${CONFLICT_RQUEST} ${resp.content}
- ... ELSE
- ... Run Keyword And Return Return Description Of Response ${resp.content}
+ IF ${status_code} == ${HTTP_CONFLICT}
+ Should Be Equal As Strings ${CONFLICT_RQUEST} ${resp.content}
+ ELSE
+ Run Keyword And Return Return Description Of Response ${resp.content}
+ END
RETURN ${resp}
@@ -509,8 +511,9 @@
${resp}= Redfish Post Request
... /ibm/v1/HMC/LockService/Actions/LockService.AcquireLock data=${lock_dict_param}
Should Be Equal As Strings ${resp.status_code} ${status_code}
- Run Keyword If '${message}' != '${EMPTY}'
- ... Valid Value message ['${resp.content}']
+ IF '${message}' != '${EMPTY}'
+ Valid Value message ['${resp.content}']
+ END
RETURN ${resp}
@@ -666,15 +669,17 @@
${before_reboot_xauth_token}= Set Variable ${XAUTH_TOKEN}
- Run Keyword If '${reboot_flag}' == 'True'
- ... Run Keywords Redfish BMC Reset Operation AND
- ... Set Global Variable ${XAUTH_TOKEN} ${before_reboot_xauth_token} AND
- ... Wait Until Keyword Succeeds 3 min 10 sec Redfish BMC Match States match_state=Enabled AND
- ... Is BMC Standby AND
- ... Verify Lock On Resource ${session_info} ${trans_id_emptylist}
+ IF '${reboot_flag}' == 'True'
+ Redfish BMC Reset Operation
+ Set Global Variable ${XAUTH_TOKEN} ${before_reboot_xauth_token}
+ Wait Until Keyword Succeeds 3 min 10 sec Redfish BMC Match States match_state=Enabled
+ Is BMC Standby
+ Verify Lock On Resource ${session_info} ${trans_id_emptylist}
+ END
- Run Keyword If '${reboot_flag}' == 'False'
- ... Release Locks On Resource ${session_info} ${trans_id_list} Transaction ${HTTP_OK}
+ IF '${reboot_flag}' == 'False'
+ Release Locks On Resource ${session_info} ${trans_id_list} Transaction ${HTTP_OK}
+ END
${trans_id_emptylist}= Create List
Verify Lock On Resource ${session_info} ${trans_id_emptylist}
@@ -930,12 +935,14 @@
${session_info}= Create Redfish Session With ClientID ${client_id}
${before_reboot_xauth_token}= Set Variable ${XAUTH_TOKEN}
- Run Keyword If '${reboot_flag}' == 'True'
- ... Run Keywords Redfish BMC Reset Operation AND
- ... Set Global Variable ${XAUTH_TOKEN} ${before_reboot_xauth_token} AND
- ... Wait Until Keyword Succeeds 3 min 10 sec Redfish BMC Match States match_state=Enabled AND
- ... Is BMC Standby AND
- ... Post Reboot Acquire Lock ${session_info} ${lock_type}
+ IF '${reboot_flag}' == 'True'
+ Redfish BMC Reset Operation
+ Set Global Variable ${XAUTH_TOKEN} ${before_reboot_xauth_token}
+ Wait Until Keyword Succeeds 3 min 10 sec Redfish BMC Match States match_state=Enabled
+ Is BMC Standby
+ Post Reboot Acquire Lock ${session_info} ${lock_type}
+ END
+
Redfish Delete Session ${session_info}
diff --git a/openpower/vpd/test_vpd_tool.robot b/openpower/vpd/test_vpd_tool.robot
index 060f47f..862cbb7 100644
--- a/openpower/vpd/test_vpd_tool.robot
+++ b/openpower/vpd/test_vpd_tool.robot
@@ -220,8 +220,8 @@
# component VPD component (e.g. System,Chassis etc).
# field VPD field (e.g. Serialnumber,LocationCode etc).
- ${component_url}= Run Keyword If
- ... '${component}' == 'System' Set Variable /system
+ ${component_url}= Set Variable If
+ ... '${component}' == 'System' /system
# Get VPD details of given component via vpd-tool.
${vpd_records}= Vpdtool -o -O ${component_url}
diff --git a/redfish/systems/eventlog/test_event_logging.robot b/redfish/systems/eventlog/test_event_logging.robot
index b082ae3..87f82c2 100644
--- a/redfish/systems/eventlog/test_event_logging.robot
+++ b/redfish/systems/eventlog/test_event_logging.robot
@@ -301,9 +301,9 @@
${elogs}= Get Event Logs
${count}= Get Length ${elogs}
- Run Keyword If ${count} > 200
- ... Fail Error logs created exceeded max capacity 200.
-
+ IF ${count} > 200
+ Fail Error logs created exceeded max capacity 200.
+ END
Test Event Log Wrapping
[Documentation] Verify event log entries wraps when 200 max cap is reached.
@@ -373,7 +373,7 @@
Redfish Purge Event Log
${status}= Run Keyword And Return Status Logging Test Binary Exist
- Run Keyword If ${status} == ${False} Install Tarball
+ IF ${status} == ${False} Install Tarball
Suite Teardown Execution
@@ -388,7 +388,7 @@
Redfish Purge Event Log
${status}= Run Keyword And Return Status Logging Test Binary Exist
- Run Keyword If ${status} == ${False} Install Tarball
+ IF ${status} == ${False} Install Tarball
Test Teardown Execution
@@ -451,7 +451,7 @@
IF '${found_match}' == 'True' BREAK
END
- Run Keyword If '${found_match}' == 'False' Fail msg=No watchdog error logged.
+ IF '${found_match}' == 'False' Fail msg=No watchdog error logged.
Is Watchdog Error Found
diff --git a/redfish/systems/test_power_operations.robot b/redfish/systems/test_power_operations.robot
index 7b064d8..91a9eca 100644
--- a/redfish/systems/test_power_operations.robot
+++ b/redfish/systems/test_power_operations.robot
@@ -42,10 +42,11 @@
Redfish Power On
- Run Keyword If ${additional_occ_check} == ${1}
- ... Wait Until Keyword Succeeds 3 mins 30 secs Match OCC And CPU State Count
+ IF ${additional_occ_check} == ${1}
+ Wait Until Keyword Succeeds 3 mins 30 secs Match OCC And CPU State Count
+ END
- Run Keyword If ${additional_power_check} == ${1} Power Check
+ IF ${additional_power_check} == ${1} Power Check
Verify Redfish Host GracefulRestart
@@ -67,7 +68,7 @@
[Documentation] Do test case setup tasks.
Printn
- Run Keyword If ${capture_sol} == ${1} Start SOL Console Logging
+ IF ${capture_sol} == ${1} Start SOL Console Logging
Redfish.Login
@@ -75,12 +76,14 @@
[Documentation] Collect FFDC and SOL log.
FFDC On Test Case Fail
- Run Keyword If ${capture_sol} == ${1} Stop SOL Capture
+ IF ${capture_sol} == ${1} Stop SOL Capture
- Run Keyword If ${REDFISH_SUPPORTED}
- ... Redfish Set Auto Reboot RetryAttempts
- ... ELSE
- ... Set Auto Reboot ${1}
+ IF ${REDFISH_SUPPORTED}
+ Redfish Set Auto Reboot RetryAttempts
+ ELSE
+ Set Auto Reboot ${1}
+ END
+
Redfish.Logout
@@ -108,8 +111,9 @@
# Ensure the path does have the attribute else set to EMPTY as default to skip.
${value}= Get Variable Value ${power_control[0]['PowerConsumedWatts']} ${EMPTY}
- Run Keyword If "${value}" == "${EMPTY}"
- ... Remove Values From List ${power_uri_list} ${idx}
+ IF "${value}" == "${EMPTY}"
+ Remove Values From List ${power_uri_list} ${idx}
+ END
# Check the next available element in the list.
IF "${value}" == "${EMPTY}" CONTINUE
diff --git a/redfish/systems/test_power_voltage_readings.robot b/redfish/systems/test_power_voltage_readings.robot
index d8539fe..157955f 100755
--- a/redfish/systems/test_power_voltage_readings.robot
+++ b/redfish/systems/test_power_voltage_readings.robot
@@ -44,8 +44,9 @@
... [('Health', '^OK$'), ('State', '^Enabled$'), ('${reading_type}', '')] regex=1 invert=1
${num_invalid_records}= Get Length ${invalid_records}
- Run Keyword If ${num_invalid_records} > ${0}
- ... Rprint Vars num_invalid_records invalid_records fmt=terse
+ IF ${num_invalid_records} > ${0}
+ Rprint Vars num_invalid_records invalid_records fmt=terse
+ END
Valid Value num_invalid_records valid_values=[0]
${cmd} Catenate [x for x in ${records}
@@ -53,8 +54,10 @@
${invalid_records}= Evaluate ${cmd}
${num_invalid_records}= Get Length ${invalid_records}
- Run Keyword If ${num_invalid_records} > ${0}
- ... Rprint Vars num_invalid_records invalid_records fmt=terse
+ IF ${num_invalid_records} > ${0}
+ Rprint Vars num_invalid_records invalid_records fmt=terse
+ END
+
Valid Value num_invalid_records valid_values=[0]
diff --git a/redfish/systems/test_sensor_monitoring.robot b/redfish/systems/test_sensor_monitoring.robot
index f3a1bfe..4115804 100644
--- a/redfish/systems/test_sensor_monitoring.robot
+++ b/redfish/systems/test_sensor_monitoring.robot
@@ -93,10 +93,13 @@
Should Not Be Empty ${OS_HOST}
Should Not Be Empty ${OS_USERNAME}
Should Not Be Empty ${OS_PASSWORD}
- Run Keyword If '${OPENBMC_CONN_METHOD}' == 'ssh'
- ... Should Not Be Empty ${OPENBMC_HOST}
- ... ELSE IF '${OPENBMC_CONN_METHOD}' == 'telnet'
- ... Should Not Be Empty ${OPENBMC_SERIAL_HOST}
+
+ IF '${OPENBMC_CONN_METHOD}' == 'ssh'
+ Should Not Be Empty ${OPENBMC_HOST}
+ ELSE IF '${OPENBMC_CONN_METHOD}' == 'telnet'
+ Should Not Be Empty ${OPENBMC_SERIAL_HOST}
+ END
+
Should Not Be Empty ${OPENBMC_MODEL}
@@ -158,8 +161,9 @@
... or '${resp.dict['Status']['State']}' != 'Enabled'
... or ${resp.dict['Reading']} == ${null}
- Run Keyword If ${condition_str}
- ... Append To List ${INVALID_SENSORS} ${sensor_name}
+ IF ${condition_str}
+ Append To List ${INVALID_SENSORS} ${sensor_name}
+ END
Check Sensor Status And Reading Via Sensor Info
@@ -179,8 +183,9 @@
... or '${sensor_info['Status']['State']}' != 'Enabled'
... or ${sensor_info['${reading_unit}']} == ${null}
- Run Keyword If ${condition_str}
- ... Append To List ${INVALID_SENSORS} ${sensor_info['MemberId']}
+ IF ${condition_str}
+ Append To List ${INVALID_SENSORS} ${sensor_info['MemberId']}
+ END
END
@@ -218,6 +223,7 @@
FOR ${sensor_name} IN @{expected_sensor_name_list}
${exist}= Evaluate '${sensor_name}' in ${curr_sensor_name_list}
- Run Keyword If '${exist}' == '${False}'
- ... Append To List ${INVALID_SENSORS} ${sensor_name}
+ IF '${exist}' == '${False}'
+ Append To List ${INVALID_SENSORS} ${sensor_name}
+ END
END
diff --git a/redfish/systems/test_thermal_ambient_temperatures.robot b/redfish/systems/test_thermal_ambient_temperatures.robot
index 8a79051..1f29aad 100755
--- a/redfish/systems/test_thermal_ambient_temperatures.robot
+++ b/redfish/systems/test_thermal_ambient_temperatures.robot
@@ -60,8 +60,10 @@
${invalid_records}= Evaluate ${cmd}
${num_invalid_records}= Get Length ${invalid_records}
- Run Keyword If ${num_invalid_records} > ${0}
- ... Rprint Vars num_invalid_records invalid_records
+ IF ${num_invalid_records} > ${0}
+ Rprint Vars num_invalid_records invalid_records
+ END
+
Valid Value num_invalid_records valid_values=[0]
Event Log Should Not Exist