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