IPMI robot codes with latest directives
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: I8a52aeb2939104f2c94f294272d92c4a7692970e
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/ipmi/test_ipmi_chassis.robot b/ipmi/test_ipmi_chassis.robot
index dca1230..0a2b15d 100644
--- a/ipmi/test_ipmi_chassis.robot
+++ b/ipmi/test_ipmi_chassis.robot
@@ -237,6 +237,5 @@
@{powertolist}= Split String ${power_status} :
${status}= Get From List ${powertolist} 1
# Chassis Power ON if status is off
- Run Keyword If '${status.strip()}' != 'on'
- ... Redfish Power On
+ IF '${status.strip()}' != 'on' Redfish Power On
FFDC On Test Case Fail
diff --git a/ipmi/test_ipmi_cipher.robot b/ipmi/test_ipmi_cipher.robot
index 73c1d48..4e9497a 100644
--- a/ipmi/test_ipmi_cipher.robot
+++ b/ipmi/test_ipmi_cipher.robot
@@ -161,8 +161,9 @@
@{expected_data_list}= Split String ${response_data}
- Run Keyword If '${cipher_suite}' == 'standard'
- ... Verify Standard Cipher Suite For Channel ${expected_data_list} ${channel_number}
+ IF '${cipher_suite}' == 'standard'
+ Verify Standard Cipher Suite For Channel ${expected_data_list} ${channel_number}
+ END
Verify Supported Algorithm For Channel
[Documentation] Compare the supported algorithms got from ipmi_raw_cmd_table with
@@ -200,10 +201,11 @@
... ELSE
... Convert To Hex ${channel_num} length=2
- Run Keyword If '${index_value}' == '0x80'
- ... Verify Algorithm by Cipher Suite For Channel ${resp} ${channel_num}
- ... ELSE
- ... Verify Supported Algorithm For Channel ${resp} ${channel_num}
+ IF '${index_value}' == '0x80'
+ Verify Algorithm by Cipher Suite For Channel ${resp} ${channel_num}
+ ELSE
+ Verify Supported Algorithm For Channel ${resp} ${channel_num}
+ END
Verify Cipher Suite For Invalid Channel
[Documentation] Execute cipher suite ipmi cmd for invalid channel and verify Error code.
diff --git a/ipmi/test_ipmi_cold_reset.robot b/ipmi/test_ipmi_cold_reset.robot
index 491b8c8..77617b2 100644
--- a/ipmi/test_ipmi_cold_reset.robot
+++ b/ipmi/test_ipmi_cold_reset.robot
@@ -165,43 +165,49 @@
${ipmi_lower_non_recoverable_threshold}= Set Variable ${get_ipmi_lower_non_recoverable_threshold.strip()}
${lower_non_recoverable_threshold_status}= Run Keyword And Return Status Should Not Contain
... ${ipmi_lower_non_recoverable_threshold} na
- Run Keyword If '${lower_non_recoverable_threshold_status}' == 'True'
- ... Set To Dictionary ${tmp_dict} lnr ${ipmi_lower_non_recoverable_threshold}
+ IF '${lower_non_recoverable_threshold_status}' == 'True'
+ Set To Dictionary ${tmp_dict} lnr ${ipmi_lower_non_recoverable_threshold}
+ END
${get_ipmi_lower_critical_threshold}= Get From List ${ipmi_sensor} 5
${ipmi_lower_critical_threshold}= Set Variable ${get_ipmi_lower_critical_threshold.strip()}
${lower_critical_threshold_status}= Run Keyword And Return Status Should Not Contain
... ${ipmi_lower_critical_threshold} na
- Run Keyword If '${lower_critical_threshold_status}' == 'True'
- ... Set To Dictionary ${tmp_dict} lcr ${ipmi_lower_critical_threshold}
+ IF '${lower_critical_threshold_status}' == 'True'
+ Set To Dictionary ${tmp_dict} lcr ${ipmi_lower_critical_threshold}
+ END
${get_ipmi_lower_non_critical_threshold}= Get From List ${ipmi_sensor} 6
${ipmi_lower_non_critical_threshold}= Set Variable ${get_ipmi_lower_non_critical_threshold.strip()}
${lower_non_critical_threshold_status}= Run Keyword And Return Status Should Not Contain
... ${ipmi_lower_non_critical_threshold} na
- Run Keyword If '${lower_non_critical_threshold_status}' == 'True'
- ... Set To Dictionary ${tmp_dict} lnc ${ipmi_lower_non_critical_threshold}
+ IF '${lower_non_critical_threshold_status}' == 'True'
+ Set To Dictionary ${tmp_dict} lnc ${ipmi_lower_non_critical_threshold}
+ END
${get_ipmi_upper_non_critical_threshold}= Get From List ${ipmi_sensor} 7
${ipmi_upper_non_critical_threshold}= Set Variable ${get_ipmi_upper_non_critical_threshold.strip()}
${upper_non_critical_threshold_status}= Run Keyword And Return Status Should Not Contain
... ${ipmi_upper_non_critical_threshold} na
- Run Keyword If '${upper_non_critical_threshold_status}' == 'True'
- ... Set To Dictionary ${tmp_dict} unc ${ipmi_upper_non_critical_threshold}
+ IF '${upper_non_critical_threshold_status}' == 'True'
+ Set To Dictionary ${tmp_dict} unc ${ipmi_upper_non_critical_threshold}
+ END
${get_ipmi_upper_critical_threshold}= Get From List ${ipmi_sensor} 8
${ipmi_upper_critical_threshold}= Set Variable ${get_ipmi_upper_critical_threshold.strip()}
${upper_critical_threshold_status}= Run Keyword And Return Status Should Not Contain
... ${ipmi_upper_critical_threshold} na
- Run Keyword If '${upper_critical_threshold_status}' == 'True'
- ... Set To Dictionary ${tmp_dict} ucr ${ipmi_upper_critical_threshold}
+ IF '${upper_critical_threshold_status}' == 'True'
+ Set To Dictionary ${tmp_dict} ucr ${ipmi_upper_critical_threshold}
+ END
${get_ipmi_upper_non_recoverable_threshold}= Get From List ${ipmi_sensor} 9
${ipmi_upper_non_recoverable_threshold}= Set Variable ${get_ipmi_upper_non_recoverable_threshold.strip()}
${upper_non_recoverable_threshold_status}= Run Keyword And Return Status Should Not Contain
... ${ipmi_upper_non_recoverable_threshold} na
- Run Keyword If '${upper_non_recoverable_threshold_status}' == 'True'
- ... Set To Dictionary ${tmp_dict} unr ${ipmi_upper_non_recoverable_threshold}
+ IF '${upper_non_recoverable_threshold_status}' == 'True'
+ Set To Dictionary ${tmp_dict} unr ${ipmi_upper_non_recoverable_threshold}
+ END
RETURN ${random_sensor_name} ${tmp_dict}
diff --git a/ipmi/test_ipmi_sdr.robot b/ipmi/test_ipmi_sdr.robot
index 5d27644..96d550a 100755
--- a/ipmi/test_ipmi_sdr.robot
+++ b/ipmi/test_ipmi_sdr.robot
@@ -124,10 +124,11 @@
${state_ipmi}= Get SDR Presence Via IPMI auto_reboot${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
Test TPM Enable SDR Info
@@ -141,10 +142,11 @@
${state_ipmi}= Get SDR Presence Via IPMI auto_reboot${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
Test Reserve SDR Repository
@@ -356,15 +358,17 @@
${component_name}= Replace String ${component_name} / _
${presence_ipmi}= Get SDR Presence Via IPMI ${component_name}${SPACE}
- Run Keyword If '${presence_ipmi}' == 'Disabled' or '${presence_ipmi}' == ''
- ... Should Be True ${presence_rest} == ${0} and ${functional_rest} == ${0}
- ... ELSE IF '${presence_ipmi}' == 'Presence Detected' or '${presence_ipmi}' == 'Presence detected'
- ... Should Be True ${presence_rest} == ${1} and ${functional_rest} == ${1}
- ... ELSE IF '${presence_ipmi}' == 'State Asserted'
- ... Should Be True ${presence_rest} == ${1} and ${functional_rest} == ${1}
- ... ELSE IF '${presence_ipmi}' == 'State Deasserted'
- ... Should Be True ${presence_rest} == ${1} and ${functional_rest} == ${0}
- ... ELSE Fail msg=Invalid Presence${presence_ipmi}
+ IF '${presence_ipmi}' == 'Disabled' or '${presence_ipmi}' == ''
+ Should Be True ${presence_rest} == ${0} and ${functional_rest} == ${0}
+ ELSE IF '${presence_ipmi}' == 'Presence Detected' or '${presence_ipmi}' == 'Presence detected'
+ Should Be True ${presence_rest} == ${1} and ${functional_rest} == ${1}
+ ELSE IF '${presence_ipmi}' == 'State Asserted'
+ Should Be True ${presence_rest} == ${1} and ${functional_rest} == ${1}
+ ELSE IF '${presence_ipmi}' == 'State Deasserted'
+ Should Be True ${presence_rest} == ${1} and ${functional_rest} == ${0}
+ ELSE
+ Fail msg=Invalid Presence${presence_ipmi}
+ END
Test SDR Info