Fix for deprecated Exit For Loop keyword
Changes:
- Exit For Loop If is deprecated since
Robot Framework version 5.*, use IF and BREAK instead
Tested:
- Checked using robot dry-run to make sure the
syntax is not broken
Change-Id: Ib12fecbc996ba14f4cabd7677f85a90fa3f2b39b
Signed-off-by: Sridevi Ramesh <sridevra@in.ibm.com>
diff --git a/redfish/managers/test_bmc_dumps.robot b/redfish/managers/test_bmc_dumps.robot
index a080e14..d4f92a6 100644
--- a/redfish/managers/test_bmc_dumps.robot
+++ b/redfish/managers/test_bmc_dumps.robot
@@ -251,7 +251,7 @@
FOR ${n} IN RANGE 0 ${MAX_DUMP_COUNT}
Create User Initiated BMC Dump Via Redfish
${dump_space}= Get Disk Usage For Dumps
- Exit For Loop If ${dump_space} >= (${BMC_DUMP_TOTAL_SIZE} - ${BMC_DUMP_MIN_SPACE_REQD})
+ IF ${dump_space} >= (${BMC_DUMP_TOTAL_SIZE} - ${BMC_DUMP_MIN_SPACE_REQD}) BREAK
END
# Check error while creating dump when dump size is full.
diff --git a/redfish/managers/test_bmc_network_conf.robot b/redfish/managers/test_bmc_network_conf.robot
index 653e88a..ec4854f 100644
--- a/redfish/managers/test_bmc_network_conf.robot
+++ b/redfish/managers/test_bmc_network_conf.robot
@@ -834,7 +834,7 @@
FOR ${network_configuration} IN @{network_configurations}
${ip_found}= Set Variable If '${network_configuration['Address']}' == '${ip_address}' ${True}
... ${False}
- Exit For Loop If ${ip_found}
+ IF ${ip_found} BREAK
END
Run Keyword If '${ip_found}' == '${False}'
... Fail msg=Configured IP address not found on EthernetInterface URI.
diff --git a/redfish/managers/test_multiple_interfaces.robot b/redfish/managers/test_multiple_interfaces.robot
index 6643654..9ac6a17 100644
--- a/redfish/managers/test_multiple_interfaces.robot
+++ b/redfish/managers/test_multiple_interfaces.robot
@@ -235,10 +235,11 @@
${network_configurations}= Get Network Configuration Using Channel Number ${SECONDARY_CHANNEL_NUMBER}
FOR ${network_configuration} IN @{network_configurations}
- Run Keyword If '${network_configuration['Address']}' == '${OPENBMC_HOST_ETH1}'
- ... Run Keywords Set Suite Variable ${eth1_subnet_mask} ${network_configuration['SubnetMask']}
- ... AND Set Suite Variable ${eth1_gateway} ${network_configuration['Gateway']}
- ... AND Exit For Loop
+ IF '${network_configuration['Address']}' == '${OPENBMC_HOST_ETH1}'
+ Set Suite Variable ${eth1_subnet_mask} ${network_configuration['SubnetMask']}
+ Set Suite Variable ${eth1_gateway} ${network_configuration['Gateway']}
+ BREAK
+ END
END
diff --git a/redfish/managers/test_multiple_interfaces_dhcp.robot b/redfish/managers/test_multiple_interfaces_dhcp.robot
index 632291b..7e3c610 100644
--- a/redfish/managers/test_multiple_interfaces_dhcp.robot
+++ b/redfish/managers/test_multiple_interfaces_dhcp.robot
@@ -233,17 +233,19 @@
# Get the configuration of eth1
${network_configurations}= Get Network Configuration Using Channel Number ${2}
FOR ${network_configuration} IN @{network_configurations}
- Run Keyword If '${network_configuration['Address']}' == '${OPENBMC_HOST_ETH1}'
- ... Run Keywords Set Suite Variable ${eth1_subnet_mask} ${network_configuration['SubnetMask']}
- ... AND Set Suite Variable ${eth1_gateway} ${network_configuration['Gateway']}
- ... AND Exit For Loop
+ IF '${network_configuration['Address']}' == '${OPENBMC_HOST_ETH1}'
+ Set Suite Variable ${eth1_subnet_mask} ${network_configuration['SubnetMask']}
+ Set Suite Variable ${eth1_gateway} ${network_configuration['Gateway']}
+ BREAK
+ END
END
# Get the configuration of eth0
${network_configurations}= Get Network Configuration Using Channel Number ${1}
FOR ${network_configuration} IN @{network_configurations}
- Run Keyword If '${network_configuration['Address']}' == '${OPENBMC_HOST}'
- ... Run Keywords Set Suite Variable ${eth0_subnet_mask} ${network_configuration['SubnetMask']}
- ... AND Set Suite Variable ${eth0_gateway} ${network_configuration['Gateway']}
- ... AND Exit For Loop
+ IF '${network_configuration['Address']}' == '${OPENBMC_HOST}'
+ Set Suite Variable ${eth0_subnet_mask} ${network_configuration['SubnetMask']}
+ Set Suite Variable ${eth0_gateway} ${network_configuration['Gateway']}
+ BREAK
+ END
END
diff --git a/redfish/systems/eventlog/test_event_logging.robot b/redfish/systems/eventlog/test_event_logging.robot
index 1fc75a6..b082ae3 100644
--- a/redfish/systems/eventlog/test_event_logging.robot
+++ b/redfish/systems/eventlog/test_event_logging.robot
@@ -448,7 +448,7 @@
FOR ${entry} IN @{elog_list}
${found_match}= Run Keyword And Return Status Is Watchdog Error Found ${entry}
- Exit For Loop If '${found_match}' == 'True'
+ IF '${found_match}' == 'True' BREAK
END
Run Keyword If '${found_match}' == 'False' Fail msg=No watchdog error logged.
diff --git a/redfish/telemetry_service/test_telemetry_report.robot b/redfish/telemetry_service/test_telemetry_report.robot
index 7a18482..b5e2d17 100644
--- a/redfish/telemetry_service/test_telemetry_report.robot
+++ b/redfish/telemetry_service/test_telemetry_report.robot
@@ -108,7 +108,7 @@
${regex_matching_output}= Get Regexp Matches ${item} ${value}
IF ${regex_matching_output} != []
Set To Dictionary ${english_actual_teleDef} ${key}=${regex_matching_output}[0]
- Exit For Loop
+ BREAK
END
END
diff --git a/redfish/update_service/test_firmware_inventory.robot b/redfish/update_service/test_firmware_inventory.robot
index e1d3632..001c2cb 100644
--- a/redfish/update_service/test_firmware_inventory.robot
+++ b/redfish/update_service/test_firmware_inventory.robot
@@ -104,8 +104,8 @@
# 3rd comparison of BMC version and verify FirmwareInventory bmc version.
# Example:
# "Version": 2.7.0-dev-19-g9b44ea7
- Exit For Loop If '${resp_resource.dict["Version"]}' == '${manager_bmc_version.strip('"')}'
- Run Keyword If '${entry}' == '${actual_count}' Fail BMC version not there in Firmware Inventory
+ IF '${resp_resource.dict["Version"]}' == '${manager_bmc_version.strip('"')}' BREAK
+ IF '${entry}' == '${actual_count}' Fail BMC version not there in Firmware Inventory
END
diff --git a/systest/htx_softbootme_test.robot b/systest/htx_softbootme_test.robot
index 0ddc205..974c6df 100644
--- a/systest/htx_softbootme_test.robot
+++ b/systest/htx_softbootme_test.robot
@@ -74,8 +74,9 @@
${runtime}= Convert Time ${boot_interval}
${startTime} = Get Current Date
- Run Keyword If '${HTX_MDT_PROFILE}' == 'mdt.bu'
- ... Create Default MDT Profile
+ IF '${HTX_MDT_PROFILE}' == 'mdt.bu'
+ Create Default MDT Profile
+ END
Run MDT Profile
@@ -92,10 +93,10 @@
Run Key U Sleep \ 30s
${l_ping}=
... Run Keyword And Return Status Ping Host ${OS_HOST}
- Exit For Loop If '${l_ping}' == '${True}'
+ IF '${l_ping}' == '${True}' BREAK
END
- Run Keyword If '${l_ping}' == '${False}' Fail msg=OS not pinging in 20 minutes
+ IF '${l_ping}' == '${False}' Fail msg=OS not pinging in 20 minutes
Wait Until Keyword Succeeds
... 2 min 30 sec Verify Ping SSH And Redfish Authentication
@@ -116,7 +117,7 @@
${elapsedTimeSec} =
... Subtract Date From Date
... ${currentTime} ${startTime} result_format=number exclude_millis=True
- Exit For Loop If ${runtime} < ${elapsedTimeSec}
+ IF ${runtime} < ${elapsedTimeSec} BREAK
END
Wait Until Keyword Succeeds
@@ -126,9 +127,9 @@
... 2 min 60 sec Shutdown Bootme
# If user needs to keep the HTX running to debug on failure or post processing.
- Run Keyword If ${HTX_KEEP_RUNNING} == ${0}
- ... Wait Until Keyword Succeeds
- ... 2 min 60 sec Shutdown HTX Exerciser
+ IF ${HTX_KEEP_RUNNING} == ${0}
+ Wait Until Keyword Succeeds 2 min 60 sec Shutdown HTX Exerciser
+ END
Test Setup Execution
@@ -159,18 +160,18 @@
# Shutdown if HTX is running.
${status}= Is HTX Running
- Run Keyword If '${status}' == 'True'
- ... Wait Until Keyword Succeeds
- ... 2 min 60 sec Shutdown HTX Exerciser
+ IF '${status}' == 'True'
+ Wait Until Keyword Succeeds 2 min 60 sec Shutdown HTX Exerciser
+ END
+
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}
- ... Wait Until Keyword Succeeds
- ... 2 min 60 sec Shutdown HTX Exerciser
+ IF '${TEST_STATUS}' == 'FAIL' and ${HTX_KEEP_RUNNING} == ${0}
+ Wait Until Keyword Succeeds 2 min 60 sec Shutdown HTX Exerciser
+ END
${keyword_buf}= Catenate Stop SOL Console Logging
... \ targ_file_path=${EXECDIR}${/}logs${/}SOL.log