Redundance eth0/eth1 network interfaces changes
Changes:
- Introduce OPENBMC_HOST_ETH0 and OPENBMC_HOST_ETH1
- Assign OPENBMC_HOST_ETH0 default with OPENBMC_HOST
and OPENBMC_HOST_ETH1 with EMPTY
- Modify all the code which involves using both eth0
and eth1
- User will need to key in as
-v OPENBMC_HOST_ETH1:xx.xx.xx.xx
as oppose to earlier
-v OPENBMC_HOST_1:xx.xx.xx.xx
Tested:
- Sanity dry-run robot test with changes from sandbox
Change-Id: Iedeff2cfa252637bcf202979772ee1c5c90066b5
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/gui/gui_test/security_and_access_menu/test_multiple_interfaces.robot b/gui/gui_test/security_and_access_menu/test_multiple_interfaces.robot
index 43dad8b..35f1081 100644
--- a/gui/gui_test/security_and_access_menu/test_multiple_interfaces.robot
+++ b/gui/gui_test/security_and_access_menu/test_multiple_interfaces.robot
@@ -13,7 +13,7 @@
*** Variables ***
${bmc_url} https://${OPENBMC_HOST}:${HTTPS_PORT}
-${bmc_url_1} https://${OPENBMC_HOST_1}:${HTTPS_PORT}
+${bmc_url_1} https://${OPENBMC_HOST_ETH1}:${HTTPS_PORT}
${LDAP_FILE_PATH} ${EMPTY}
${CA_FILE_PATH} ${EMPTY}
@@ -56,11 +56,11 @@
Suite Setup Execution
[Documentation] Do suite setup task.
- Valid Value OPENBMC_HOST_1
+ Valid Value OPENBMC_HOST_ETH1
# Check both interfaces are configured and reachable.
Ping Host ${OPENBMC_HOST}
- Ping Host ${OPENBMC_HOST_1}
+ Ping Host ${OPENBMC_HOST_ETH1}
Load Certificates On BMC Via GUI
@@ -80,7 +80,7 @@
... ELSE IF '${certificate_type}' == 'Client' and '${delete_cert}' == '${True}'
... Delete Certificate Via BMC CLI ${certificate_type}
- Set Test Variable ${obmc_gui_url} https://${OPENBMC_HOST_1}:${HTTPS_PORT}
+ Set Test Variable ${obmc_gui_url} https://${OPENBMC_HOST_ETH1}:${HTTPS_PORT}
Launch Browser And Login GUI
Navigate To SSL Certificate Page
Sleep 10s
diff --git a/lib/resource.robot b/lib/resource.robot
index c12f52a..550774a 100755
--- a/lib/resource.robot
+++ b/lib/resource.robot
@@ -23,6 +23,12 @@
${DBUS_PREFIX} ${EMPTY}
${PORT} ${EMPTY}
+# BMC ethernet eth0 and eth1 for multiple interfaces.
+# By default eth0 is assigned with OPENBMC_HOST
+${OPENBMC_HOST_ETH0} ${OPENBMC_HOST}
+${OPENBMC_HOST_ETH1} ${EMPTY}
+
+
# AUTH_SUFFIX here is derived from variables.py
${AUTH_URI} https://${OPENBMC_HOST}${AUTH_SUFFIX}
${OPENBMC_USERNAME} root
diff --git a/network/test_bmc_dhcp_conf.robot b/network/test_bmc_dhcp_conf.robot
index 4a99697..808dded 100644
--- a/network/test_bmc_dhcp_conf.robot
+++ b/network/test_bmc_dhcp_conf.robot
@@ -58,12 +58,12 @@
[Documentation] Suite Setup Execution.
Ping Host ${OPENBMC_HOST}
- Ping Host ${OPENBMC_HOST_1}
+ Ping Host ${OPENBMC_HOST_ETH1}
Redfish.Login
${network_configurations}= Get Network Configuration Using Channel Number ${2}
FOR ${network_configuration} IN @{network_configurations}
- Run Keyword If '${network_configuration['Address']}' == '${OPENBMC_HOST_1}'
+ 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
@@ -111,7 +111,7 @@
[Documentation] Restore the configuration to Both Static Network
Run Keyword If '${CHANNEL_NUMBER}' == '1' Add IP Address ${OPENBMC_HOST} ${eth0_subnet_mask} ${eth0_gateway}
- ... ELSE IF '${CHANNEL_NUMBER}' == '2' Add IP Address ${OPENBMC_HOST_1} ${eth1_subnet_mask} ${eth1_gateway}
+ ... ELSE IF '${CHANNEL_NUMBER}' == '2' Add IP Address ${OPENBMC_HOST_ETH1} ${eth1_subnet_mask} ${eth1_gateway}
Verify Ethernet Config Property
[Documentation] verify ethernet config properties.
diff --git a/redfish/managers/test_multiple_interfaces.robot b/redfish/managers/test_multiple_interfaces.robot
index 3af3e1f..eebcf2f 100644
--- a/redfish/managers/test_multiple_interfaces.robot
+++ b/redfish/managers/test_multiple_interfaces.robot
@@ -2,11 +2,6 @@
Documentation Test BMC multiple network interface functionalities.
... Run on setup with both eth0 and eth1 in static mode.
-# User input BMC IP for the eth1.
-# Use can input as -v OPENBMC_HOST_1:xx.xxx.xx from command line.
-Library ../../lib/bmc_redfish.py https://${OPENBMC_HOST_1}:${HTTPS_PORT}
-... ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} WITH NAME Redfish1
-
Resource ../../lib/resource.robot
Resource ../../lib/common_utils.robot
Resource ../../lib/connection_client.robot
@@ -20,6 +15,11 @@
Library ../../lib/jobs_processing.py
Library OperatingSystem
+# User input BMC IP for the eth1.
+# Use can input as -v OPENBMC_HOST_ETH1:xx.xxx.xx from command line.
+Library ../../lib/bmc_redfish.py https://${OPENBMC_HOST_ETH1}:${HTTPS_PORT}
+... ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} WITH NAME Redfish1
+
Suite Setup Suite Setup Execution
Test Setup Run Keywords Redfish.Login AND Redfish1.Login
Test Teardown Run Keywords FFDC On Test Case Fail AND Redfish.Logout AND Redfish1.Logout
@@ -39,7 +39,7 @@
[Tags] Verify_Both_Interfaces_BMC_IP_Addresses_Accessible_Via_SSH
Open Connection And Log In ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} host=${OPENBMC_HOST}
- Open Connection And Log In ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} host=${OPENBMC_HOST_1}
+ Open Connection And Log In ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} host=${OPENBMC_HOST_ETH1}
Close All Connections
@@ -65,9 +65,9 @@
[Documentation] Verify LDAP login works when eth1 IP is erased.
[Tags] Verify_LDAP_Login_Works_When_Eth1_IP_Is_Not_Configured
[Setup] Run Keywords Set Test Variable ${CHANNEL_NUMBER} ${SECONDARY_CHANNEL_NUMBER}
- ... AND Redfish.Login AND Delete IP Address ${OPENBMC_HOST_1}
+ ... AND Redfish.Login AND Delete IP Address ${OPENBMC_HOST_ETH1}
[Teardown] Run Keywords Redfish.Logout AND Redfish.Login AND
- ... Add IP Address ${OPENBMC_HOST_1} ${eth1_subnet_mask} ${eth1_gateway}
+ ... Add IP Address ${OPENBMC_HOST_ETH1} ${eth1_subnet_mask} ${eth1_gateway}
Create LDAP Configuration
Redfish.Logout
@@ -101,8 +101,8 @@
[Tags] Verify_SNMP_Works_When_Eth1_IP_Is_Not_Configured
[Setup] Run Keywords Redfish.Login AND
... Set Test Variable ${CHANNEL_NUMBER} ${SECONDARY_CHANNEL_NUMBER}
- ... AND Delete IP Address ${OPENBMC_HOST_1}
- [Teardown] Add IP Address ${OPENBMC_HOST_1} ${eth1_subnet_mask} ${eth1_gateway}
+ ... AND Delete IP Address ${OPENBMC_HOST_ETH1}
+ [Teardown] Add IP Address ${OPENBMC_HOST_ETH1} ${eth1_subnet_mask} ${eth1_gateway}
Create Error On BMC And Verify Trap
@@ -139,16 +139,16 @@
[Tags] Able_To_Access_Serial_Console_Via_Both_Network_Interfaces
Open Connection And Log In host=${OPENBMC_HOST} port=2200
- Open Connection And Log In host=${OPENBMC_HOST_1} port=2200
+ Open Connection And Log In host=${OPENBMC_HOST_ETH1} port=2200
Close All Connections
Verify IPMI Works On Both Network Interfaces
[Documentation] Verify IPMI works on both network interfaces.
[Tags] Verify_IPMI_Works_On_Both_Network_Interfaces
- Run IPMI ${OPENBMC_HOST_1} power on
+ Run IPMI ${OPENBMC_HOST_ETH1} power on
${status1}= Run IPMI ${OPENBMC_HOST} power status
- ${status2}= Run IPMI ${OPENBMC_HOST_1} power status
+ ${status2}= Run IPMI ${OPENBMC_HOST_ETH1} power status
Should Be Equal ${status1} ${status2}
Verify Modifying IP Address Multiple Times On Interface
@@ -162,7 +162,7 @@
Update IP Address ${test_ipv4_addr} ${test_ipv4_addr2} ${test_subnet_mask} ${test_gateway}
Update IP Address ${test_ipv4_addr2} ${test_ipv4_addr} ${test_subnet_mask} ${test_gateway}
Run Keyword Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT}
- Run Keyword Wait For Host To Ping ${OPENBMC_HOST_1} ${NETWORK_TIMEOUT}
+ Run Keyword Wait For Host To Ping ${OPENBMC_HOST_ETH1} ${NETWORK_TIMEOUT}
Verify Able To Load Certificates Via Eth1 IP Address
[Documentation] Verify able to load certificates via eth1 IP address.
@@ -182,7 +182,7 @@
Verify SSH Protocol State Via Eth1 ${True}
# Check if SSH login and commands on SSH session work on both interfaces.
Verify SSH Login And Commands Work
- Verify SSH Login And Commands Work ${OPENBMC_HOST_1}
+ Verify SSH Login And Commands Work ${OPENBMC_HOST_ETH1}
Disable SSH Protocol Via Eth1 And Verify On Both Interfaces
[Documentation] Disable SSH protocol via eth1 and verify on both interfaces.
@@ -194,7 +194,7 @@
Verify SSH Protocol State Via Eth1 ${False}
# Check if SSH login and commands fail on eth1.
${status}= Run Keyword And Return Status
- ... Verify SSH Login And Commands Work ${OPENBMC_HOST_1}
+ ... Verify SSH Login And Commands Work ${OPENBMC_HOST_ETH1}
Should Be Equal As Strings ${status} False
... msg=SSH Login and commands are working after disabling SSH via eth1.
@@ -226,16 +226,16 @@
Suite Setup Execution
[Documentation] Do suite setup task.
- Valid Value OPENBMC_HOST_1
+ Valid Value OPENBMC_HOST_ETH1
# Check both interfaces are configured and reachable.
Ping Host ${OPENBMC_HOST}
- Ping Host ${OPENBMC_HOST_1}
+ Ping Host ${OPENBMC_HOST_ETH1}
${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_1}'
+ 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
@@ -298,7 +298,7 @@
Create Directory certificate_dir
# AUTH_URI is a global variable defined in lib/resource.robot
- Set Test Variable ${AUTH_URI} https://${OPENBMC_HOST_1}
+ Set Test Variable ${AUTH_URI} https://${OPENBMC_HOST_ETH1}
Run Keyword If '${cert_type}' == 'CA' and '${delete_cert}' == '${True}'
... Delete All CA Certificate Via Redfish
... ELSE IF '${cert_type}' == 'Client' and '${delete_cert}' == '${True}'
diff --git a/redfish/managers/test_multiple_interfaces_dhcp.robot b/redfish/managers/test_multiple_interfaces_dhcp.robot
index 479f5a7..b617405 100644
--- a/redfish/managers/test_multiple_interfaces_dhcp.robot
+++ b/redfish/managers/test_multiple_interfaces_dhcp.robot
@@ -208,7 +208,7 @@
[Documentation] Restore the configuration to Both Static Network
Run Keyword If '${CHANNEL_NUMBER}' == '${1}' Add IP Address ${OPENBMC_HOST} ${eth0_subnet_mask} ${eth0_gateway}
- ... ELSE IF '${CHANNEL_NUMBER}' == '{2}' Add IP Address ${OPENBMC_HOST_1} ${eth1_subnet_mask} ${eth1_gateway}
+ ... ELSE IF '${CHANNEL_NUMBER}' == '{2}' Add IP Address ${OPENBMC_HOST_ETH1} ${eth1_subnet_mask} ${eth1_gateway}
Get Network Configuration Using Channel Number
[Documentation] Get ethernet interface.
@@ -233,7 +233,7 @@
# 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_1}'
+ 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