Modified a case of IPMI network
Modify test case "Get IP Address Source And Verify Using Redfish".
- Let user to specify Ethernet Interface name by channel number while
running, if not, the channel number default is 1.
- Use attribute "AddressOrigin" in Redfish to verify IP Address Source
rather than "DHCPEnabled".
Signed-off-by: Tony Lee <tony.lee@quantatw.com>
Change-Id: Ic5b5baca39af9fdb380c4abf4d5c016da8bb5233
diff --git a/ipmi/test_ipmi_network.robot b/ipmi/test_ipmi_network.robot
index e548813..dbbe581 100644
--- a/ipmi/test_ipmi_network.robot
+++ b/ipmi/test_ipmi_network.robot
@@ -104,9 +104,18 @@
[Documentation] Get IP address source and verify it using Redfish.
[Tags] Get_IP_Address_Source_And_Verify_Using_Redfish
- ${eth0}= Redfish.Get Properties /redfish/v1/Managers/bmc/EthernetInterfaces/eth0
- ${ip_address_source}= Set Variable If ${eth0['DHCPv4']['DHCPEnabled']} DHCP Static Address
- ${lan_config}= Get LAN Print Dict
+ ${active_channel_config}= Get Active Channel Config
+ ${lan_config}= Get LAN Print Dict ${CHANNEL_NUMBER}
+
+ ${ipv4_addresses}= Redfish.Get Attribute
+ ... /redfish/v1/Managers/bmc/EthernetInterfaces/${active_channel_config['${CHANNEL_NUMBER}']['name']} IPv4Addresses
+
+ FOR ${ipv4_address} IN @{ipv4_addresses}
+ ${ip_address_source}= Set Variable if '${ipv4_address['Address']}' == '${lan_config['IP Address']}'
+ ... ${ipv4_address['AddressOrigin']} Address
+ Exit For Loop IF "${ip_address_source}" != 'None'
+ END
+
Valid Value lan_config['IP Address Source'] [${ip_address_source}]