shrsuman123 | 4f0bcbe | 2021-08-31 04:05:57 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
| 3 | Documentation VMI multiple network interface tests. |
| 4 | |
| 5 | # This includes test scenarios where VMI has multiple interfaces. |
| 6 | # So,assigns and verifies the combination of network mode in interfaces. |
| 7 | |
| 8 | Resource ../../lib/external_intf/vmi_utils.robot |
| 9 | |
| 10 | Suite Setup Suite Setup Execution |
George Keishing | 4e0978d | 2022-07-27 10:21:18 -0500 | [diff] [blame] | 11 | Suite Teardown Run Keyword And Ignore Error Suite Teardown Execution |
shrsuman123 | 4f0bcbe | 2021-08-31 04:05:57 -0500 | [diff] [blame] | 12 | |
Matt Fischer | 6fb70d9 | 2023-10-24 19:06:33 -0600 | [diff] [blame^] | 13 | Test Tags Vmi_Multiple_Interfaces |
George Keishing | 725e066 | 2022-07-20 22:18:14 -0500 | [diff] [blame] | 14 | |
shrsuman123 | 4f0bcbe | 2021-08-31 04:05:57 -0500 | [diff] [blame] | 15 | *** Variables *** |
| 16 | |
| 17 | ${test_ipv4_1} 10.6.6.6 |
| 18 | ${test_gateway_1} 10.6.6.1 |
| 19 | ${test_netmask_1} 255.255.252.0 |
| 20 | |
| 21 | ${test_ipv4_2} 10.5.20.5 |
| 22 | ${test_gateway_2} 10.5.20.1 |
| 23 | ${test_netmask_2} 255.255.255.0 |
| 24 | ${test_ipv4_3} 10.6.4.6 |
| 25 | |
| 26 | *** Test Cases *** |
| 27 | |
| 28 | Configure VMI Both Interfaces In Same Subnet And Verify |
| 29 | [Documentation] Configure VMI both interfaces in same subnet and verify. |
| 30 | [Tags] Configure_VMI_Both_Interfaces_In_Same_Subnet_And_Verify |
| 31 | [Teardown] Test Teardown Execution |
| 32 | |
| 33 | Set Static IPv4 Address To VMI And Verify ${test_ipv4_1} ${test_gateway_1} |
| 34 | ... ${test_netmask_1} |
| 35 | Set Static IPv4 Address To VMI And Verify ${test_ipv4_3} ${test_gateway_1} |
| 36 | ... ${test_netmask_1} ${HTTP_ACCEPTED} ${interface_list}[1] |
| 37 | |
| 38 | Configure VMI Both Interfaces In Different Subnet And Verify |
| 39 | [Documentation] Configure VMI both interfaces in different subnet and verify. |
| 40 | [Tags] Configure_VMI_Both_Interfaces_In_Different_Subnet_And_Verify |
| 41 | [Teardown] Test Teardown Execution |
| 42 | |
| 43 | Set Static IPv4 Address To VMI And Verify ${test_ipv4_1} ${test_gateway_1} |
| 44 | ... ${test_netmask_1} |
| 45 | Set Static IPv4 Address To VMI And Verify ${test_ipv4_2} ${test_gateway_2} |
| 46 | ... ${test_netmask_2} ${HTTP_ACCEPTED} ${interface_list}[1] |
| 47 | |
shrsuman123 | 445eccc | 2021-10-12 04:10:05 -0500 | [diff] [blame] | 48 | Configure VMI Both Interfaces In Dynamic And Verify |
| 49 | [Documentation] Configure VMI both interfaces in dynamic And Verify. |
| 50 | [Tags] Configure_VMI_Both_Interfaces_In_Dynamic_And_Verify |
| 51 | [Teardown] Run keywords Set VMI IPv4 Origin ${False} |
| 52 | ... AND Set VMI IPv4 Origin ${False} ${HTTP_ACCEPTED} ${interface_list}[1] |
Megha G N | 0f15125 | 2024-04-16 02:27:07 -0500 | [diff] [blame] | 53 | ... AND Test Teardown Execution |
shrsuman123 | 445eccc | 2021-10-12 04:10:05 -0500 | [diff] [blame] | 54 | |
| 55 | Set VMI IPv4 Origin ${True} |
| 56 | ${default}= Set Variable 0.0.0.0 |
| 57 | Set VMI IPv4 Origin ${True} ${HTTP_ACCEPTED} ${interface_list}[1] |
| 58 | Verify VMI Network Interface Details ${default} DHCP ${default} ${default} |
| 59 | Verify VMI Network Interface Details ${default} DHCP ${default} ${default} ${interface_list}[1] |
| 60 | |
shrsuman123 | 7e9b212 | 2021-09-28 06:06:16 -0500 | [diff] [blame] | 61 | Configure VMI First Interface In Static And Second In Dynamic And Verify |
| 62 | [Documentation] Configure VMI first interface in static mode and second interface in dynamic mode |
| 63 | ... and verify first gets static ip details and second gets dynamic ip details. |
| 64 | [Tags] Configure_VMI_First_Interface_In_Static_And_Second_In_Dynamic_And_Verify |
| 65 | [Teardown] Run keywords Delete VMI IPv4 Address AND |
| 66 | ... Set VMI IPv4 Origin ${False} ${HTTP_ACCEPTED} ${interface_list}[1] |
Megha G N | 0f15125 | 2024-04-16 02:27:07 -0500 | [diff] [blame] | 67 | ... AND Test Teardown Execution |
shrsuman123 | 7e9b212 | 2021-09-28 06:06:16 -0500 | [diff] [blame] | 68 | |
| 69 | Set Static IPv4 Address To VMI And Verify ${test_ipv4_1} ${test_gateway_1} |
| 70 | ... ${test_netmask_1} |
| 71 | Set VMI IPv4 Origin ${True} ${HTTP_ACCEPTED} ${interface_list}[1] |
| 72 | ${default}= Set Variable 0.0.0.0 |
| 73 | Verify VMI Network Interface Details ${test_ipv4_1} Static ${test_gateway_1} ${test_netmask_1} |
| 74 | Verify VMI Network Interface Details ${default} DHCP ${default} ${default} ${interface_list}[1] |
| 75 | |
| 76 | Configure VMI First Interface In Dynamic And Second In Static And Verify |
| 77 | [Documentation] Configure VMI first interface in dynamic mode and second interface in static mode |
| 78 | ... and verify first gets dynamic ip details and second gets static ip details. |
| 79 | [Tags] Configure_VMI_First_Interface_In_Dynamic_And_Second_In_Static_And_Verify |
| 80 | [Teardown] Run keywords Set VMI IPv4 Origin ${False} AND |
| 81 | ... Delete VMI IPv4 Address IPv4StaticAddresses ${HTTP_ACCEPTED} ${interface_list}[1] |
Megha G N | 0f15125 | 2024-04-16 02:27:07 -0500 | [diff] [blame] | 82 | ... AND Test Teardown Execution |
shrsuman123 | 7e9b212 | 2021-09-28 06:06:16 -0500 | [diff] [blame] | 83 | |
| 84 | Set VMI IPv4 Origin ${True} |
| 85 | ${default}= Set Variable 0.0.0.0 |
| 86 | Set Static IPv4 Address To VMI And Verify ${test_ipv4_1} ${test_gateway_1} |
| 87 | ... ${test_netmask_1} ${HTTP_ACCEPTED} ${interface_list}[1] |
| 88 | Verify VMI Network Interface Details ${default} DHCP ${default} ${default} |
| 89 | |
shrsuman123 | 4f0bcbe | 2021-08-31 04:05:57 -0500 | [diff] [blame] | 90 | *** Keywords *** |
| 91 | |
| 92 | Suite Setup Execution |
| 93 | [Documentation] Do suite setup execution task. |
| 94 | |
| 95 | Redfish.Login |
| 96 | Redfish Power On stack_mode=skip quiet=1 |
| 97 | Get Original Vmi Details |
| 98 | |
| 99 | |
| 100 | Test Teardown Execution |
| 101 | [Documentation] Do test teardown execution task. |
| 102 | |
| 103 | FOR ${interface} IN @{interface_list} |
| 104 | Delete VMI IPv4 Address IPv4StaticAddresses ${HTTP_ACCEPTED} ${interface} |
| 105 | END |
| 106 | |
| 107 | FFDC On Test Case Fail |
| 108 | |
| 109 | |
| 110 | Get Original Vmi Details |
| 111 | [Documentation] Get original details of VMI. |
| 112 | |
| 113 | @{interface_list}= Get VMI Interfaces |
| 114 | Set Suite Variable @{interface_list} |
| 115 | |
| 116 | FOR ${interface} IN @{interface_list} |
| 117 | ${resp}= Redfish.Get |
| 118 | ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${interface} |
| 119 | ${ip_resp}= Evaluate json.loads(r'''${resp.text}''') json |
| 120 | ${length}= Get Length ${ip_resp["IPv4StaticAddresses"]} |
| 121 | ${vmi_network_conf}= Catenate SEPARATOR=_ vmi_network_conf ${interface} |
| 122 | ${vmi_network_conf_value}= Run Keyword If ${length} != ${0} |
| 123 | ... Get VMI Network Interface Details ${interface} |
| 124 | Set Suite Variable ${${vmi_network_conf}} ${vmi_network_conf_value} |
| 125 | END |
| 126 | |
| 127 | |
| 128 | Suite Teardown Execution |
| 129 | [Documentation] Do suite teardown execution task |
| 130 | ... Set original vmi details and verify. |
| 131 | |
| 132 | FOR ${interface} IN @{interface_list} |
| 133 | Run Keyword If ${vmi_network_conf_${interface}} != ${None} |
| 134 | ... Set Static IPv4 Address To VMI And Verify |
| 135 | ... ${vmi_network_conf_${interface}}[IPv4_Address] |
| 136 | ... ${vmi_network_conf_${interface}}[IPv4_Gateway] |
| 137 | ... ${vmi_network_conf_${interface}}[IPv4_SubnetMask] |
| 138 | ... ${HTTP_ACCEPTED} ${interface} |
| 139 | END |
| 140 | |
| 141 | Redfish.Logout |
| 142 | |