Verify access BMC with both interfaces IP addresses via Redfish
Change-Id: Ia5411a83e83c08696bde85f9ff7237079d7b91b5
Signed-off-by: Anves Kumar rayankula <anvesr77@in.ibm.com>
diff --git a/lib/bmc_network_utils.robot b/lib/bmc_network_utils.robot
index e95c11c..56f1749 100644
--- a/lib/bmc_network_utils.robot
+++ b/lib/bmc_network_utils.robot
@@ -639,3 +639,17 @@
@{default_gw}= Split String ${gateway_list[0]}
[Return] ${default_gw[2]}
+
+
+Validate Hostname On BMC
+ [Documentation] Verify that the hostname read via Redfish is the same as the
+ ... hostname configured on system.
+ [Arguments] ${hostname}
+
+ # Description of argument(s):
+ # hostname A hostname value which is to be compared to the hostname
+ # configured on system.
+
+ ${sys_hostname}= Get BMC Hostname
+ Should Be Equal ${sys_hostname} ${hostname}
+ ... ignore_case=True msg=Hostname does not exist.
diff --git a/redfish/managers/test_bmc_network_conf.robot b/redfish/managers/test_bmc_network_conf.robot
index 0c57093..7441507 100644
--- a/redfish/managers/test_bmc_network_conf.robot
+++ b/redfish/managers/test_bmc_network_conf.robot
@@ -667,19 +667,6 @@
Should Contain ${ip_data} ${ip_with_netmask}
... msg=IP and netmask pair does not exist.
-Validate Hostname On BMC
- [Documentation] Verify that the hostname read via Redfish is the same as the
- ... hostname configured on system.
- [Arguments] ${hostname}
-
- # Description of argument(s):
- # hostname A hostname value which is to be compared to the hostname
- # configured on system.
-
- ${sys_hostname}= Get BMC Hostname
- Should Be Equal ${sys_hostname} ${hostname}
- ... ignore_case=True msg=Hostname does not exist.
-
Test Teardown Execution
[Documentation] Test teardown execution.
diff --git a/redfish/managers/test_multiple_interfaces.robot b/redfish/managers/test_multiple_interfaces.robot
index 145a48f..4a0a4b2 100644
--- a/redfish/managers/test_multiple_interfaces.robot
+++ b/redfish/managers/test_multiple_interfaces.robot
@@ -27,6 +27,26 @@
Close All Connections
+Verify Redfish Works On Both Interfaces
+ [Documentation] Verify access BMC with both interfaces (eth0, eth1) IP addresses via Redfish.
+ [Tags] Verify_Redfish_Works_On_Both_Interfaces
+ [Teardown] Run Keywords
+ ... Configure Hostname ${hostname} AND Validate Hostname On BMC ${hostname}
+
+ Redfish1.Login
+ Redfish.Login
+
+ ${hostname}= Redfish.Get Attribute ${REDFISH_NW_PROTOCOL_URI} HostName
+ ${data}= Create Dictionary HostName=openbmc
+ Redfish1.patch ${REDFISH_NW_ETH_IFACE}eth1 body=&{data}
+ ... valid_status_codes=[${HTTP_OK}, ${HTTP_NO_CONTENT}]
+
+ Validate Hostname On BMC openbmc
+
+ ${resp1}= Redfish.Get ${REDFISH_NW_ETH_IFACE}eth0
+ ${resp2}= Redfish1.Get ${REDFISH_NW_ETH_IFACE}eth1
+ Should Be Equal ${resp1.dict['HostName']} ${resp2.dict['HostName']}
+
*** Keywords ***
Get Network Configuration Using Channel Number