Update MACAddress to find dynamically for validation
Changes:
- Get active eth channel name and get the redfish eth path
for MACAddress and validate.
Change-Id: I83ad306cb32a23e6254e97ba8a84ed4e8b3dc957
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/redfish/managers/test_managers_bmc.robot b/redfish/managers/test_managers_bmc.robot
index efe8371..a15ed50 100644
--- a/redfish/managers/test_managers_bmc.robot
+++ b/redfish/managers/test_managers_bmc.robot
@@ -62,7 +62,35 @@
[Documentation] Verify BMC managers resource properties.
[Tags] Verify_MAC_Address_Property_Is_Populated
- ${redfish_mac_addr}= Redfish.Get Attribute /redfish/v1/Managers/bmc/EthernetInterfaces/eth0 MACAddress
+ # Get OrderedDict from the BMC which contains active ethernet channel.
+ # Example: ([('1', {'name': 'eth0',
+ # 'is_valid': True,
+ # 'active_sessions': 0,
+ # 'channel_info': {'medium_type': 'lan-802.3',
+ # 'protocol_type': 'ipmb-1.0',
+ # 'session_supported': 'multi-session',
+ # 'is_ipmi': True
+ # }
+ # }
+ # )])
+
+ ${active_channel_config}= Get Active Channel Config
+
+ FOR ${channel_number} IN @{active_channel_config.keys()}
+ Log Dictionary ${active_channel_config["${channel_number}"]}
+
+ # Get ethernet valid paths in redfish.
+ # Example: ['/redfish/v1/Managers/bmc/EthernetInterfaces']
+ ${eth_interface}= redfish_utils.Get Endpoint Path List
+ ... /redfish/v1/Managers/ EthernetInterfaces
+
+ # Get the MACAddress attrivute value with the 'name': 'eth0'.
+ # Example: /redfish/v1/Managers/bmc/EthernetInterfaces/eth0
+ ${redfish_mac_addr}= Redfish.Get Attribute
+ ... ${eth_interface[0]}/${active_channel_config["${channel_number}"]["name"]}
+ ... MACAddress
+ END
+
Rprint Vars redfish_mac_addr fmt=terse
Valid Value redfish_mac_addr