Fix BMC network config test suite
Changes:
- Modified suite setup execution Keyword.
Tested:
- Executed in BMC environment.
Resolves openbmc/openbmc-test-automation#2233
Change-Id: Ib12a459328f86b909b2797809589d980c441d9f1
Signed-off-by: Anvesh-Kumar_Rayankula <anvesh.kumar.rayankula@ibm.com>
diff --git a/redfish/managers/test_bmc_network_conf.robot b/redfish/managers/test_bmc_network_conf.robot
index a5301d5..f389a35 100644
--- a/redfish/managers/test_bmc_network_conf.robot
+++ b/redfish/managers/test_bmc_network_conf.robot
@@ -791,14 +791,14 @@
# - And set the same as static IP address
Redfish.Login
- ${DHCPEnabled}= Get IPv4 DHCP Enabled Status ${1}
+ ${DHCPEnabled}= Get IPv4 DHCP Enabled Status ${CHANNEL_NUMBER}
Set Suite Variable ${DHCPEnabled}
+ ${ip_addr} ${gateway} ${subnetmask}= Run Keyword If ${DHCPEnabled}==True
+ ... Get DHCP IP Info
+
Run Keyword If ${DHCPEnabled}==True
- ... Run Keywords
- ... ${ip_addr} ${gateway} ${subnetmask}= Get DHCP IP Info AND
- ... Add IP Address ${ip_addr} ${subnetmask} ${gateway} AND
- ... Set Suite Variable ${ip_addr}
+ ... Add IP Address ${ip_addr} ${subnetmask} ${gateway}
${test_gateway}= Get BMC Default Gateway
Set Suite Variable ${test_gateway}
@@ -810,6 +810,7 @@
# - If the DHCP IPv4 is enabled before suite setup execution
# - Restore the DHCP IPv4 to enabled state
+ Redfish.Login
Run Keyword If ${DHCPEnabled}==True
... Enable IPv4 DHCP Settings