Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Network interface configuration and verification |
| 3 | ... tests. |
| 4 | |
George Keishing | 5d46755 | 2019-02-08 23:30:48 -0600 | [diff] [blame] | 5 | Resource ../../lib/bmc_redfish_resource.robot |
| 6 | Resource ../../lib/bmc_network_utils.robot |
| 7 | Resource ../../lib/openbmc_ffdc.robot |
Prashanth Katti | 747ce9d | 2019-02-07 07:23:48 -0600 | [diff] [blame] | 8 | Library ../../lib/bmc_network_utils.py |
Vijay | de3bf7b | 2019-04-16 04:56:09 -0500 | [diff] [blame] | 9 | Library Collections |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 10 | |
aravinth0510 | ca054ee | 2022-06-16 13:26:15 +0000 | [diff] [blame] | 11 | Suite Setup Suite Setup Execution |
| 12 | Suite Teardown Suite Teardown Execution |
| 13 | Test Setup Test Setup Execution |
| 14 | Test Teardown Test Teardown Execution |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 15 | |
Matt Fischer | 6fb70d9 | 2023-10-24 19:06:33 -0600 | [diff] [blame] | 16 | Test Tags Bmc_Network_Conf |
Prashanth Katti | f34fafa | 2019-06-20 05:04:40 -0500 | [diff] [blame] | 17 | |
Prashanth Katti | 23efc6e | 2019-03-13 06:07:15 -0500 | [diff] [blame] | 18 | *** Variables *** |
Vijay | de3bf7b | 2019-04-16 04:56:09 -0500 | [diff] [blame] | 19 | ${test_hostname} openbmc |
| 20 | ${test_ipv4_addr} 10.7.7.7 |
| 21 | ${test_ipv4_invalid_addr} 0.0.1.a |
| 22 | ${test_subnet_mask} 255.255.0.0 |
Prashanth Katti | b36a752 | 2019-05-22 05:32:39 -0500 | [diff] [blame] | 23 | ${broadcast_ip} 10.7.7.255 |
| 24 | ${loopback_ip} 127.0.0.2 |
| 25 | ${multicast_ip} 224.6.6.6 |
| 26 | ${out_of_range_ip} 10.7.7.256 |
Prashanth Katti | 568df5f | 2020-05-15 06:00:37 -0500 | [diff] [blame] | 27 | ${test_ipv4_addr2} 10.7.7.8 |
Prashanth Katti | 23efc6e | 2019-03-13 06:07:15 -0500 | [diff] [blame] | 28 | |
George Keishing | 16b3c7b | 2021-01-28 09:23:37 -0600 | [diff] [blame] | 29 | # Valid netmask is 4 bytes long and has continuous block of 1s. |
Prashanth Katti | 040c8c1 | 2019-05-31 04:42:05 -0500 | [diff] [blame] | 30 | # Maximum valid value in each octet is 255 and least value is 0. |
| 31 | # 253 is not valid, as binary value is 11111101. |
| 32 | ${invalid_netmask} 255.255.253.0 |
| 33 | ${alpha_netmask} ff.ff.ff.ff |
| 34 | # Maximum value of octet in netmask is 255. |
| 35 | ${out_of_range_netmask} 255.256.255.0 |
| 36 | ${more_byte_netmask} 255.255.255.0.0 |
| 37 | ${less_byte_netmask} 255.255.255 |
Prashanth Katti | c6ad647 | 2019-06-14 03:33:39 -0500 | [diff] [blame] | 38 | ${threshold_netmask} 255.255.255.255 |
| 39 | ${lowest_netmask} 128.0.0.0 |
| 40 | |
| 41 | # There will be 4 octets in IP address (e.g. xx.xx.xx.xx) |
| 42 | # but trying to configure xx.xx.xx |
| 43 | ${less_octet_ip} 10.3.36 |
| 44 | |
| 45 | # For the address 10.6.6.6, the 10.6.6.0 portion describes the |
| 46 | # network ID and the 6 describe the host. |
| 47 | |
| 48 | ${network_id} 10.7.7.0 |
| 49 | ${hex_ip} 0xa.0xb.0xc.0xd |
| 50 | ${negative_ip} 10.-7.-7.7 |
Prashanth Katti | 7098c97 | 2019-07-03 06:56:42 -0500 | [diff] [blame] | 51 | @{static_name_servers} 10.5.5.5 |
Prashanth Katti | 3c7b643 | 2019-07-26 06:53:37 -0500 | [diff] [blame] | 52 | @{null_value} null |
Prashanth Katti | afe16b7 | 2019-08-02 00:29:45 -0500 | [diff] [blame] | 53 | @{empty_dictionary} {} |
| 54 | @{string_value} aa.bb.cc.dd |
| 55 | |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 56 | *** Test Cases *** |
| 57 | |
| 58 | Get IP Address And Verify |
| 59 | [Documentation] Get IP Address And Verify. |
George Keishing | 5d46755 | 2019-02-08 23:30:48 -0600 | [diff] [blame] | 60 | [Tags] Get_IP_Address_And_Verify |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 61 | |
Sushil Singh | 5062114 | 2020-06-16 11:12:21 -0500 | [diff] [blame] | 62 | FOR ${network_configuration} IN @{network_configurations} |
| 63 | Verify IP On BMC ${network_configuration['Address']} |
| 64 | END |
Prashanth Katti | 747ce9d | 2019-02-07 07:23:48 -0600 | [diff] [blame] | 65 | |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 66 | Get Netmask And Verify |
| 67 | [Documentation] Get Netmask And Verify. |
George Keishing | 5d46755 | 2019-02-08 23:30:48 -0600 | [diff] [blame] | 68 | [Tags] Get_Netmask_And_Verify |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 69 | |
Sushil Singh | 5062114 | 2020-06-16 11:12:21 -0500 | [diff] [blame] | 70 | FOR ${network_configuration} IN @{network_configurations} |
| 71 | Verify Netmask On BMC ${network_configuration['SubnetMask']} |
| 72 | END |
Prashanth Katti | 747ce9d | 2019-02-07 07:23:48 -0600 | [diff] [blame] | 73 | |
Prashanth Katti | 2ec9d8b | 2019-02-12 05:20:19 -0600 | [diff] [blame] | 74 | Get Gateway And Verify |
| 75 | [Documentation] Get gateway and verify it's existence on the BMC. |
| 76 | [Tags] Get_Gateway_And_Verify |
| 77 | |
Sushil Singh | 5062114 | 2020-06-16 11:12:21 -0500 | [diff] [blame] | 78 | FOR ${network_configuration} IN @{network_configurations} |
| 79 | Verify Gateway On BMC ${network_configuration['Gateway']} |
| 80 | END |
Prashanth Katti | 2ec9d8b | 2019-02-12 05:20:19 -0600 | [diff] [blame] | 81 | |
| 82 | Get MAC Address And Verify |
| 83 | [Documentation] Get MAC address and verify it's existence on the BMC. |
| 84 | [Tags] Get_MAC_Address_And_Verify |
| 85 | |
Tony Lee | 412c668 | 2020-04-01 17:34:30 +0800 | [diff] [blame] | 86 | ${active_channel_config}= Get Active Channel Config |
| 87 | ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 88 | |
| 89 | ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface} |
Prashanth Katti | 2ec9d8b | 2019-02-12 05:20:19 -0600 | [diff] [blame] | 90 | ${macaddr}= Get From Dictionary ${resp.dict} MACAddress |
| 91 | Validate MAC On BMC ${macaddr} |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 92 | |
Prashanth Katti | 2c5c3bb | 2019-02-14 04:23:07 -0600 | [diff] [blame] | 93 | Verify All Configured IP And Netmask |
| 94 | [Documentation] Verify all configured IP and netmask on BMC. |
| 95 | [Tags] Verify_All_Configured_IP_And_Netmask |
| 96 | |
Sushil Singh | 5062114 | 2020-06-16 11:12:21 -0500 | [diff] [blame] | 97 | FOR ${network_configuration} IN @{network_configurations} |
| 98 | Verify IP And Netmask On BMC ${network_configuration['Address']} |
| 99 | ... ${network_configuration['SubnetMask']} |
| 100 | END |
Prashanth Katti | 2c5c3bb | 2019-02-14 04:23:07 -0600 | [diff] [blame] | 101 | |
Prashanth Katti | 23efc6e | 2019-03-13 06:07:15 -0500 | [diff] [blame] | 102 | Get Hostname And Verify |
| 103 | [Documentation] Get hostname via Redfish and verify. |
| 104 | [Tags] Get_Hostname_And_Verify |
| 105 | |
| 106 | ${hostname}= Redfish_Utils.Get Attribute ${REDFISH_NW_PROTOCOL_URI} HostName |
| 107 | |
| 108 | Validate Hostname On BMC ${hostname} |
| 109 | |
| 110 | Configure Hostname And Verify |
| 111 | [Documentation] Configure hostname via Redfish and verify. |
| 112 | [Tags] Configure_Hostname_And_Verify |
shrsuman123 | 578276c | 2020-08-04 04:28:58 -0500 | [diff] [blame] | 113 | [Teardown] Run Keywords |
| 114 | ... Configure Hostname ${hostname} AND Validate Hostname On BMC ${hostname} |
Prashanth Katti | 23efc6e | 2019-03-13 06:07:15 -0500 | [diff] [blame] | 115 | |
Prashanth Katti | adf0b4e | 2019-06-10 04:20:30 -0500 | [diff] [blame] | 116 | ${hostname}= Redfish_Utils.Get Attribute ${REDFISH_NW_PROTOCOL_URI} HostName |
Prashanth Katti | 23efc6e | 2019-03-13 06:07:15 -0500 | [diff] [blame] | 117 | |
Prashanth Katti | adf0b4e | 2019-06-10 04:20:30 -0500 | [diff] [blame] | 118 | Configure Hostname ${test_hostname} |
Prashanth Katti | 23efc6e | 2019-03-13 06:07:15 -0500 | [diff] [blame] | 119 | Validate Hostname On BMC ${test_hostname} |
| 120 | |
Sweta Potthuri | 645128a | 2024-05-21 11:12:33 -0500 | [diff] [blame] | 121 | # Verify configured hostname via Redfish. |
nagarjunb22 | 60784a4 | 2022-06-13 10:39:33 +0530 | [diff] [blame] | 122 | ${new_hostname}= Redfish_Utils.Get Attribute ${REDFISH_NW_PROTOCOL_URI} HostName |
| 123 | Should Be Equal ${new_hostname} ${test_hostname} |
| 124 | |
Anvesh-Kumar_Rayankula | cff1021 | 2024-01-04 00:15:54 -0600 | [diff] [blame] | 125 | Configure Invalid HostName And Verify |
Sweta Potthuri | 645128a | 2024-05-21 11:12:33 -0500 | [diff] [blame] | 126 | [Documentation] Configure invalid hostname via Redfish and verify. |
Anvesh-Kumar_Rayankula | cff1021 | 2024-01-04 00:15:54 -0600 | [diff] [blame] | 127 | [Tags] Configure_Invalid_HostName_And_Verify |
| 128 | [Template] Configure Hostname |
| 129 | |
| 130 | # hostname status_code |
| 131 | !#@ [${HTTP_BAD_REQUEST}] |
Sweta Potthuri | 645128a | 2024-05-21 11:12:33 -0500 | [diff] [blame] | 132 | |
| 133 | Configure Empty HostName And Verify If LocalHost Is Assigned |
| 134 | [Documentation] Configure empty hostname and verify if localHost is assigned. |
| 135 | [Tags] Configure_Empty_HostName_And_Verify_If_LocalHost_Is_Assigned |
| 136 | [Teardown] Run Keywords |
| 137 | ... Configure Hostname ${hostname} AND Validate Hostname On BMC ${hostname} |
| 138 | |
| 139 | ${hostname}= Redfish_Utils.Get Attribute ${REDFISH_NW_PROTOCOL_URI} HostName |
| 140 | |
| 141 | Configure Hostname ${EMPTY} |
| 142 | Validate Hostname On BMC localhost |
| 143 | |
| 144 | # Verify configured hostname via Redfish. |
| 145 | ${new_hostname}= Redfish_Utils.Get Attribute ${REDFISH_NW_PROTOCOL_URI} HostName |
| 146 | Should Be Equal ${new_hostname} localhost |
Prashanth Katti | adf0b4e | 2019-06-10 04:20:30 -0500 | [diff] [blame] | 147 | |
Vijay | de3bf7b | 2019-04-16 04:56:09 -0500 | [diff] [blame] | 148 | Add Valid IPv4 Address And Verify |
| 149 | [Documentation] Add IPv4 Address via Redfish and verify. |
George Keishing | 0c8100f | 2022-01-13 00:24:57 -0600 | [diff] [blame] | 150 | [Tags] Add_Valid_IPv4_Address_And_Verify |
Anvesh Kumar | 9c7238d | 2020-04-21 03:56:21 -0500 | [diff] [blame] | 151 | [Teardown] Run Keywords |
| 152 | ... Delete IP Address ${test_ipv4_addr} AND Test Teardown Execution |
Vijay | de3bf7b | 2019-04-16 04:56:09 -0500 | [diff] [blame] | 153 | |
| 154 | Add IP Address ${test_ipv4_addr} ${test_subnet_mask} ${test_gateway} |
Vijay | de3bf7b | 2019-04-16 04:56:09 -0500 | [diff] [blame] | 155 | |
| 156 | Add Invalid IPv4 Address And Verify |
| 157 | [Documentation] Add Invalid IPv4 Address via Redfish and verify. |
George Keishing | 0c8100f | 2022-01-13 00:24:57 -0600 | [diff] [blame] | 158 | [Tags] Add_Invalid_IPv4_Address_And_Verify |
Vijay | de3bf7b | 2019-04-16 04:56:09 -0500 | [diff] [blame] | 159 | |
| 160 | Add IP Address ${test_ipv4_invalid_addr} ${test_subnet_mask} |
| 161 | ... ${test_gateway} valid_status_codes=${HTTP_BAD_REQUEST} |
| 162 | |
Prashanth Katti | b36a752 | 2019-05-22 05:32:39 -0500 | [diff] [blame] | 163 | Configure Out Of Range IP |
| 164 | [Documentation] Configure out-of-range IP address. |
| 165 | [Tags] Configure_Out_Of_Range_IP |
| 166 | [Template] Add IP Address |
| 167 | |
| 168 | # ip subnet_mask gateway valid_status_codes |
| 169 | ${out_of_range_ip} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 170 | |
| 171 | Configure Broadcast IP |
| 172 | [Documentation] Configure broadcast IP address. |
| 173 | [Tags] Configure_Broadcast_IP |
| 174 | [Template] Add IP Address |
Prashanth Katti | c6ad647 | 2019-06-14 03:33:39 -0500 | [diff] [blame] | 175 | [Teardown] Clear IP Settings On Fail ${broadcast_ip} |
Prashanth Katti | b36a752 | 2019-05-22 05:32:39 -0500 | [diff] [blame] | 176 | |
| 177 | # ip subnet_mask gateway valid_status_codes |
| 178 | ${broadcast_ip} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 179 | |
| 180 | Configure Multicast IP |
| 181 | [Documentation] Configure multicast IP address. |
| 182 | [Tags] Configure_Multicast_IP |
| 183 | [Template] Add IP Address |
Prashanth Katti | c6ad647 | 2019-06-14 03:33:39 -0500 | [diff] [blame] | 184 | [Teardown] Clear IP Settings On Fail ${multicast_ip} |
Prashanth Katti | b36a752 | 2019-05-22 05:32:39 -0500 | [diff] [blame] | 185 | |
| 186 | # ip subnet_mask gateway valid_status_codes |
| 187 | ${multicast_ip} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 188 | |
| 189 | Configure Loopback IP |
| 190 | [Documentation] Configure loopback IP address. |
| 191 | [Tags] Configure_Loopback_IP |
| 192 | [Template] Add IP Address |
Prashanth Katti | c6ad647 | 2019-06-14 03:33:39 -0500 | [diff] [blame] | 193 | [Teardown] Clear IP Settings On Fail ${loopback_ip} |
Prashanth Katti | b36a752 | 2019-05-22 05:32:39 -0500 | [diff] [blame] | 194 | |
| 195 | # ip subnet_mask gateway valid_status_codes |
| 196 | ${loopback_ip} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 197 | |
| 198 | Add Valid IPv4 Address And Check Persistency |
nagarjunb22 | 60784a4 | 2022-06-13 10:39:33 +0530 | [diff] [blame] | 199 | [Documentation] Add IPv4 address and check persistency. |
George Keishing | 0c8100f | 2022-01-13 00:24:57 -0600 | [diff] [blame] | 200 | [Tags] Add_Valid_IPv4_Address_And_Check_Persistency |
nagarjunb22 | 60784a4 | 2022-06-13 10:39:33 +0530 | [diff] [blame] | 201 | [Teardown] Run Keywords |
| 202 | ... Delete IP Address ${test_ipv4_addr} AND Test Teardown Execution |
Prashanth Katti | b36a752 | 2019-05-22 05:32:39 -0500 | [diff] [blame] | 203 | |
| 204 | Add IP Address ${test_ipv4_addr} ${test_subnet_mask} ${test_gateway} |
| 205 | |
| 206 | # Reboot BMC and verify persistency. |
Sweta Potthuri | 63f0b10 | 2022-08-03 23:11:46 -0500 | [diff] [blame] | 207 | Redfish OBMC Reboot (off) stack_mode=skip |
George Keishing | 5c49874 | 2019-08-09 02:14:44 -0500 | [diff] [blame] | 208 | Redfish.Login |
Prashanth Katti | b36a752 | 2019-05-22 05:32:39 -0500 | [diff] [blame] | 209 | Verify IP On BMC ${test_ipv4_addr} |
nagarjunb22 | 60784a4 | 2022-06-13 10:39:33 +0530 | [diff] [blame] | 210 | Verify IP On Redfish URI ${test_ipv4_addr} |
| 211 | |
Vijay | de3bf7b | 2019-04-16 04:56:09 -0500 | [diff] [blame] | 212 | |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 213 | Add Fourth Octet Threshold IP And Verify |
| 214 | [Documentation] Add fourth octet threshold IP and verify. |
| 215 | [Tags] Add_Fourth_Octet_Threshold_IP_And_Verify |
Anvesh Kumar | 9c7238d | 2020-04-21 03:56:21 -0500 | [diff] [blame] | 216 | [Teardown] Run Keywords |
| 217 | ... Delete IP Address 10.7.7.254 AND Test Teardown Execution |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 218 | |
| 219 | Add IP Address 10.7.7.254 ${test_subnet_mask} ${test_gateway} |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 220 | |
| 221 | Add Fourth Octet Lowest IP And Verify |
| 222 | [Documentation] Add fourth octet lowest IP and verify. |
| 223 | [Tags] Add_Fourth_Octet_Lowest_IP_And_Verify |
Anvesh Kumar | 9c7238d | 2020-04-21 03:56:21 -0500 | [diff] [blame] | 224 | [Teardown] Run Keywords |
| 225 | ... Delete IP Address 10.7.7.1 AND Test Teardown Execution |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 226 | |
| 227 | Add IP Address 10.7.7.1 ${test_subnet_mask} ${test_gateway} |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 228 | |
| 229 | Add Third Octet Threshold IP And Verify |
| 230 | [Documentation] Add third octet threshold IP and verify. |
| 231 | [Tags] Add_Third_Octet_Threshold_IP_And_Verify |
Anvesh Kumar | 9c7238d | 2020-04-21 03:56:21 -0500 | [diff] [blame] | 232 | [Teardown] Run Keywords |
| 233 | ... Delete IP Address 10.7.255.7 AND Test Teardown Execution |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 234 | |
| 235 | Add IP Address 10.7.255.7 ${test_subnet_mask} ${test_gateway} |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 236 | |
| 237 | Add Third Octet Lowest IP And Verify |
| 238 | [Documentation] Add third octet lowest IP and verify. |
| 239 | [Tags] Add_Third_Octet_Lowest_IP_And_Verify |
Anvesh Kumar | 9c7238d | 2020-04-21 03:56:21 -0500 | [diff] [blame] | 240 | [Teardown] Run Keywords |
| 241 | ... Delete IP Address 10.7.0.7 AND Test Teardown Execution |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 242 | |
| 243 | Add IP Address 10.7.0.7 ${test_subnet_mask} ${test_gateway} |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 244 | |
| 245 | Add Second Octet Threshold IP And Verify |
| 246 | [Documentation] Add second octet threshold IP and verify. |
| 247 | [Tags] Add_Second_Octet_Threshold_IP_And_Verify |
Anvesh Kumar | 9c7238d | 2020-04-21 03:56:21 -0500 | [diff] [blame] | 248 | [Teardown] Run Keywords |
| 249 | ... Delete IP Address 10.255.7.7 AND Test Teardown Execution |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 250 | |
| 251 | Add IP Address 10.255.7.7 ${test_subnet_mask} ${test_gateway} |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 252 | |
| 253 | Add Second Octet Lowest IP And Verify |
| 254 | [Documentation] Add second octet lowest IP and verify. |
| 255 | [Tags] Add_Second_Octet_Lowest_IP_And_Verify |
Anvesh Kumar | 9c7238d | 2020-04-21 03:56:21 -0500 | [diff] [blame] | 256 | [Teardown] Run Keywords |
| 257 | ... Delete IP Address 10.0.7.7 AND Test Teardown Execution |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 258 | |
| 259 | Add IP Address 10.0.7.7 ${test_subnet_mask} ${test_gateway} |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 260 | |
| 261 | Add First Octet Threshold IP And Verify |
| 262 | [Documentation] Add first octet threshold IP and verify. |
| 263 | [Tags] Add_First_Octet_Threshold_IP_And_Verify |
Anvesh Kumar | 9c7238d | 2020-04-21 03:56:21 -0500 | [diff] [blame] | 264 | [Teardown] Run Keywords |
Anves Kumar rayankula | f757b10 | 2020-07-27 20:41:36 -0500 | [diff] [blame] | 265 | ... Delete IP Address 223.7.7.7 AND Test Teardown Execution |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 266 | |
| 267 | Add IP Address 223.7.7.7 ${test_subnet_mask} ${test_gateway} |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 268 | |
| 269 | Add First Octet Lowest IP And Verify |
| 270 | [Documentation] Add first octet lowest IP and verify. |
| 271 | [Tags] Add_First_Octet_Lowest_IP_And_Verify |
Anvesh Kumar | 9c7238d | 2020-04-21 03:56:21 -0500 | [diff] [blame] | 272 | [Teardown] Run Keywords |
| 273 | ... Delete IP Address 1.7.7.7 AND Test Teardown Execution |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 274 | |
| 275 | Add IP Address 1.7.7.7 ${test_subnet_mask} ${test_gateway} |
Prashanth Katti | 6cedca2 | 2019-05-30 02:31:11 -0500 | [diff] [blame] | 276 | |
Prashanth Katti | 040c8c1 | 2019-05-31 04:42:05 -0500 | [diff] [blame] | 277 | Configure Invalid Netmask |
| 278 | [Documentation] Verify error while setting invalid netmask. |
| 279 | [Tags] Configure_Invalid_Netmask |
| 280 | [Template] Add IP Address |
| 281 | |
| 282 | # ip subnet_mask gateway valid_status_codes |
| 283 | ${test_ipv4_addr} ${invalid_netmask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 284 | |
| 285 | Configure Out Of Range Netmask |
| 286 | [Documentation] Verify error while setting out of range netmask. |
| 287 | [Tags] Configure_Out_Of_Range_Netmask |
| 288 | [Template] Add IP Address |
| 289 | |
| 290 | # ip subnet_mask gateway valid_status_codes |
| 291 | ${test_ipv4_addr} ${out_of_range_netmask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 292 | |
| 293 | Configure Alpha Netmask |
| 294 | [Documentation] Verify error while setting alpha netmask. |
| 295 | [Tags] Configure_Alpha_Netmask |
| 296 | [Template] Add IP Address |
| 297 | |
| 298 | # ip subnet_mask gateway valid_status_codes |
| 299 | ${test_ipv4_addr} ${alpha_netmask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 300 | |
| 301 | Configure More Byte Netmask |
| 302 | [Documentation] Verify error while setting more byte netmask. |
| 303 | [Tags] Configure_More_Byte_Netmask |
| 304 | [Template] Add IP Address |
| 305 | |
| 306 | # ip subnet_mask gateway valid_status_codes |
| 307 | ${test_ipv4_addr} ${more_byte_netmask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 308 | |
| 309 | Configure Less Byte Netmask |
| 310 | [Documentation] Verify error while setting less byte netmask. |
| 311 | [Tags] Configure_Less_Byte_Netmask |
| 312 | [Template] Add IP Address |
| 313 | |
| 314 | # ip subnet_mask gateway valid_status_codes |
| 315 | ${test_ipv4_addr} ${less_byte_netmask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 316 | |
Prashanth Katti | c6ad647 | 2019-06-14 03:33:39 -0500 | [diff] [blame] | 317 | Configure Threshold Netmask And Verify |
| 318 | [Documentation] Configure threshold netmask and verify. |
George Keishing | 5236ec5 | 2022-01-31 12:07:58 -0600 | [diff] [blame] | 319 | [Tags] Configure_Threshold_Netmask_And_Verify |
Anvesh Kumar | 9c7238d | 2020-04-21 03:56:21 -0500 | [diff] [blame] | 320 | [Teardown] Run Keywords |
| 321 | ... Delete IP Address ${test_ipv4_addr} AND Test Teardown Execution |
Prashanth Katti | c6ad647 | 2019-06-14 03:33:39 -0500 | [diff] [blame] | 322 | |
| 323 | Add IP Address ${test_ipv4_addr} ${threshold_netmask} ${test_gateway} |
Prashanth Katti | c6ad647 | 2019-06-14 03:33:39 -0500 | [diff] [blame] | 324 | |
| 325 | Configure Lowest Netmask And Verify |
| 326 | [Documentation] Configure lowest netmask and verify. |
George Keishing | 5236ec5 | 2022-01-31 12:07:58 -0600 | [diff] [blame] | 327 | [Tags] Configure_Lowest_Netmask_And_Verify |
Anvesh Kumar | 9c7238d | 2020-04-21 03:56:21 -0500 | [diff] [blame] | 328 | [Teardown] Run Keywords |
| 329 | ... Delete IP Address ${test_ipv4_addr} AND Test Teardown Execution |
Prashanth Katti | c6ad647 | 2019-06-14 03:33:39 -0500 | [diff] [blame] | 330 | |
| 331 | Add IP Address ${test_ipv4_addr} ${lowest_netmask} ${test_gateway} |
Prashanth Katti | c6ad647 | 2019-06-14 03:33:39 -0500 | [diff] [blame] | 332 | |
| 333 | Configure Network ID |
| 334 | [Documentation] Verify error while configuring network ID. |
| 335 | [Tags] Configure_Network_ID |
| 336 | [Template] Add IP Address |
| 337 | [Teardown] Clear IP Settings On Fail ${network_id} |
| 338 | |
| 339 | # ip subnet_mask gateway valid_status_codes |
| 340 | ${network_id} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 341 | |
| 342 | Configure Less Octet IP |
| 343 | [Documentation] Verify error while Configuring less octet IP address. |
| 344 | [Tags] Configure_Less_Octet_IP |
| 345 | [Template] Add IP Address |
| 346 | |
| 347 | # ip subnet_mask gateway valid_status_codes |
| 348 | ${less_octet_ip} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 349 | |
| 350 | Configure Empty IP |
| 351 | [Documentation] Verify error while Configuring empty IP address. |
| 352 | [Tags] Configure_Empty_IP |
| 353 | [Template] Add IP Address |
| 354 | |
| 355 | # ip subnet_mask gateway valid_status_codes |
| 356 | ${EMPTY} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 357 | |
| 358 | Configure Special Char IP |
| 359 | [Documentation] Configure invalid IP address containing special chars. |
| 360 | [Tags] Configure_Special_Char_IP |
| 361 | [Template] Add IP Address |
| 362 | |
| 363 | # ip subnet_mask gateway valid_status_codes |
| 364 | @@@.%%.44.11 ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 365 | |
| 366 | Configure Hexadecimal IP |
| 367 | [Documentation] Configure invalid IP address containing hex value. |
| 368 | [Tags] Configure_Hexadecimal_IP |
| 369 | [Template] Add IP Address |
| 370 | |
| 371 | # ip subnet_mask gateway valid_status_codes |
| 372 | ${hex_ip} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 373 | |
| 374 | Configure Negative Octet IP |
| 375 | [Documentation] Configure invalid IP address containing negative octet. |
| 376 | [Tags] Configure_Negative_Octet_IP |
| 377 | [Template] Add IP Address |
| 378 | |
| 379 | # ip subnet_mask gateway valid_status_codes |
| 380 | ${negative_ip} ${test_subnet_mask} ${test_gateway} ${HTTP_BAD_REQUEST} |
| 381 | |
Prashanth Katti | 5cad5a0 | 2019-06-20 07:27:10 -0500 | [diff] [blame] | 382 | Configure Incomplete IP For Gateway |
| 383 | [Documentation] Configure incomplete IP for gateway and expect an error. |
| 384 | [Tags] Configure_Incomplete_IP_For_Gateway |
| 385 | [Template] Add IP Address |
| 386 | |
| 387 | # ip subnet_mask gateway valid_status_codes |
| 388 | ${test_ipv4_addr} ${test_subnet_mask} ${less_octet_ip} ${HTTP_BAD_REQUEST} |
| 389 | |
| 390 | Configure Special Char IP For Gateway |
| 391 | [Documentation] Configure special char IP for gateway and expect an error. |
| 392 | [Tags] Configure_Special_Char_IP_For_Gateway |
| 393 | [Template] Add IP Address |
| 394 | |
| 395 | # ip subnet_mask gateway valid_status_codes |
| 396 | ${test_ipv4_addr} ${test_subnet_mask} @@@.%%.44.11 ${HTTP_BAD_REQUEST} |
| 397 | |
| 398 | Configure Hexadecimal IP For Gateway |
| 399 | [Documentation] Configure hexadecimal IP for gateway and expect an error. |
| 400 | [Tags] Configure_Hexadecimal_IP_For_Gateway |
| 401 | [Template] Add IP Address |
| 402 | |
| 403 | # ip subnet_mask gateway valid_status_codes |
| 404 | ${test_ipv4_addr} ${test_subnet_mask} ${hex_ip} ${HTTP_BAD_REQUEST} |
| 405 | |
Prashanth Katti | 7098c97 | 2019-07-03 06:56:42 -0500 | [diff] [blame] | 406 | Get DNS Server And Verify |
| 407 | [Documentation] Get DNS server via Redfish and verify. |
| 408 | [Tags] Get_DNS_Server_And_Verify |
| 409 | |
| 410 | Verify CLI and Redfish Nameservers |
| 411 | |
| 412 | Configure DNS Server And Verify |
| 413 | [Documentation] Configure DNS server and verify. |
| 414 | [Tags] Configure_DNS_Server_And_Verify |
Prashanth Katti | c85957c | 2019-07-09 02:01:20 -0500 | [diff] [blame] | 415 | [Setup] DNS Test Setup Execution |
Prashanth Katti | 7098c97 | 2019-07-03 06:56:42 -0500 | [diff] [blame] | 416 | [Teardown] Run Keywords |
| 417 | ... Configure Static Name Servers AND Test Teardown Execution |
| 418 | |
Prashanth Katti | 7098c97 | 2019-07-03 06:56:42 -0500 | [diff] [blame] | 419 | Configure Static Name Servers ${static_name_servers} |
| 420 | Verify CLI and Redfish Nameservers |
| 421 | |
Prashanth Katti | c85957c | 2019-07-09 02:01:20 -0500 | [diff] [blame] | 422 | Delete DNS Server And Verify |
| 423 | [Documentation] Delete DNS server and verify. |
| 424 | [Tags] Delete_DNS_Server_And_Verify |
| 425 | [Setup] DNS Test Setup Execution |
| 426 | [Teardown] Run Keywords |
| 427 | ... Configure Static Name Servers AND Test Teardown Execution |
| 428 | |
| 429 | Delete Static Name Servers |
| 430 | Verify CLI and Redfish Nameservers |
| 431 | |
| 432 | Configure DNS Server And Check Persistency |
| 433 | [Documentation] Configure DNS server and check persistency on reboot. |
| 434 | [Tags] Configure_DNS_Server_And_Check_Persistency |
| 435 | [Setup] DNS Test Setup Execution |
| 436 | [Teardown] Run Keywords |
| 437 | ... Configure Static Name Servers AND Test Teardown Execution |
| 438 | |
| 439 | Configure Static Name Servers ${static_name_servers} |
| 440 | # Reboot BMC and verify persistency. |
Sweta Potthuri | 63f0b10 | 2022-08-03 23:11:46 -0500 | [diff] [blame] | 441 | Redfish OBMC Reboot (off) stack_mode=skip |
Anves Kumar rayankula | 8c628b7 | 2021-02-05 05:03:45 -0600 | [diff] [blame] | 442 | Redfish.Login |
Prashanth Katti | c85957c | 2019-07-09 02:01:20 -0500 | [diff] [blame] | 443 | Verify CLI and Redfish Nameservers |
| 444 | |
Prashanth Katti | 3063ffe | 2019-07-25 04:35:25 -0500 | [diff] [blame] | 445 | Configure Loopback IP For Gateway |
| 446 | [Documentation] Configure loopback IP for gateway and expect an error. |
| 447 | [Tags] Configure_Loopback_IP_For_Gateway |
| 448 | [Template] Add IP Address |
| 449 | [Teardown] Clear IP Settings On Fail ${test_ipv4_addr} |
| 450 | |
| 451 | # ip subnet_mask gateway valid_status_codes |
| 452 | ${test_ipv4_addr} ${test_subnet_mask} ${loopback_ip} ${HTTP_BAD_REQUEST} |
| 453 | |
| 454 | Configure Network ID For Gateway |
| 455 | [Documentation] Configure network ID for gateway and expect an error. |
| 456 | [Tags] Configure_Network_ID_For_Gateway |
| 457 | [Template] Add IP Address |
| 458 | [Teardown] Clear IP Settings On Fail ${test_ipv4_addr} |
| 459 | |
| 460 | # ip subnet_mask gateway valid_status_codes |
| 461 | ${test_ipv4_addr} ${test_subnet_mask} ${network_id} ${HTTP_BAD_REQUEST} |
| 462 | |
| 463 | Configure Multicast IP For Gateway |
| 464 | [Documentation] Configure multicast IP for gateway and expect an error. |
| 465 | [Tags] Configure_Multicast_IP_For_Gateway |
| 466 | [Template] Add IP Address |
| 467 | [Teardown] Clear IP Settings On Fail ${test_ipv4_addr} |
| 468 | |
| 469 | # ip subnet_mask gateway valid_status_codes |
Tony Lee | 412c668 | 2020-04-01 17:34:30 +0800 | [diff] [blame] | 470 | ${test_ipv4_addr} ${test_subnet_mask} ${multicast_ip} ${HTTP_BAD_REQUEST} |
Prashanth Katti | 3063ffe | 2019-07-25 04:35:25 -0500 | [diff] [blame] | 471 | |
| 472 | Configure Broadcast IP For Gateway |
| 473 | [Documentation] Configure broadcast IP for gateway and expect an error. |
| 474 | [Tags] Configure_Broadcast_IP_For_Gateway |
| 475 | [Template] Add IP Address |
| 476 | [Teardown] Clear IP Settings On Fail ${test_ipv4_addr} |
| 477 | |
| 478 | # ip subnet_mask gateway valid_status_codes |
| 479 | ${test_ipv4_addr} ${test_subnet_mask} ${broadcast_ip} ${HTTP_BAD_REQUEST} |
Prashanth Katti | c85957c | 2019-07-09 02:01:20 -0500 | [diff] [blame] | 480 | |
Prashanth Katti | 3c7b643 | 2019-07-26 06:53:37 -0500 | [diff] [blame] | 481 | Configure Null Value For DNS Server |
| 482 | [Documentation] Configure null value for DNS server and expect an error. |
| 483 | [Tags] Configure_Null_Value_For_DNS_Server |
| 484 | [Setup] DNS Test Setup Execution |
| 485 | [Teardown] Run Keywords |
| 486 | ... Configure Static Name Servers AND Test Teardown Execution |
| 487 | |
| 488 | Configure Static Name Servers ${null_value} ${HTTP_BAD_REQUEST} |
| 489 | |
Prashanth Katti | afe16b7 | 2019-08-02 00:29:45 -0500 | [diff] [blame] | 490 | Configure Empty Value For DNS Server |
| 491 | [Documentation] Configure empty value for DNS server and expect an error. |
| 492 | [Tags] Configure_Empty_Value_For_DNS_Server |
| 493 | [Setup] DNS Test Setup Execution |
| 494 | [Teardown] Run Keywords |
| 495 | ... Configure Static Name Servers AND Test Teardown Execution |
| 496 | |
| 497 | Configure Static Name Servers ${empty_dictionary} ${HTTP_BAD_REQUEST} |
| 498 | |
| 499 | Configure String Value For DNS Server |
| 500 | [Documentation] Configure string value for DNS server and expect an error. |
| 501 | [Tags] Configure_String_Value_For_DNS_Server |
| 502 | [Setup] DNS Test Setup Execution |
| 503 | [Teardown] Run Keywords |
| 504 | ... Configure Static Name Servers AND Test Teardown Execution |
| 505 | |
| 506 | Configure Static Name Servers ${string_value} ${HTTP_BAD_REQUEST} |
| 507 | |
Prashanth Katti | 568df5f | 2020-05-15 06:00:37 -0500 | [diff] [blame] | 508 | Modify IPv4 Address And Verify |
| 509 | [Documentation] Modify IP address via Redfish and verify. |
George Keishing | 0c8100f | 2022-01-13 00:24:57 -0600 | [diff] [blame] | 510 | [Tags] Modify_IPv4_Address_And_Verify |
Prashanth Katti | 568df5f | 2020-05-15 06:00:37 -0500 | [diff] [blame] | 511 | [Teardown] Run Keywords |
Anves Kumar rayankula | 045814b | 2020-10-09 09:17:05 -0500 | [diff] [blame] | 512 | ... Delete IP Address ${test_ipv4_addr2} AND Test Teardown Execution |
Prashanth Katti | 568df5f | 2020-05-15 06:00:37 -0500 | [diff] [blame] | 513 | |
| 514 | Add IP Address ${test_ipv4_addr} ${test_subnet_mask} ${test_gateway} |
| 515 | |
| 516 | Update IP Address ${test_ipv4_addr} ${test_ipv4_addr2} ${test_subnet_mask} ${test_gateway} |
| 517 | |
Sweta Potthuri | 6e70478 | 2022-09-27 01:23:48 -0500 | [diff] [blame] | 518 | Verify Modifying IP Address Multiple Times |
| 519 | [Documentation] Verify modifying IP address multiple times. |
| 520 | [Tags] Verify_Modifying_IP_Address_Multiple_Times |
| 521 | [Teardown] Run Keywords |
| 522 | ... Delete IP Address ${test_ipv4_addr} AND Test Teardown Execution |
| 523 | |
| 524 | Add IP Address ${test_ipv4_addr} ${test_subnet_mask} ${test_gateway} |
| 525 | Update IP Address ${test_ipv4_addr} ${test_ipv4_addr2} ${test_subnet_mask} ${test_gateway} |
Sweta Potthuri | e392cc7 | 2022-11-15 06:54:21 -0600 | [diff] [blame] | 526 | Update IP Address ${test_ipv4_addr2} ${test_ipv4_addr} ${test_subnet_mask} ${test_gateway} |
Anvesh Kumar | 9c7238d | 2020-04-21 03:56:21 -0500 | [diff] [blame] | 527 | |
Anves Kumar rayankula | 6b9fcd1 | 2020-12-18 01:03:19 -0600 | [diff] [blame] | 528 | Configure Invalid Values For DNS Server |
| 529 | [Documentation] Configure invalid values for DNS server and expect an error. |
George Keishing | 5236ec5 | 2022-01-31 12:07:58 -0600 | [diff] [blame] | 530 | [Tags] Configure_Invalid_Values_For_DNS_Server |
Anves Kumar rayankula | 6b9fcd1 | 2020-12-18 01:03:19 -0600 | [diff] [blame] | 531 | [Setup] DNS Test Setup Execution |
| 532 | [Template] Configure Static Name Servers |
| 533 | [Teardown] Run Keywords |
| 534 | ... Configure Static Name Servers AND Test Teardown Execution |
| 535 | |
| 536 | # static_name_servers valid_status_codes |
| 537 | 0xa.0xb.0xc.0xd ${HTTP_BAD_REQUEST} |
| 538 | 10.-7.-7.-7 ${HTTP_BAD_REQUEST} |
| 539 | 10.3.36 ${HTTP_BAD_REQUEST} |
| 540 | @@@.%%.44.11 ${HTTP_BAD_REQUEST} |
| 541 | |
| 542 | |
| 543 | Config Multiple DNS Servers And Verify |
| 544 | [Documentation] Config multiple DNS servers and verify. |
| 545 | [Tags] Config_Multiple_DNS_Servers_And_Verify |
| 546 | [Setup] DNS Test Setup Execution |
| 547 | [Teardown] Run Keywords |
| 548 | ... Configure Static Name Servers AND Test Teardown Execution |
| 549 | |
| 550 | @{list_name_servers}= Create List 10.5.5.10 10.20.5.10 10.5.6.7 |
| 551 | Configure Static Name Servers ${list_name_servers} |
| 552 | Verify CLI and Redfish Nameservers |
| 553 | |
| 554 | |
Anves Kumar rayankula | d4cdd8c | 2021-01-11 04:10:05 -0600 | [diff] [blame] | 555 | Configure And Verify Multiple Static IPv4 Addresses |
| 556 | [Documentation] Configure multiple static ipv4 address via Redfish and verify. |
| 557 | [Tags] Configure_And_Verify_Multiple_Static_IPv4_Addresses |
| 558 | [Teardown] Run Keywords Delete Multiple Static IPv4 Addresses ${test_ipv4_addresses} |
| 559 | ... AND Test Teardown Execution |
| 560 | |
| 561 | ${test_ipv4_addresses}= Create List ${test_ipv4_addr} ${test_ipv4_addr2} |
| 562 | Configure Multiple Static IPv4 Addresses ${test_ipv4_addresses} ${test_subnet_mask} ${test_gateway} |
| 563 | |
| 564 | |
| 565 | Configure Multiple Static IPv4 Addresses And Check Persistency |
| 566 | [Documentation] Configure multiple static ipv4 address via Redfish and check persistency. |
| 567 | [Tags] Configure_Multiple_Static_IPv4_Addresses_And_Check_Persistency |
| 568 | [Teardown] Run Keywords Delete Multiple Static IPv4 Addresses ${test_ipv4_addresses} |
| 569 | ... AND Test Teardown Execution |
| 570 | |
| 571 | ${test_ipv4_addresses}= Create List ${test_ipv4_addr} ${test_ipv4_addr2} |
| 572 | Configure Multiple Static IPv4 Addresses ${test_ipv4_addresses} ${test_subnet_mask} ${test_gateway} |
| 573 | |
| 574 | # Reboot BMC and verify persistency. |
Sweta Potthuri | 63f0b10 | 2022-08-03 23:11:46 -0500 | [diff] [blame] | 575 | Redfish OBMC Reboot (off) stack_mode=skip |
Anves Kumar rayankula | 8c628b7 | 2021-02-05 05:03:45 -0600 | [diff] [blame] | 576 | Redfish.Login |
Anves Kumar rayankula | d4cdd8c | 2021-01-11 04:10:05 -0600 | [diff] [blame] | 577 | FOR ${ip} IN @{test_ipv4_addresses} |
| 578 | Verify IP And Netmask On BMC ${ip} ${test_subnet_mask} |
nagarjunb22 | 60784a4 | 2022-06-13 10:39:33 +0530 | [diff] [blame] | 579 | Verify IP On Redfish URI ${ip} |
Anves Kumar rayankula | d4cdd8c | 2021-01-11 04:10:05 -0600 | [diff] [blame] | 580 | END |
| 581 | |
| 582 | |
Anves Kumar rayankula | 43e93e1 | 2021-01-27 03:52:37 -0600 | [diff] [blame] | 583 | Configure And Verify Multiple IPv4 Addresses |
| 584 | [Documentation] Configure multiple IPv4 addresses and verify. |
George Keishing | 0c8100f | 2022-01-13 00:24:57 -0600 | [diff] [blame] | 585 | [Tags] Configure_And_Verify_Multiple_IPv4_Addresses |
Anves Kumar rayankula | 43e93e1 | 2021-01-27 03:52:37 -0600 | [diff] [blame] | 586 | [Teardown] Run Keywords |
| 587 | ... Delete IP Address ${test_ipv4_addr} AND Delete IP Address ${test_ipv4_addr2} |
| 588 | ... AND Test Teardown Execution |
| 589 | |
| 590 | ${ip1}= Create dictionary Address=${test_ipv4_addr} |
| 591 | ... SubnetMask=255.255.0.0 Gateway=${test_gateway} |
| 592 | ${ip2}= Create dictionary Address=${test_ipv4_addr2} |
| 593 | ... SubnetMask=255.255.252.0 Gateway=${test_gateway} |
| 594 | |
| 595 | ${empty_dict}= Create Dictionary |
| 596 | ${patch_list}= Create List |
| 597 | ${network_configurations}= Get Network Configuration |
| 598 | ${num_entries}= Get Length ${network_configurations} |
| 599 | |
| 600 | FOR ${INDEX} IN RANGE 0 ${num_entries} |
| 601 | Append To List ${patch_list} ${empty_dict} |
| 602 | END |
| 603 | |
| 604 | # We need not check for existence of IP on BMC while adding. |
| 605 | Append To List ${patch_list} ${ip1} ${ip2} |
| 606 | ${payload}= Create Dictionary IPv4StaticAddresses=${patch_list} |
| 607 | ${active_channel_config}= Get Active Channel Config |
| 608 | ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 609 | Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} body=&{payload} |
Anves Kumar rayankula | 53b8030 | 2021-05-21 01:50:03 -0500 | [diff] [blame] | 610 | ... valid_status_codes=[${HTTP_OK}, ${HTTP_NO_CONTENT}] |
Anves Kumar rayankula | 43e93e1 | 2021-01-27 03:52:37 -0600 | [diff] [blame] | 611 | |
| 612 | # Note: Network restart takes around 15-18s after patch request processing. |
| 613 | Sleep ${NETWORK_TIMEOUT}s |
| 614 | Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT} |
| 615 | Verify IP On BMC ${test_ipv4_addr} |
| 616 | Verify IP On BMC ${test_ipv4_addr2} |
| 617 | |
| 618 | |
Anves Kumar rayankula | eefdb56 | 2021-02-08 07:54:11 -0600 | [diff] [blame] | 619 | Config Multiple DNS Servers And Check Persistency |
| 620 | [Documentation] Config multiple DNS and check persistency. |
| 621 | [Tags] Config_Multiple_DNS_Servers_And_Check_Persistency |
| 622 | [Setup] DNS Test Setup Execution |
| 623 | [Teardown] Run Keywords |
| 624 | ... Configure Static Name Servers AND Test Teardown Execution |
| 625 | |
| 626 | @{list_name_servers}= Create List 10.5.5.10 10.20.5.10 10.5.6.7 |
| 627 | Configure Static Name Servers ${list_name_servers} |
| 628 | |
| 629 | # Reboot BMC and verify persistency. |
Sweta Potthuri | 63f0b10 | 2022-08-03 23:11:46 -0500 | [diff] [blame] | 630 | Redfish OBMC Reboot (off) stack_mode=skip |
Anves Kumar rayankula | eefdb56 | 2021-02-08 07:54:11 -0600 | [diff] [blame] | 631 | Redfish.Login |
| 632 | Verify CLI and Redfish Nameservers |
| 633 | |
Anves Kumar rayankula | 2f137eb | 2021-03-29 01:12:01 -0500 | [diff] [blame] | 634 | |
| 635 | Configure Static IP Without Using Gateway And Verify |
| 636 | [Documentation] Configure static IP without using gateway and verify error. |
| 637 | [Tags] Configure_Static_IP_Without_Using_Gateway_And_Verify |
| 638 | |
| 639 | ${ip}= Create dictionary Address=${test_ipv4_addr} |
| 640 | ... SubnetMask=${test_subnet_mask} |
| 641 | ${empty_dict}= Create Dictionary |
| 642 | ${patch_list}= Create List |
| 643 | ${network_configurations}= Get Network Configuration |
| 644 | |
| 645 | ${num_entries}= Get Length ${network_configurations} |
| 646 | FOR ${INDEX} IN RANGE 0 ${num_entries} |
| 647 | Append To List ${patch_list} ${empty_dict} |
| 648 | END |
| 649 | |
| 650 | # We need not check for existence of IP on BMC while adding. |
| 651 | Append To List ${patch_list} ${ip} |
| 652 | ${payload}= Create Dictionary IPv4StaticAddresses=${patch_list} |
| 653 | ${active_channel_config}= Get Active Channel Config |
| 654 | ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 655 | Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} |
| 656 | ... body=&{payload} valid_status_codes=[${HTTP_BAD_REQUEST}] |
| 657 | |
Anves Kumar rayankula | ac0a7ba | 2021-03-09 08:10:20 -0600 | [diff] [blame] | 658 | |
| 659 | Test Network Response On Specified Host State |
| 660 | [Documentation] Verifying the BMC network response when host is on and off. |
| 661 | [Tags] Test_Network_Response_On_Specified_Host_State |
| 662 | [Template] Verify Network Response On Specified Host State |
| 663 | |
| 664 | # host_state |
| 665 | on |
| 666 | off |
| 667 | |
Sweta Potthuri | fb00136 | 2022-03-14 02:21:14 -0500 | [diff] [blame] | 668 | |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 669 | *** Keywords *** |
| 670 | |
| 671 | Test Setup Execution |
| 672 | [Documentation] Test setup execution. |
| 673 | |
George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 674 | Redfish.Login |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 675 | |
| 676 | @{network_configurations}= Get Network Configuration |
| 677 | Set Test Variable @{network_configurations} |
| 678 | |
| 679 | # Get BMC IP address and prefix length. |
| 680 | ${ip_data}= Get BMC IP Info |
| 681 | Set Test Variable ${ip_data} |
| 682 | |
Prashanth Katti | 747ce9d | 2019-02-07 07:23:48 -0600 | [diff] [blame] | 683 | |
Prashanth Katti | 747ce9d | 2019-02-07 07:23:48 -0600 | [diff] [blame] | 684 | Verify Netmask On BMC |
| 685 | [Documentation] Verify netmask on BMC. |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 686 | [Arguments] ${netmask} |
| 687 | |
| 688 | # Description of the argument(s): |
| 689 | # netmask netmask value to be verified. |
| 690 | |
Prashanth Katti | 747ce9d | 2019-02-07 07:23:48 -0600 | [diff] [blame] | 691 | ${prefix_length}= Netmask Prefix Length ${netmask} |
| 692 | |
| 693 | Should Contain Match ${ip_data} */${prefix_length} |
| 694 | ... msg=Prefix length does not exist. |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 695 | |
Prashanth Katti | 2c5c3bb | 2019-02-14 04:23:07 -0600 | [diff] [blame] | 696 | Verify IP And Netmask On BMC |
| 697 | [Documentation] Verify IP and netmask on BMC. |
| 698 | [Arguments] ${ip} ${netmask} |
| 699 | |
| 700 | # Description of the argument(s): |
| 701 | # ip IP address to be verified. |
| 702 | # netmask netmask value to be verified. |
| 703 | |
| 704 | ${prefix_length}= Netmask Prefix Length ${netmask} |
| 705 | @{ip_data}= Get BMC IP Info |
| 706 | |
| 707 | ${ip_with_netmask}= Catenate ${ip}/${prefix_length} |
| 708 | Should Contain ${ip_data} ${ip_with_netmask} |
| 709 | ... msg=IP and netmask pair does not exist. |
| 710 | |
Prashanth Katti | f58cce0 | 2019-02-06 03:05:14 -0600 | [diff] [blame] | 711 | Test Teardown Execution |
| 712 | [Documentation] Test teardown execution. |
| 713 | |
| 714 | FFDC On Test Case Fail |
George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 715 | Redfish.Logout |
Prashanth Katti | a844251 | 2019-06-07 06:47:09 -0500 | [diff] [blame] | 716 | |
| 717 | Clear IP Settings On Fail |
| 718 | [Documentation] Clear IP settings on fail. |
| 719 | [Arguments] ${ip} |
| 720 | |
| 721 | # Description of argument(s): |
| 722 | # ip IP address to be deleted. |
| 723 | |
| 724 | Run Keyword If '${TEST STATUS}' == 'FAIL' |
| 725 | ... Delete IP Address ${ip} |
| 726 | |
| 727 | Test Teardown Execution |
Prashanth Katti | adf0b4e | 2019-06-10 04:20:30 -0500 | [diff] [blame] | 728 | |
Prashanth Katti | 7098c97 | 2019-07-03 06:56:42 -0500 | [diff] [blame] | 729 | Verify CLI and Redfish Nameservers |
| 730 | [Documentation] Verify that nameservers obtained via Redfish do not |
| 731 | ... match those found in /etc/resolv.conf. |
| 732 | |
Tony Lee | 412c668 | 2020-04-01 17:34:30 +0800 | [diff] [blame] | 733 | ${active_channel_config}= Get Active Channel Config |
| 734 | ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 735 | |
Anves Kumar rayankula | 91548ea | 2020-06-18 00:28:13 -0500 | [diff] [blame] | 736 | ${redfish_nameservers}= Redfish.Get Attribute |
| 737 | ... ${REDFISH_NW_ETH_IFACE}${ethernet_interface} StaticNameServers |
Prashanth Katti | 7098c97 | 2019-07-03 06:56:42 -0500 | [diff] [blame] | 738 | ${resolve_conf_nameservers}= CLI Get Nameservers |
Michael Walsh | 39c0051 | 2019-07-17 10:54:06 -0500 | [diff] [blame] | 739 | Rqprint Vars redfish_nameservers resolve_conf_nameservers |
Prashanth Katti | 7098c97 | 2019-07-03 06:56:42 -0500 | [diff] [blame] | 740 | |
Sweta Potthuri | d77ea98 | 2021-07-01 04:30:38 -0500 | [diff] [blame] | 741 | List Should Contain Sub List ${resolve_conf_nameservers} ${redfish_nameservers} |
| 742 | ... msg=The nameservers obtained via Redfish do not match those found in /etc/resolv.conf. |
Prashanth Katti | 7098c97 | 2019-07-03 06:56:42 -0500 | [diff] [blame] | 743 | |
Prashanth Katti | b478d90 | 2020-05-08 10:05:32 -0500 | [diff] [blame] | 744 | Suite Setup Execution |
| 745 | [Documentation] Do suite setup execution. |
| 746 | |
aravinth0510 | ca054ee | 2022-06-16 13:26:15 +0000 | [diff] [blame] | 747 | # - Get DHCP IPv4 enabled/disabled status from redfish managers URI |
| 748 | # - If DHCP IPv4 is enabled , |
| 749 | # - Get DHCP IPv4 settings - ip address, gateway, subnetmask |
| 750 | # - And set the same as static IP address |
| 751 | |
George Keishing | 1ac4221 | 2022-07-20 21:55:49 -0500 | [diff] [blame] | 752 | Redfish.Login |
Anvesh Kumar | 59188b6 | 2023-12-12 08:03:14 -0600 | [diff] [blame] | 753 | ${DHCPEnabled}= Get IPv4 DHCP Enabled Status ${CHANNEL_NUMBER} |
aravinth0510 | ca054ee | 2022-06-16 13:26:15 +0000 | [diff] [blame] | 754 | Set Suite Variable ${DHCPEnabled} |
| 755 | |
Anvesh Kumar | 59188b6 | 2023-12-12 08:03:14 -0600 | [diff] [blame] | 756 | ${ip_addr} ${gateway} ${subnetmask}= Run Keyword If ${DHCPEnabled}==True |
| 757 | ... Get DHCP IP Info |
| 758 | |
aravinth0510 | ca054ee | 2022-06-16 13:26:15 +0000 | [diff] [blame] | 759 | Run Keyword If ${DHCPEnabled}==True |
Anvesh Kumar | 59188b6 | 2023-12-12 08:03:14 -0600 | [diff] [blame] | 760 | ... Add IP Address ${ip_addr} ${subnetmask} ${gateway} |
aravinth0510 | ca054ee | 2022-06-16 13:26:15 +0000 | [diff] [blame] | 761 | |
Prashanth Katti | b478d90 | 2020-05-08 10:05:32 -0500 | [diff] [blame] | 762 | ${test_gateway}= Get BMC Default Gateway |
| 763 | Set Suite Variable ${test_gateway} |
Prashanth Katti | 568df5f | 2020-05-15 06:00:37 -0500 | [diff] [blame] | 764 | |
aravinth0510 | ca054ee | 2022-06-16 13:26:15 +0000 | [diff] [blame] | 765 | |
| 766 | Suite Teardown Execution |
| 767 | [Documentation] Do suite teardown execution. |
| 768 | |
| 769 | # - If the DHCP IPv4 is enabled before suite setup execution |
| 770 | # - Restore the DHCP IPv4 to enabled state |
| 771 | |
Anvesh Kumar | 59188b6 | 2023-12-12 08:03:14 -0600 | [diff] [blame] | 772 | Redfish.Login |
aravinth0510 | ca054ee | 2022-06-16 13:26:15 +0000 | [diff] [blame] | 773 | Run Keyword If ${DHCPEnabled}==True |
| 774 | ... Enable IPv4 DHCP Settings |
| 775 | |
| 776 | |
Anves Kumar rayankula | d4cdd8c | 2021-01-11 04:10:05 -0600 | [diff] [blame] | 777 | Configure Multiple Static IPv4 Addresses |
| 778 | [Documentation] Configure multiple static ipv4 address via Redfish and verify. |
| 779 | [Arguments] ${ip_addreses} ${subnet_mask} ${gateway} |
| 780 | |
| 781 | # Description of argument(s): |
| 782 | # ip_addreses A list of IP addresses to be added (e.g.["10.7.7.7"]). |
| 783 | # subnet_mask Subnet mask for the IP to be added (e.g. "255.255.0.0"). |
| 784 | # gateway Gateway for the IP to be added (e.g. "10.7.7.1"). |
| 785 | |
| 786 | FOR ${ip} IN @{ip_addreses} |
| 787 | Add IP Address ${ip} ${subnet_mask} ${gateway} |
| 788 | END |
| 789 | Validate Network Config On BMC |
| 790 | |
| 791 | |
| 792 | Delete Multiple Static IPv4 Addresses |
| 793 | [Documentation] Delete multiple static ipv4 address via Redfish. |
| 794 | [Arguments] ${ip_addreses} |
| 795 | |
| 796 | # Description of argument(s): |
| 797 | # ip_addreses A list of IP addresses to be deleted (e.g.["10.7.7.7"]). |
| 798 | |
| 799 | FOR ${ip} IN @{ip_addreses} |
| 800 | Delete IP Address ${ip} |
| 801 | END |
| 802 | Validate Network Config On BMC |
Anves Kumar rayankula | ac0a7ba | 2021-03-09 08:10:20 -0600 | [diff] [blame] | 803 | |
| 804 | Verify Network Response On Specified Host State |
| 805 | [Documentation] Verifying the BMC network response when host is on and off. |
| 806 | [Arguments] ${host_state} |
| 807 | |
| 808 | # Description of argument(s): |
| 809 | # host_state if host_state is on then host is booted to operating system. |
| 810 | # if host_state is off then host is power off. |
| 811 | # (eg. on, off). |
| 812 | |
| 813 | ${active_channel_config}= Get Active Channel Config |
| 814 | ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 815 | |
| 816 | Run Keyword If '${host_state}' == 'on' |
| 817 | ... Redfish Power On stack_mode=skip |
| 818 | ... ELSE |
| 819 | ... Redfish Power off stack_mode=skip |
| 820 | |
| 821 | Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface} |
| 822 | Ping Host ${OPENBMC_HOST} |
| 823 | |
nagarjunb22 | 60784a4 | 2022-06-13 10:39:33 +0530 | [diff] [blame] | 824 | |
| 825 | Verify IP On Redfish URI |
| 826 | [Documentation] Verify given IP on redfish URI. |
| 827 | [Arguments] ${ip_address} |
| 828 | |
| 829 | # Description of argument(s): |
| 830 | # ip_address Configured IP address which need to verified. |
| 831 | |
| 832 | ${network_configurations}= Get Network Configuration |
| 833 | |
| 834 | FOR ${network_configuration} IN @{network_configurations} |
| 835 | ${ip_found}= Set Variable If '${network_configuration['Address']}' == '${ip_address}' ${True} |
| 836 | ... ${False} |
| 837 | Exit For Loop If ${ip_found} |
| 838 | END |
| 839 | Run Keyword If '${ip_found}' == '${False}' |
| 840 | ... Fail msg=Configured IP address not found on EthernetInterface URI. |
aravinth0510 | ca054ee | 2022-06-16 13:26:15 +0000 | [diff] [blame] | 841 | |
| 842 | |
| 843 | Enable IPv4 DHCP Settings |
| 844 | [Documentation] Set IPv4 DHCP enabled status true/false in redfish URI. |
| 845 | [Arguments] ${status}=${True} |
| 846 | |
| 847 | # Description of argument(s): |
| 848 | # status IPv4 DHCPEnabled status which needs to be set. |
| 849 | # (e.g. True or False) |
| 850 | |
| 851 | ${active_channel_config}= Get Active Channel Config |
| 852 | ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 853 | ${DHCPv4}= Create Dictionary DHCPEnabled=${status} |
| 854 | |
| 855 | ${payload}= Create Dictionary DHCPv4=${DHCPv4} |
| 856 | Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} |
| 857 | ... body=&{payload} valid_status_codes=[${HTTP_NO_CONTENT}, ${HTTP_OK}] |
| 858 | |
| 859 | Sleep ${NETWORK_TIMEOUT}s |
| 860 | Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT} |