1*** Settings *** 2Documentation Network interface IPv6 configuration and verification 3 ... tests. 4 5Resource ../../lib/bmc_redfish_resource.robot 6Resource ../../lib/openbmc_ffdc.robot 7Resource ../../lib/bmc_ipv6_utils.robot 8Resource ../../lib/external_intf/vmi_utils.robot 9Resource ../../lib/bmc_network_utils.robot 10Library ../../lib/bmc_network_utils.py 11Library Collections 12Library Process 13 14Test Setup Test Setup Execution 15Test Teardown Test Teardown Execution 16Suite Setup Suite Setup Execution 17Suite Teardown Redfish.Logout 18 19Test Tags BMC_IPv6 20 21*** Variables *** 22${test_ipv6_invalid_addr} 2001:db8:3333:4444:5555:6666:7777:JJKK 23${test_ipv6_addr1} 2001:db8:3333:4444:5555:6666:7777:9999 24${invalid_hexadec_ipv6} x:x:x:x:x:x:10.5.5.6 25${ipv6_multi_short} 2001::33::111 26# Valid prefix length is a integer ranges from 1 to 128. 27${ipv6_gw_addr} 2002:903:15F:32:9:3:32:1 28${prefix_length_def} None 29${invalid_staticv6_gateway} 9.41.164.1 30${new_mac_addr} AA:E2:84:14:28:79 31${linklocal_addr_format} fe80::[0-9a-f:]+$ 32${link_local_addr} fe80:: 33${link_local_prefix_len} 10 34${ipv6_leading_zero} 2001:0022:0033::0111 35${ipv6_firsthextet_zero} 2001:0022:1133::1111 36${ipv6_eliminate_zero} 2001:22:33::111 37${ipv6_eliminate_zero1} 2001:22:1133::1111 38${ipv6_contigeous_zero} 2001:0022:0000:0000:1:2:3:8 39${ipv6_zero_compression} 2001:22::1:2:3:8 40 41*** Test Cases *** 42 43Get IPv6 Address And Verify 44 [Documentation] Get IPv6 Address And Verify. 45 [Tags] Get_IPv6_Address_And_Verify 46 47 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations} 48 Verify IPv6 On BMC ${ipv6_network_configuration['Address']} 49 END 50 51 52Get PrefixLength And Verify 53 [Documentation] Get IPv6 prefix length and verify. 54 [Tags] Get_PrefixLength_And_Verify 55 56 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations} 57 Verify IPv6 On BMC ${ipv6_network_configuration['PrefixLength']} 58 END 59 60 61Get IPv6 Default Gateway And Verify 62 [Documentation] Get IPv6 default gateway and verify. 63 [Tags] Get_IPv6_Default_Gateway_And_Verify 64 65 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface} 66 ${ipv6_gateway}= Get From Dictionary ${resp.dict} IPv6DefaultGateway 67 Verify IPv6 Default Gateway On BMC ${ipv6_gateway} 68 69 70Verify All Configured IPv6 And PrefixLength On BMC 71 [Documentation] Verify IPv6 address and its prefix length on BMC. 72 [Tags] Verify_All_Configured_IPv6_And_PrefixLength_On_BMC 73 74 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations} 75 Verify IPv6 And PrefixLength ${ipv6_network_configuration['Address']} 76 ... ${ipv6_network_configuration['PrefixLength']} 77 END 78 79 80Configure IPv6 Address And Verify 81 [Documentation] Configure IPv6 address and verify. 82 [Tags] Configure_IPv6_Address_And_Verify 83 [Teardown] Run Keywords 84 ... Delete IPv6 Address ${test_ipv6_addr} AND Test Teardown Execution 85 [Template] Configure IPv6 Address On BMC 86 87 88 # IPv6 address Prefix length 89 ${test_ipv6_addr} ${test_prefix_length} 90 91 92Configure IPv6 Address On BMC And Verify On Both Interfaces 93 [Documentation] Configure IPv6 address on both interfaces and verify. 94 [Tags] Configure_IPv6_Address_On_BMC_And_Verify_On_Both_Interfaces 95 [Teardown] Run Keywords 96 ... Delete IPv6 Address ${test_ipv6_addr} ${1} 97 ... AND Delete IPv6 Address ${test_ipv6_addr1} ${2} 98 ... AND Test Teardown Execution 99 100 Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length} ${None} ${1} 101 Configure IPv6 Address On BMC ${test_ipv6_addr1} ${test_prefix_length} ${None} ${2} 102 103 Verify All The Addresses Are Intact ${1} 104 Verify All The Addresses Are Intact ${2} 105 ... ${eth1_initial_ipv4_addressorigin_list} ${eth1_initial_ipv4_addr_list} 106 107 # Verify Static IPv6 on eth0 108 @{ipv6_addressorigin_list} ${ipv6_static_addr}= 109 ... Get Address Origin List And Address For Type Static ${1} 110 Should Contain ${ipv6_addressorigin_list} Static 111 Should Not Be Empty ${ipv6_static_addr} msg=${ipv6_static_addr} address is not present 112 113 # Verify Static IPv6 on eth1 114 @{ipv6_addressorigin_list} ${ipv6_static_addr}= 115 ... Get Address Origin List And Address For Type Static ${2} 116 Should Contain ${ipv6_addressorigin_list} Static 117 Should Not Be Empty ${ipv6_static_addr} msg=${ipv6_static_addr} address is not present 118 119 120Delete IPv6 Address And Verify 121 [Documentation] Delete IPv6 address and verify. 122 [Tags] Delete_IPv6_Address_And_Verify 123 124 Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length} 125 126 Delete IPv6 Address ${test_ipv6_addr} 127 128 129Modify IPv6 Address And Verify 130 [Documentation] Modify IPv6 address and verify. 131 [Tags] Modify_IPv6_Address_And_Verify 132 [Teardown] Run Keywords 133 ... Delete IPv6 Address ${test_ipv6_addr1} AND Test Teardown Execution 134 135 Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length} 136 137 Modify IPv6 Address ${test_ipv6_addr} ${test_ipv6_addr1} ${test_prefix_length} 138 139 140Verify Persistency Of IPv6 After BMC Reboot 141 [Documentation] Verify persistency of IPv6 after BMC reboot. 142 [Tags] Verify_Persistency_Of_IPv6_After_BMC_Reboot 143 [Teardown] Run Keywords 144 ... Delete IPv6 Address ${test_ipv6_addr} AND Test Teardown Execution 145 146 Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length} 147 148 Redfish OBMC Reboot (off) stack_mode=skip 149 150 # Verifying persistency of IPv6. 151 Verify IPv6 On BMC ${test_ipv6_addr} 152 153 154Enable SLAAC On BMC And Verify 155 [Documentation] Enable SLAAC on BMC and verify. 156 [Tags] Enable_SLAAC_On_BMC_And_Verify 157 158 Set SLAAC Configuration State And Verify ${True} 159 160 161Enable DHCPv6 Property On BMC And Verify 162 [Documentation] Enable DHCPv6 property on BMC and verify. 163 [Tags] Enable_DHCPv6_Property_On_BMC_And_Verify 164 165 Set And Verify DHCPv6 Property Enabled 166 167 168Disable DHCPv6 Property On BMC And Verify 169 [Documentation] Disable DHCPv6 property on BMC and verify. 170 [Tags] Disable_DHCPv6_Property_On_BMC_And_Verify 171 172 Set And Verify DHCPv6 Property Disabled 173 174 175Verify Persistency Of DHCPv6 On Reboot 176 [Documentation] Verify persistency of DHCPv6 property on reboot. 177 [Tags] Verify_Persistency_Of_DHCPv6_On_Reboot 178 179 Set And Verify DHCPv6 Property Enabled 180 Redfish OBMC Reboot (off) stack_mode=skip 181 Verify DHCPv6 Property Enabled 182 183 184Verify Persistency Of DHCPv6 On BMC Reboot On Eth1 185 [Documentation] Verify persistency of DHCPv6 property and 186 ... all existing n/w configurations on BMC reboot on eth1. 187 [Tags] Verify_Persistency_Of_DHCPv6_On_BMC_Reboot_On_Eth1 188 [Setup] Set And Verify DHCPv6 Property Enabled ${2} 189 190 Redfish OBMC Reboot (off) stack_mode=skip 191 192 Verify DHCPv6 Property Enabled ${2} 193 194 Verify All The Addresses Are Intact ${1} 195 Verify All The Addresses Are Intact ${2} 196 ... ${eth1_initial_ipv4_addressorigin_list} ${eth1_initial_ipv4_addr_list} 197 198 199Verify Persistency Of SLAAC On BMC Reboot On Eth0 200 [Documentation] Verify persistency of SLAAC property on reboot on eth0. 201 [Tags] Verify_Persistency_Of_SLAAC_On_BMC_Reboot_On_Eth0 202 203 Set SLAAC Configuration State And Verify ${True} [${HTTP_OK}] ${1} ${False} 204 Redfish OBMC Reboot (off) stack_mode=skip 205 Verify SLAAC Property ${True} 206 207 208Verify Persistency Of SLAAC On BMC Reboot On Eth1 209 [Documentation] Verify persistency of SLAAC property on reboot on eth1. 210 [Tags] Verify_Persistency_Of_SLAAC_On_BMC_Reboot_On_Eth1 211 212 Set SLAAC Configuration State And Verify ${True} [${HTTP_OK}] ${2} ${False} 213 Redfish OBMC Reboot (off) stack_mode=skip 214 Verify SLAAC Property ${True} ${2} 215 216 217Configure Invalid Static IPv6 And Verify 218 [Documentation] Configure invalid static IPv6 and verify. 219 [Tags] Configure_Invalid_Static_IPv6_And_Verify 220 [Template] Configure IPv6 Address On BMC 221 222 #invalid_ipv6 prefix length valid_status_codes 223 ${ipv4_hexword_addr} ${test_prefix_length} valid_status_codes=${HTTP_BAD_REQUEST} 224 ${invalid_hexadec_ipv6} ${test_prefix_length} valid_status_codes=${HTTP_BAD_REQUEST} 225 ${ipv6_multi_short} ${test_prefix_length} valid_status_codes=${HTTP_BAD_REQUEST} 226 227 228Configure IPv6 Static Default Gateway And Verify 229 [Documentation] Configure IPv6 static default gateway and verify. 230 [Tags] Configure_IPv6_Static_Default_Gateway_And_Verify 231 [Template] Configure IPv6 Static Default Gateway On BMC 232 233 # static_def_gw prefix length valid_status_code 234 ${ipv6_gw_addr} ${prefix_length_def} ${HTTP_OK} 235 ${invalid_staticv6_gateway} ${test_prefix_length} ${HTTP_BAD_REQUEST} 236 237 238Modify Static Default Gateway And Verify 239 [Documentation] Modify static default gateway and verify. 240 [Tags] Modify_Static_Default_Gateway_And_Verify 241 [Setup] Configure IPv6 Static Default Gateway On BMC ${ipv6_gw_addr} ${prefix_length_def} 242 243 Modify IPv6 Static Default Gateway On BMC ${test_ipv6_addr1} ${prefix_length_def} ${HTTP_OK} ${ipv6_gw_addr} 244 245 246Delete IPv6 Static Default Gateway And Verify 247 [Documentation] Delete IPv6 static default gateway and verify. 248 [Tags] Delete_IPv6_Static_Default_Gateway_And_Verify 249 [Setup] Configure IPv6 Static Default Gateway On BMC ${ipv6_gw_addr} ${prefix_length_def} 250 251 Delete IPv6 Static Default Gateway ${ipv6_gw_addr} 252 253 254Verify Coexistence Of Linklocalv6 And Static IPv6 On BMC 255 [Documentation] Verify linklocalv6 And static IPv6 both exist. 256 [Tags] Verify_Coexistence_Of_Linklocalv6_And_Static_IPv6_On_BMC 257 [Setup] Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length} 258 [Teardown] Delete IPv6 Address ${test_ipv6_addr} 259 260 Check Coexistence Of Linklocalv6 And Static IPv6 261 262 263Verify IPv6 Linklocal Address Is In Correct Format 264 [Documentation] Verify linklocal address has network part as fe80 and 265 ... host part as EUI64. 266 [Tags] Verify_IPv6_Linklocal_Address_Is_In_Correct_Format 267 268 Check If Linklocal Address Is In Correct Format 269 270 271Verify BMC Gets SLAAC Address On Enabling SLAAC 272 [Documentation] On enabling SLAAC verify SLAAC address comes up. 273 [Tags] Verify_BMC_Gets_SLAAC_Address_On_Enabling_SLAAC 274 [Setup] Set SLAAC Configuration State And Verify ${False} 275 276 Set SLAAC Configuration State And Verify ${True} 277 Sleep ${NETWORK_TIMEOUT} 278 Check BMC Gets SLAAC Address 279 280 281Verify Enable And Disable SLAAC On Both Interfaces 282 [Documentation] Verify enable and disable SLAAC on both the interfaces. 283 [Tags] Verify_Enable_And_Disable_SLAAC_On_Both_Interfaces 284 [Setup] Get The Initial SLAAC Settings 285 [Template] Set And Verify SLAAC Property On Both Interfaces 286 [Teardown] Run Keywords Set SLAAC Configuration State And Verify ${slaac_channel_1} [${HTTP_OK}] ${1} 287 ... AND Set SLAAC Configuration State And Verify ${slaac_channel_2} [${HTTP_OK}] ${2} 288 289 # slaac_eth0 slaac_eth1 290 ${True} ${True} 291 ${True} ${False} 292 ${False} ${True} 293 ${False} ${False} 294 295 296Configure And Validate DHCPv6 Settings On Both Network Interfaces 297 [Documentation] Configure and validate the DHCPv6 enable/disable settings 298 ... on both network interfaces. 299 [Tags] Configure_And_Validate_DHCPv6_Settings_On_Both_Network_Interfaces 300 [Setup] Get The Initial DHCPv6 Settings 301 [Template] Set And Verify DHCPv6 Property On Both Interfaces 302 [Teardown] Run Keywords Set And Verify DHCPv6 Property ${dhcpv6_channel_1} ${1} AND 303 ... Set And Verify DHCPv6 Property ${dhcpv6_channel_2} ${2} 304 305 # DHCPv6_eth0 DHCPv6_eth1 306 Enabled Enabled 307 Enabled Disabled 308 Disabled Enabled 309 Disabled Disabled 310 311 312Verify Autoconfig Is Present On Ethernet Interface 313 [Documentation] Verify autoconfig is present on ethernet interface. 314 [Tags] Verify_Autoconfig_Is_Present_On_Ethernet_Interface 315 316 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface} 317 Should Contain ${resp.dict} StatelessAddressAutoConfig 318 319 320Verify Interface ID Of SLAAC And LinkLocal Addresses Are Same 321 [Documentation] Validate interface id of SLAAC and link-local addresses are same. 322 [Tags] Verify_Interface_ID_Of_SLAAC_And_LinkLocal_Addresses_Are_Same 323 324 @{ipv6_addressorigin_list} ${ipv6_linklocal_addr}= Get Address Origin List And Address For Type LinkLocal 325 @{ipv6_addressorigin_list} ${ipv6_slaac_addr}= Get Address Origin List And Address For Type SLAAC 326 327 ${linklocal_interface_id}= Get Interface ID Of IPv6 ${ipv6_linklocal_addr} 328 ${slaac_interface_id}= Get Interface ID Of IPv6 ${ipv6_slaac_addr} 329 330 Should Be Equal ${linklocal_interface_id} ${slaac_interface_id} 331 332 333Verify Persistency Of Link Local IPv6 On BMC Reboot 334 [Documentation] Verify persistency of link local on BMC reboot. 335 [Tags] Verify_Persistency_Of_Link_Local_IPv6_On_BMC_Reboot 336 337 # Capturing the linklocal before reboot. 338 @{ipv6_address_origin_list} ${linklocal_addr_before_reboot}= 339 ... Get Address Origin List And Address For Type LinkLocal 340 341 # Rebooting BMC. 342 Redfish OBMC Reboot (off) stack_mode=skip 343 344 @{ipv6_address_origin_list} ${linklocal_addr_after_reboot}= 345 ... Get Address Origin List And Address For Type LinkLocal 346 347 # Verifying the linklocal must be the same before and after reboot. 348 Should Be Equal ${linklocal_addr_before_reboot} ${linklocal_addr_after_reboot} 349 ... msg=IPv6 Linklocal address has changed after reboot. 350 351 352Modify MAC and Verify BMC Reinitializing Linklocal 353 [Documentation] Modify MAC and verify BMC reinitializing linklocal. 354 [Tags] Modify_MAC_and_Verify_BMC_Reinitializing_Linklocal 355 [Teardown] Configure MAC Settings ${original_address} 356 357 ${original_address}= Get BMC MAC Address 358 @{ipv6_addressorigin_list} ${ipv6_before_linklocal_addr}= Get Address Origin List And Address For Type LinkLocal 359 360 # Modify MAC Address Of Ethernet Interface. 361 Configure MAC Settings ${new_mac_addr} 362 Sleep 30s 363 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT} 364 @{ipv6_addressorigin_list} ${ipv6_linklocal_after_addr}= Get Address Origin List And Address For Type LinkLocal 365 366 # Verify whether the linklocal has changed and is in the the correct format. 367 Check If Linklocal Address Is In Correct Format 368 Should Not Be Equal ${ipv6_before_linklocal_addr} ${ipv6_linklocal_after_addr} 369 370 371Add Multiple IPv6 Address And Verify 372 [Documentation] Add multiple IPv6 address and verify. 373 [Tags] Add_Multiple_IPv6_Address_And_Verify 374 [Teardown] Run Keywords 375 ... Delete IPv6 Address ${test_ipv6_addr} AND Delete IPv6 Address ${test_ipv6_addr1} 376 ... AND Test Teardown Execution 377 378 Configure Multiple IPv6 Address on BMC ${test_prefix_length} 379 380 381Verify Coexistence Of Static IPv6 And SLAAC On BMC 382 [Documentation] Verify static IPv6 And SLAAC both coexist. 383 [Tags] Verify_Coexistence_Of_Static_IPv6_And_SLAAC_On_BMC 384 [Setup] Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length} 385 Set SLAAC Configuration State And Verify ${True} 386 [Teardown] Delete IPv6 Address ${test_ipv6_addr} 387 388 Sleep ${NETWORK_TIMEOUT}s 389 390 Check Coexistence Of Static IPv6 And SLAAC 391 392 393Verify Coexistence Of Link Local And DHCPv6 On BMC 394 [Documentation] Verify link local And dhcpv6 both coexist. 395 [Tags] Verify_Coexistence_Of_Link_Local_And_DHCPv6_On_BMC 396 [Setup] Set DHCPv6 Property Enabled ${2} 397 398 Sleep ${NETWORK_TIMEOUT}s 399 400 Check Coexistence Of Link Local And DHCPv6 401 402 403Verify Coexistence Of Link Local And SLAAC On BMC 404 [Documentation] Verify link local And SLAAC both coexist. 405 [Tags] Verify_Coexistence_Of_Link_Local_And_SLAAC_On_BMC 406 [Setup] Set SLAAC Configuration State And Verify ${True} 407 408 Sleep ${NETWORK_TIMEOUT}s 409 410 Check Coexistence Of Link Local And SLAAC 411 412 413Verify Coexistence Of All IPv6 Type Addresses On BMC 414 [Documentation] Verify coexistence of link local, static, DHCPv6 and SLAAC ipv6 addresses. 415 [Tags] Verify_Coexistence_Of_All_IPv6_Type_Addresses_On_BMC 416 [Setup] Run Keywords Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length} 417 ... AND Get The Initial DHCPv6 Setting On Each Interface ${1} 418 ... AND Set And Verify DHCPv6 Property Enabled 419 ... AND Get The Initial SLAAC Setting On Each Interface ${1} 420 ... AND Set SLAAC Configuration State And Verify ${True} 421 [Teardown] Run Keywords Delete IPv6 Address ${test_ipv6_addr} 422 ... AND Set And Verify DHCPv6 Property ${dhcpv6_channel_1} ${1} 423 ... AND Set SLAAC Configuration State And Verify ${slaac_channel_1} [${HTTP_OK}] ${1} 424 425 Sleep ${NETWORK_TIMEOUT}s 426 427 # Verify link local, static, DHCPv6 and SLAAC ipv6 addresses coexist. 428 Verify The Coexistence Of The Address Type LinkLocal Static DHCPv6 SLAAC 429 430 431Configure Link Local IPv6 Address And Verify 432 [Documentation] Configure link local IPv6 address and verify. 433 [Tags] Configure_Link_Local_IPv6_Address_And_Verify 434 435 Configure IPv6 Address On BMC ${link_local_addr} ${link_local_prefix_len} 436 437 # Verify the address origin contains link local. 438 @{ipv6_address_origin_list} ${ipv6_link_local_addr}= 439 ... Get Address Origin List And Address For Type LinkLocal 440 441 ${count}= Evaluate ${ipv6_address_origin_list}.count("LinkLocal") 442 443 Should Be Equal As Integers ${count} 2 444 445 446Configure Valid IPv6 Address And Verify 447 [Documentation] Configure valid IPv6 address and verify it is getting added as expected format. 448 [Tags] Configure_Valid_IPv6_Address_And_Verify 449 [Teardown] Run Keywords 450 ... Delete IPv6 Address ${ipv6_zero_compression} 451 ... AND Delete IPv6 Address ${ipv6_eliminate_zero} 452 ... AND Delete IPv6 Address ${ipv6_eliminate_zero1} 453 ... AND Test Teardown Execution 454 [Template] Configure IPv6 Address On BMC 455 456 # IPv6 address prefix length IPv6 address verified. 457 ${ipv6_contigeous_zero} ${test_prefix_length} ${ipv6_zero_compression} 458 ${ipv6_firsthextet_zero} ${test_prefix_length} ${ipv6_eliminate_zero1} 459 ${ipv6_leading_zero} ${test_prefix_length} ${ipv6_eliminate_zero} 460 461 462Verify Coexistence Of IPv6 Addresses Type Combination On BMC 463 [Documentation] Verify coexistence of IPv6 addresses type combination on BMC. 464 [Tags] Verify_Coexistence_Of_IPv6_Addresses_Type_Combination_On_BMC 465 [Setup] Run Keywords 466 ... Get The Initial DHCPv6 Setting On Each Interface ${1} 467 ... AND Get The Initial SLAAC Setting On Each Interface ${1} 468 [Teardown] Run Keywords 469 ... Set And Verify DHCPv6 Property ${dhcpv6_channel_1} ${1} 470 ... AND Set SLAAC Configuration State And Verify ${slaac_channel_1} [${HTTP_OK}] ${1} 471 [Template] Verify IPv6 Addresses Coexist 472 473 # type1 type2. 474 Static DHCPv6 475 DHCPv6 SLAAC 476 SLAAC Static 477 Static Static 478 479 480Verify Eth0 Static IPv4 Functions Properly In The Presence Of DHCPv6 481 [Documentation] Verify eth0 static IPv4 functions properly in the presence of DHCPv6. 482 [Tags] Verify_Eth0_Static_IPv4_Functions_Properly_In_The_Presence_Of_DHCPv6 483 [Setup] Set And Verify DHCPv6 Property Enabled 484 485 # Verify that on enabling DHCPv6 other configurations are not impacted. 486 Sleep ${NETWORK_TIMEOUT} 487 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT} 488 489 Verify All The Addresses Are Intact ${1} 490 Verify All The Addresses Are Intact ${2} 491 ... ${eth1_initial_ipv4_addressorigin_list} ${eth1_initial_ipv4_addr_list} 492 493 494Disable And Verify AutoConfig On Both Interfaces When AutoConfig Enabled 495 [Documentation] Enable and then disable both eth0 & eth1 with auto-config and 496 ... check both interfaces gets disabled with SLAAC. 497 [Tags] Disable_And_Verify_AutoConfig_On_Both_Interfaces_When_AutoConfig_Enabled 498 [Setup] Set And Verify SLAAC Property On Both Interfaces ${True} ${True} 499 [Template] Set And Verify SLAAC Property On Both Interfaces 500 501 # slaac_eth0 slaac_eth1. 502 ${False} ${False} 503 504 505Verify Eth1 DHCPv4 Functionality In The Presence Of Static IPv6 506 [Documentation] Verify eth1 dhcpv4 functionality in the presence of Static IPv6 507 ... and verify link local IPv6 and SLAAC. 508 ... Run on setup with DHCPv4 available on eth1. 509 [Tags] Verify_Eth1_DHCPv4_Functionality_In_The_Presence_Of_Static_IPv6 510 [Setup] Run Keywords 511 ... Set DHCPEnabled To Enable Or Disable True eth1 512 ... AND Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length} ${None} ${2} 513 ... AND Set SLAAC Configuration State And Verify ${True} [${HTTP_OK}] ${2} 514 515 # Verify presence of static IPv6 address and origin. 516 @{ipv6_address_origin_list} ${static_ipv6_addr}= 517 ... Get Address Origin List And Address For Type Static ${2} 518 Should Contain ${ipv6_address_origin_list} Static 519 Should Not Be Empty ${static_ipv6_addr} msg=${test_ipv6_addr} address is not present 520 521 # Verify presence of link local IPv6 address and origin. 522 @{ipv6_address_origin_list} ${link_local_ipv6_addr}= 523 ... Get Address Origin List And Address For Type LinkLocal ${2} 524 Should Contain ${ipv6_address_origin_list} LinkLocal 525 Should Match Regexp ${link_local_ipv6_addr} ${linklocal_addr_format} 526 Should Not Be Empty ${link_local_ipv6_addr} msg=link local IPv6 address is not present 527 528 # Verify presence of SLAAC address and origin. 529 Sleep ${NETWORK_TIMEOUT}s 530 @{ipv6_address_origin_list} ${slaac_addr}= 531 ... Get Address Origin List And Address For Type SLAAC ${2} 532 Should Contain ${ipv6_address_origin_list} SLAAC 533 Should Not Be Empty ${slaac_addr} msg=SLAAC address is not present 534 535 Verify DHCPv4 Functionality On Eth1 536 537 538Verify Eth1 DHCPv4 Functionality In The Presence Of DHCPv6 539 [Documentation] Verify eth1 dhcpv4 functionality in the presence of dhcpv6. 540 ... Run on setup with DHCPv4 available on eth1. 541 [Tags] Verify_Eth1_DHCPv4_Functionality_In_The_Presence_Of_DHCPv6 542 [Setup] Run Keywords 543 ... Set DHCPEnabled To Enable Or Disable True eth1 544 ... AND Set And Verify DHCPv6 Property Enabled ${2} 545 546 # Verify presence of DHCPv6 address and origin. 547 @{ipv6_address_origin_list} ${dhcpv6_addr}= 548 ... Get Address Origin List And Address For Type DHCPv6 ${2} 549 Should Contain ${ipv6_address_origin_list} DHCPv6 550 Should Not Be Empty ${dhcpv6_addr} msg=dhcpv6 address is not present 551 552 Verify DHCPv4 Functionality On Eth1 553 554 555Verify Static IPv4 Functionality In Presence Of Static IPv6 556 [Documentation] Verify static IPv4 functionality in presence of static IPv6. 557 [Tags] Verify_Static_IPv4_Functionality_In_Presence_Of_Static_IPv6 558 [Setup] Run Keywords 559 ... Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length} ${None} ${1} 560 ... AND Configure IPv6 Address On BMC ${test_ipv6_addr1} ${test_prefix_length} ${None} ${2} 561 [Template] Verify Static IPv4 Functionality 562 563 # Channel_number 564 ${1} 565 ${2} 566 567 568*** Keywords *** 569 570Suite Setup Execution 571 [Documentation] Do suite setup execution. 572 573 Redfish.Login 574 ${active_channel_config}= Get Active Channel Config 575 Set Suite Variable ${active_channel_config} 576 577 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']} 578 579 Set Suite variable ${ethernet_interface} 580 581 # Get initial IPv4 and IPv6 addresses and address origins for eth0. 582 ${initial_ipv4_addressorigin_list} ${initial_ipv4_addr_list}= Get Address Origin List And IPv4 or IPv6 Address IPv4Addresses 583 ${initial_ipv6_addressorigin_list} ${initial_ipv6_addr_list}= Get Address Origin List And IPv4 or IPv6 Address IPv6Addresses 584 585 Set Suite Variable ${initial_ipv4_addressorigin_list} 586 Set Suite Variable ${initial_ipv4_addr_list} 587 Set Suite Variable ${initial_ipv6_addressorigin_list} 588 Set Suite Variable ${initial_ipv6_addr_list} 589 590 # Get initial IPv4 and IPv6 addresses and address origins for eth1. 591 ${eth1_initial_ipv4_addressorigin_list} ${eth1_initial_ipv4_addr_list}= 592 ... Get Address Origin List And IPv4 or IPv6 Address IPv4Addresses ${2} 593 ${eth1_initial_ipv6_addressorigin_list} ${eth1_initial_ipv6_addr_list}= 594 ... Get Address Origin List And IPv4 or IPv6 Address IPv6Addresses ${2} 595 Set Suite Variable ${eth1_initial_ipv4_addressorigin_list} 596 Set Suite Variable ${eth1_initial_ipv4_addr_list} 597 Set Suite Variable ${eth1_initial_ipv6_addressorigin_list} 598 Set Suite Variable ${eth1_initial_ipv6_addr_list} 599 600 601Test Setup Execution 602 [Documentation] Test setup execution. 603 604 @{ipv6_network_configurations}= Get IPv6 Network Configuration 605 Set Test Variable @{ipv6_network_configurations} 606 607 # Get BMC IPv6 address and prefix length. 608 ${ipv6_data}= Get BMC IPv6 Info 609 Set Test Variable ${ipv6_data} 610 611 612Test Teardown Execution 613 [Documentation] Test teardown execution. 614 615 FFDC On Test Case Fail 616 617 618Configure Multiple IPv6 Address on BMC 619 [Documentation] Add multiple IPv6 address on BMC. 620 [Arguments] ${prefix_len} 621 ... ${valid_status_codes}=[${HTTP_OK},${HTTP_NO_CONTENT}] 622 623 # Description of argument(s): 624 # prefix_len Prefix length for the IPv6 to be added 625 # (e.g. "64"). 626 # valid_status_codes Expected return code from patch operation 627 # (e.g. "200"). 628 629 ${ipv6_list}= Create List ${test_ipv6_addr} ${test_ipv6_addr1} 630 ${prefix_length}= Convert To Integer ${prefix_len} 631 ${empty_dict}= Create Dictionary 632 ${patch_list}= Create List 633 634 # Get existing static IPv6 configurations on BMC. 635 ${ipv6_network_configurations}= Get IPv6 Network Configuration 636 ${num_entries}= Get Length ${ipv6_network_configurations} 637 638 FOR ${INDEX} IN RANGE 0 ${num_entries} 639 Append To List ${patch_list} ${empty_dict} 640 END 641 642 # We need not check for existence of IPv6 on BMC while adding. 643 FOR ${ipv6_addr} IN @{ipv6_list} 644 ${ipv6_data}= Create Dictionary Address=${ipv6_addr} PrefixLength=${prefix_length} 645 Append To List ${patch_list} ${ipv6_data} 646 END 647 ${data}= Create Dictionary IPv6StaticAddresses=${patch_list} 648 649 ${active_channel_config}= Get Active Channel Config 650 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']} 651 652 Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} body=&{data} 653 ... valid_status_codes=${valid_status_codes} 654 655 IF ${valid_status_codes} != [${HTTP_OK}, ${HTTP_NO_CONTENT}] 656 Fail msg=Static address not added correctly 657 END 658 659 # Note: Network restart takes around 15-18s after patch request processing. 660 Sleep ${NETWORK_TIMEOUT}s 661 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT} 662 663 # Verify newly added ip address on CLI. 664 FOR ${ipv6_addr} IN @{ipv6_list} 665 Verify IPv6 And PrefixLength ${ipv6_addr} ${prefix_len} 666 END 667 668 # Verify if existing static IPv6 addresses still exist. 669 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations} 670 Verify IPv6 On BMC ${ipv6_network_configuration['Address']} 671 END 672 673 # Get the latest ipv6 network configurations. 674 @{ipv6_network_configurations}= Get IPv6 Network Configuration 675 676 # Verify newly added ip address on BMC. 677 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations} 678 Should Contain Match ${ipv6_list} ${ipv6_network_configuration['Address']} 679 END 680 681 Validate IPv6 Network Config On BMC 682 683 684Validate IPv6 Network Config On BMC 685 [Documentation] Check that IPv6 network info obtained via redfish matches info 686 ... obtained via CLI. 687 688 @{ipv6_network_configurations}= Get IPv6 Network Configuration 689 ${ipv6_data}= Get BMC IPv6 Info 690 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations} 691 Should Contain Match ${ipv6_data} ${ipv6_network_configuration['Address']}/* 692 ... msg=IPv6 address does not exist. 693 END 694 695 696Delete IPv6 Address 697 [Documentation] Delete IPv6 address of BMC. 698 [Arguments] ${ipv6_addr} 699 ... ${valid_status_codes}=[${HTTP_OK},${HTTP_ACCEPTED},${HTTP_NO_CONTENT}] 700 ... ${channel_number}=${CHANNEL_NUMBER} 701 702 # Description of argument(s): 703 # ipv6_addr IPv6 address to be deleted (e.g. "2001:1234:1234:1234::1234"). 704 # channel_number Channel number (1 - eth0 and 2 - eth1). 705 # valid_status_codes Expected return code from patch operation 706 # (e.g. "200"). See prolog of rest_request 707 # method in redfish_plus.py for details. 708 709 ${empty_dict}= Create Dictionary 710 ${patch_list}= Create List 711 712 @{ipv6_network_configurations}= Get IPv6 Network Configuration ${channel_number} 713 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations} 714 IF '${ipv6_network_configuration['Address']}' == '${ipv6_addr}' 715 Append To List ${patch_list} ${null} 716 ELSE 717 Append To List ${patch_list} ${empty_dict} 718 END 719 END 720 721 ${ip_found}= Run Keyword And Return Status List Should Contain Value 722 ... ${patch_list} ${null} msg=${ipv6_addr} does not exist on BMC 723 Pass Execution If ${ip_found} == ${False} ${ipv6_addr} does not exist on BMC 724 725 # Run patch command only if given IP is found on BMC 726 ${data}= Create Dictionary IPv6StaticAddresses=${patch_list} 727 728 ${active_channel_config}= Get Active Channel Config 729 ${ethernet_interface}= Set Variable ${active_channel_config['${channel_number}']['name']} 730 731 Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} body=&{data} 732 ... valid_status_codes=${valid_status_codes} 733 734 # Note: Network restart takes around 15-18s after patch request processing 735 Sleep ${NETWORK_TIMEOUT}s 736 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT} 737 738 # IPv6 address that is deleted should not be there on BMC. 739 ${delete_status}= Run Keyword And Return Status Verify IPv6 On BMC ${ipv6_addr} 740 IF '${valid_status_codes}' == '[${HTTP_OK},${HTTP_ACCEPTED},${HTTP_NO_CONTENT}]' 741 Should Be True '${delete_status}' == '${False}' 742 ELSE 743 Should Be True '${delete_status}' == '${True}' 744 END 745 746 Validate IPv6 Network Config On BMC 747 748 749Modify IPv6 Address 750 [Documentation] Modify and verify IPv6 address of BMC. 751 [Arguments] ${ipv6} ${new_ipv6} ${prefix_len} 752 ... ${valid_status_codes}=[${HTTP_OK}, ${HTTP_NO_CONTENT}] 753 754 # Description of argument(s): 755 # ipv6 IPv6 address to be replaced (e.g. "2001:AABB:CCDD::AAFF"). 756 # new_ipv6 New IPv6 address to be configured. 757 # prefix_len Prefix length value (Range 1 to 128). 758 # valid_status_codes Expected return code from patch operation 759 # (e.g. "200", "201"). 760 761 ${empty_dict}= Create Dictionary 762 ${patch_list}= Create List 763 ${prefix_length}= Convert To Integer ${prefix_len} 764 ${ipv6_data}= Create Dictionary 765 ... Address=${new_ipv6} PrefixLength=${prefix_length} 766 767 # Sample IPv6 network configurations: 768 # "IPv6AddressPolicyTable": [], 769 # "IPv6Addresses": [ 770 # { 771 # "Address": "X002:db8:0:2::XX0", 772 # "AddressOrigin": "DHCPv6", 773 # "PrefixLength": 128 774 # }, 775 # { 776 # "Address": “X002:db8:0:2:a94:XXff:fe82:XXXX", 777 # "AddressOrigin": "SLAAC", 778 # "PrefixLength": 64 779 # }, 780 # { 781 # "Address": “Y002:db8:0:2:a94:efff:fe82:5000", 782 # "AddressOrigin": "Static", 783 # "PrefixLength": 56 784 # }, 785 # { 786 # "Address": “Z002:db8:0:2:a94:efff:fe82:5000", 787 # "AddressOrigin": "Static", 788 # "PrefixLength": 56 789 # }, 790 # { 791 # "Address": “Xe80::a94:efff:YYYY:XXXX", 792 # "AddressOrigin": "LinkLocal", 793 # "PrefixLength": 64 794 # }, 795 # { 796 # "Address": “X002:db8:1:2:eff:233:fee:546", 797 # "AddressOrigin": "Static", 798 # "PrefixLength": 56 799 # } 800 # ], 801 # "IPv6DefaultGateway": “XXXX::ab2e:80fe:87df:XXXX”, 802 # "IPv6StaticAddresses": [ 803 # { 804 # "Address": “X002:db8:0:2:a94:efff:fe82:5000", 805 # "PrefixLength": 56 806 # }, 807 # { 808 # "Address": “Y002:db8:0:2:a94:efff:fe82:5000", 809 # "PrefixLength": 56 810 # }, 811 # { 812 # "Address": “Z002:db8:1:2:eff:233:fee:546", 813 # "PrefixLength": 56 814 # } 815 # ], 816 # "IPv6StaticDefaultGateways": [], 817 818 # Find the position of IPv6 address to be modified. 819 @{ipv6_network_configurations}= Get IPv6 Network Configuration 820 FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations} 821 IF '${ipv6_network_configuration['Address']}' == '${ipv6}' 822 Append To List ${patch_list} ${ipv6_data} 823 ELSE 824 Append To List ${patch_list} ${empty_dict} 825 END 826 END 827 828 # Modify the IPv6 address only if given IPv6 is found 829 ${ip_found}= Run Keyword And Return Status List Should Contain Value 830 ... ${patch_list} ${ipv6_data} msg=${ipv6} does not exist on BMC 831 Pass Execution If ${ip_found} == ${False} ${ipv6} does not exist on BMC 832 833 ${data}= Create Dictionary IPv6StaticAddresses=${patch_list} 834 835 ${active_channel_config}= Get Active Channel Config 836 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']} 837 838 Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} 839 ... body=&{data} valid_status_codes=${valid_status_codes} 840 841 # Note: Network restart takes around 15-18s after patch request processing. 842 Sleep ${NETWORK_TIMEOUT}s 843 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT} 844 845 # Verify if new IPv6 address is configured on BMC. 846 Verify IPv6 On BMC ${new_ipv6} 847 848 # Verify if old IPv6 address is erased. 849 ${cmd_status}= Run Keyword And Return Status 850 ... Verify IPv6 On BMC ${ipv6} 851 Should Be Equal ${cmd_status} ${False} msg=Old IPv6 address is not deleted. 852 853 Validate IPv6 Network Config On BMC 854 855 856Set SLAAC Configuration State And Verify 857 [Documentation] Set SLAAC configuration state. 858 [Arguments] ${slaac_state} ${valid_status_codes}=[${HTTP_OK},${HTTP_ACCEPTED},${HTTP_NO_CONTENT}] 859 ... ${channel_number}=${CHANNEL_NUMBER} ${is_slaac_verify_state}=${True} 860 861 # Description of argument(s): 862 # slaac_state SLAAC state('True' or 'False'). 863 # valid_status_code Expected valid status codes. 864 # channel_number Channel number 1(eth0) or 2(eth1). 865 # is_slaac_verify_state Flag to check verification is required. 866 867 ${active_channel_config}= Get Active Channel Config 868 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']} 869 870 ${data}= Set Variable If ${slaac_state} == ${False} ${DISABLE_SLAAC} ${ENABLE_SLAAC} 871 ${resp}= Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} 872 ... body=${data} valid_status_codes=${valid_status_codes} 873 IF ${is_slaac_verify_state} 874 Verify SLAAC Property ${slaac_state} ${channel_number} 875 END 876 877 878Verify SLAAC Property 879 [Documentation] Verify SLAAC property. 880 [Arguments] ${slaac_state} ${channel_number}=${CHANNEL_NUMBER} 881 882 # Description of argument(s): 883 # slaac_state SLAAC state('True' or 'False'). 884 # channel_number Channel number 1(eth0) or 2(eth1). 885 886 # Verify SLAAC is set correctly. 887 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface} 888 ${slaac_verify}= Get From Dictionary ${resp.dict} StatelessAddressAutoConfig 889 890 IF '${slaac_verify['IPv6AutoConfigEnabled']}' != '${slaac_state}' 891 Fail msg=SLAAC not set properly. 892 END 893 894 895Set And Verify DHCPv6 Property 896 [Documentation] Set DHCPv6 property and verify. 897 [Arguments] ${dhcpv6_operating_mode}=${Disabled} ${channel_number}=${CHANNEL_NUMBER} 898 899 # Description of argument(s): 900 # dhcpv6_operating_mode Enabled if user wants to enable DHCPv6('Enabled' or 'Disabled'). 901 # channel_number Channel number 1 or 2. 902 903 Set DHCPv6 Property ${dhcpv6_operating_mode} ${channel_number} 904 Verify DHCPv6 Property ${dhcpv6_operating_mode} ${channel_number} 905 906 907Set DHCPv6 Property 908 [Documentation] Set DHCPv6 attribute is enables or disabled. 909 [Arguments] ${dhcpv6_operating_mode}=${Disabled} ${channel_number}=${CHANNEL_NUMBER} 910 911 # Description of argument(s): 912 # dhcpv6_operating_mode Enabled if user wants to enable DHCPv6('Enabled' or 'Disabled'). 913 # channel_number Channel number 1 or 2. 914 915 ${data}= Set Variable If '${dhcpv6_operating_mode}' == 'Disabled' ${DISABLE_DHCPv6} ${ENABLE_DHCPv6} 916 ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']} 917 918 Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} 919 ... body=${data} valid_status_codes=[${HTTP_OK},${HTTP_NO_CONTENT}] 920 921 922Verify DHCPv6 Property 923 [Documentation] Verify DHCPv6 settings is enabled or disabled. 924 [Arguments] ${dhcpv6_operating_mode} ${channel_number}=${CHANNEL_NUMBER} 925 926 # Description of Argument(s): 927 # dhcpv6_operating_mode Enable/ Disable DHCPv6. 928 # channel_number Channel number 1 or 2. 929 930 ${ethernet_interface}= Set Variable ${active_channel_config['${channel_number}']['name']} 931 932 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface} 933 ${dhcpv6_verify}= Get From Dictionary ${resp.dict} DHCPv6 934 935 Should Be Equal '${dhcpv6_verify['OperatingMode']}' '${dhcpv6_operating_mode}' 936 937 Sleep 30s 938 939 @{ipv6_addressorigin_list} ${ipv6_dhcpv6_addr}= 940 ... Get Address Origin List And IPv4 or IPv6 Address IPv6Addresses ${channel_number} 941 942 IF "${dhcpv6_operating_mode}" == "Enabled" 943 @{ipv6_addressorigin_list} ${ipv6_dhcpv6_addr}= 944 ... Get Address Origin List And Address For Type DHCPv6 ${channel_number} 945 Should Not Be Empty ${ipv6_dhcpv6_addr} msg=DHCPv6 must be present. 946 ELSE 947 Should Not Contain ${ipv6_addressorigin_list} DHCPv6 948 END 949 950 951 952Get IPv6 Static Default Gateway 953 [Documentation] Get IPv6 static default gateway. 954 955 ${active_channel_config}= Get Active Channel Config 956 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${active_channel_config['${CHANNEL_NUMBER}']['name']} 957 958 @{ipv6_static_defgw_configurations}= Get From Dictionary ${resp.dict} IPv6StaticDefaultGateways 959 RETURN @{ipv6_static_defgw_configurations} 960 961 962Configure IPv6 Static Default Gateway On BMC 963 [Documentation] Configure IPv6 static default gateway on BMC. 964 [Arguments] ${ipv6_gw_addr} ${prefix_length_def} 965 ... ${valid_status_codes}=${HTTP_OK} 966 967 # Description of argument(s): 968 # ipv6_gw_addr IPv6 Static Default Gateway address to be configured. 969 # prefix_len_def Prefix length value (Range 1 to 128). 970 # valid_status_codes Expected return code from patch operation 971 # (e.g. "200", "204".) 972 973 # Prefix Length is passed as None. 974 IF '${prefix_length_def}' == '${None}' 975 ${ipv6_gw}= Create Dictionary Address=${ipv6_gw_addr} 976 ELSE 977 ${ipv6_gw}= Create Dictionary Address=${ipv6_gw_addr} Prefix Length=${prefix_length_def} 978 END 979 980 ${ipv6_static_def_gw}= Get IPv6 Static Default Gateway 981 982 ${num_entries}= Get Length ${ipv6_static_def_gw} 983 984 ${patch_list}= Create List 985 ${empty_dict}= Create Dictionary 986 987 FOR ${INDEX} IN RANGE 0 ${num_entries} 988 Append To List ${patch_list} ${empty_dict} 989 END 990 991 ${valid_status_codes}= Set Variable If '${valid_status_codes}' == '${HTTP_OK}' 992 ... ${HTTP_OK},${HTTP_NO_CONTENT} 993 ... ${valid_status_codes} 994 995 Append To List ${patch_list} ${ipv6_gw} 996 ${data}= Create Dictionary IPv6StaticDefaultGateways=${patch_list} 997 998 Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} 999 ... body=${data} valid_status_codes=[${valid_status_codes}] 1000 1001 # Verify the added static default gateway is present in Redfish Get Output. 1002 ${ipv6_staticdef_gateway}= Get IPv6 Static Default Gateway 1003 1004 ${ipv6_static_def_gw_list}= Create List 1005 FOR ${ipv6_staticdef_gateway} IN @{ipv6_staticdef_gateway} 1006 ${value}= Get From Dictionary ${ipv6_staticdef_gateway} Address 1007 Append To List ${ipv6_static_def_gw_list} ${value} 1008 END 1009 1010 IF '${valid_status_codes}' != '${HTTP_OK},${HTTP_NO_CONTENT}' 1011 Should Not Contain ${ipv6_static_def_gw_list} ${ipv6_gw_addr} 1012 ELSE 1013 Should Contain ${ipv6_static_def_gw_list} ${ipv6_gw_addr} 1014 END 1015 1016 1017Modify IPv6 Static Default Gateway On BMC 1018 [Documentation] Modify and verify IPv6 address of BMC. 1019 [Arguments] ${ipv6_gw_addr} ${new_static_def_gw} ${prefix_length} 1020 ... ${valid_status_codes}=[${HTTP_OK},${HTTP_ACCEPTED}] 1021 1022 # Description of argument(s): 1023 # ipv6_gw_addr IPv6 static default gateway address to be replaced (e.g. "2001:AABB:CCDD::AAFF"). 1024 # new_static_def_gw New static default gateway address to be configured. 1025 # prefix_length Prefix length value (Range 1 to 128). 1026 # valid_status_codes Expected return code from patch operation 1027 # (e.g. "200", "204"). 1028 1029 ${empty_dict}= Create Dictionary 1030 ${patch_list}= Create List 1031 # Prefix Length is passed as None. 1032 IF '${prefix_length_def}' == '${None}' 1033 ${modified_ipv6_gw_addripv6_data}= Create Dictionary Address=${new_static_def_gw} 1034 ELSE 1035 ${modified_ipv6_gw_addripv6_data}= Create Dictionary Address=${new_static_def_gw} Prefix Length=${prefix_length_def} 1036 END 1037 1038 @{ipv6_static_def_gw_list}= Get IPv6 Static Default Gateway 1039 1040 FOR ${ipv6_static_def_gw} IN @{ipv6_static_def_gw_list} 1041 IF '${ipv6_static_def_gw['Address']}' == '${ipv6_gw_addr}' 1042 Append To List ${patch_list} ${modified_ipv6_gw_addripv6_data} 1043 ELSE 1044 Append To List ${patch_list} ${empty_dict} 1045 END 1046 END 1047 1048 # Modify the IPv6 address only if given IPv6 static default gateway is found. 1049 ${ip_static_def_gw_found}= Run Keyword And Return Status List Should Contain Value 1050 ... ${patch_list} ${modified_ipv6_gw_addripv6_data} msg=${ipv6_gw_addr} does not exist on BMC 1051 Pass Execution If ${ip_static_def_gw_found} == ${False} ${ipv6_gw_addr} does not exist on BMC 1052 1053 ${data}= Create Dictionary IPv6StaticDefaultGateways=${patch_list} 1054 1055 Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} 1056 ... body=&{data} valid_status_codes=${valid_status_codes} 1057 1058 ${ipv6_staticdef_gateway}= Get IPv6 Static Default Gateway 1059 1060 ${ipv6_static_def_gw_list}= Create List 1061 FOR ${ipv6_staticdef_gateway} IN @{ipv6_staticdef_gateway} 1062 ${value}= Get From Dictionary ${ipv6_staticdef_gateway} Address 1063 Append To List ${ipv6_static_def_gw_list} ${value} 1064 END 1065 1066 Should Contain ${ipv6_static_def_gw_list} ${new_static_def_gw} 1067 # Verify if old static default gateway address is erased. 1068 Should Not Contain ${ipv6_static_def_gw_list} ${ipv6_gw_addr} 1069 1070 1071Delete IPv6 Static Default Gateway 1072 [Documentation] Delete IPv6 static default gateway on BMC. 1073 [Arguments] ${ipv6_gw_addr} 1074 ... ${valid_status_codes}=[${HTTP_OK},${HTTP_ACCEPTED},${HTTP_NO_CONTENT}] 1075 1076 # Description of argument(s): 1077 # ipv6_gw_addr IPv6 Static Default Gateway address to be deleted. 1078 # valid_status_codes Expected return code from patch operation 1079 # (e.g. "200"). 1080 1081 ${patch_list}= Create List 1082 ${empty_dict}= Create Dictionary 1083 1084 ${ipv6_static_def_gw_list}= Create List 1085 @{ipv6_static_defgw_configurations}= Get IPv6 Static Default Gateway 1086 1087 FOR ${ipv6_staticdef_gateway} IN @{ipv6_static_defgw_configurations} 1088 ${value}= Get From Dictionary ${ipv6_staticdef_gateway} Address 1089 Append To List ${ipv6_static_def_gw_list} ${value} 1090 END 1091 1092 ${defgw_found}= Run Keyword And Return Status List Should Contain Value 1093 ... ${ipv6_static_def_gw_list} ${ipv6_gw_addr} msg=${ipv6_gw_addr} does not exist on BMC 1094 Skip If ${defgw_found} == ${False} ${ipv6_gw_addr} does not exist on BMC 1095 1096 FOR ${ipv6_static_def_gw} IN @{ipv6_static_defgw_configurations} 1097 IF '${ipv6_static_def_gw['Address']}' == '${ipv6_gw_addr}' 1098 Append To List ${patch_list} ${null} 1099 ELSE 1100 Append To List ${patch_list} ${empty_dict} 1101 END 1102 END 1103 1104 # Run patch command only if given IP is found on BMC. 1105 ${data}= Create Dictionary IPv6StaticDefaultGateways=${patch_list} 1106 1107 Redfish.Patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} body=&{data} 1108 ... valid_status_codes=${valid_status_codes} 1109 1110 ${data}= Create Dictionary IPv6StaticDefaultGateways=${patch_list} 1111 1112 @{ipv6_static_defgw_configurations}= Get IPv6 Static Default Gateway 1113 Should Not Contain Match ${ipv6_static_defgw_configurations} ${ipv6_gw_addr} 1114 ... msg=IPv6 Static default gateway does not exist. 1115 1116 1117Check Coexistence Of Linklocalv6 And Static IPv6 1118 [Documentation] Verify both linklocalv6 and static IPv6 exist. 1119 1120 # Verify the address origin contains static and linklocal. 1121 @{ipv6_addressorigin_list} ${ipv6_linklocal_addr}= Get Address Origin List And Address For Type LinkLocal 1122 1123 Should Match Regexp ${ipv6_linklocal_addr} ${linklocal_addr_format} 1124 Should Contain ${ipv6_addressorigin_list} Static 1125 1126 1127Check Coexistence Of Static IPv6 And SLAAC 1128 [Documentation] Verify both static IPv6 and SLAAC coexist. 1129 1130 # Verify the address origin contains static and slaac. 1131 @{ipv6_addressorigin_list} ${ipv6_static_addr}= 1132 ... Get Address Origin List And Address For Type Static 1133 1134 @{ipv6_addressorigin_list} ${ipv6_slaac_addr}= 1135 ... Get Address Origin List And Address For Type SLAAC 1136 1137 1138Check Coexistence Of Link Local And SLAAC 1139 [Documentation] Verify both link local and SLAAC coexist. 1140 1141 # Verify the address origin contains SLAAC and link local. 1142 @{ipv6_addressorigin_list} ${ipv6_link_local_addr}= 1143 ... Get Address Origin List And Address For Type LinkLocal 1144 1145 @{ipv6_addressorigin_list} ${ipv6_slaac_addr}= 1146 ... Get Address Origin List And Address For Type SLAAC 1147 1148 Should Match Regexp ${ipv6_link_local_addr} ${linklocal_addr_format} 1149 1150 1151Check Coexistence Of Link Local And DHCPv6 1152 [Documentation] Verify both link local and dhcpv6 coexist. 1153 1154 # Verify the address origin contains dhcpv6 and link local. 1155 @{ipv6_address_origin_list} ${ipv6_link_local_addr}= 1156 ... Get Address Origin List And Address For Type LinkLocal 1157 1158 @{ipv6_address_origin_list} ${ipv6_dhcpv6_addr}= 1159 ... Get Address Origin List And Address For Type DHCPv6 1160 1161 Should Match Regexp ${ipv6_link_local_addr} ${linklocal_addr_format} 1162 1163 1164Check If Linklocal Address Is In Correct Format 1165 [Documentation] Linklocal address has network part fe80 and host part EUI64. 1166 1167 # Fetch the linklocal address. 1168 @{ipv6_addressorigin_list} ${ipv6_linklocal_addr}= Get Address Origin List And Address For Type LinkLocal 1169 1170 # Follow EUI64 from MAC. 1171 ${system_mac}= Get BMC MAC Address 1172 ${split_octets}= Split String ${system_mac} : 1173 ${first_octet}= Evaluate int('${split_octets[0]}', 16) 1174 ${flipped_hex}= Evaluate format(${first_octet} ^ 2, '02x') 1175 ${grp1}= Evaluate re.sub(r'^0+', '', '${flipped_hex}${split_octets[1]}') modules=re 1176 ${grp2}= Evaluate re.sub(r'^0+', '', '${split_octets[2]}ff') modules=re 1177 ${grp3}= Evaluate re.sub(r'^0+', '', '${split_octets[4]}${split_octets[5]}') modules=re 1178 ${linklocal}= Set Variable fe80::${grp1}:${grp2}:fe${split_octets[3]}:${grp3} 1179 1180 # Verify the linklocal obtained is the same as on the machine. 1181 Should Be Equal ${linklocal} ${ipv6_linklocal_addr} 1182 1183 1184Check BMC Gets SLAAC Address 1185 [Documentation] Check BMC gets slaac address. 1186 1187 @{ipv6_addressorigin_list} ${ipv6_slaac_addr}= Get Address Origin List And Address For Type SLAAC 1188 1189 1190Get The Initial DHCPv6 Setting On Each Interface 1191 [Documentation] Get the initial DHCPv6 setting of each interface. 1192 [Arguments] ${channel_number} 1193 1194 # Description of the argument(s): 1195 # channel_number Channel number 1 or 2. 1196 1197 ${ethernet_interface}= Set Variable ${active_channel_config['${channel_number}']['name']} 1198 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface} 1199 ${initial_dhcpv6_iface}= Get From Dictionary ${resp.dict} DHCPv6 1200 IF ${channel_number}==${1} 1201 Set Test Variable ${dhcpv6_channel_1} ${initial_dhcpv6_iface['OperatingMode']} 1202 ELSE 1203 Set Test Variable ${dhcpv6_channel_2} ${initial_dhcpv6_iface['OperatingMode']} 1204 END 1205 1206 1207Get The Initial DHCPv6 Settings 1208 [Documentation] Get the initial DHCPv6 settings of both the interfaces. 1209 1210 Get The Initial DHCPv6 Setting On Each Interface ${1} 1211 Get The Initial DHCPv6 Setting On Each Interface ${2} 1212 1213 1214Get The Initial SLAAC Settings 1215 [Documentation] Get the initial SLAAC settings of both the interfaces. 1216 1217 Get The Initial SLAAC Setting On Each Interface ${1} 1218 Get The Initial SLAAC Setting On Each Interface ${2} 1219 1220 1221Get The Initial SLAAC Setting On Each Interface 1222 [Documentation] Get the initial SLAAC setting of the interface. 1223 [Arguments] ${channel_number} 1224 1225 # Description of the argument(s): 1226 # channel_number Channel number 1 or 2. 1227 1228 ${ethernet_interface}= Set Variable ${active_channel_config['${channel_number}']['name']} 1229 ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface} 1230 ${initial_slaac_iface}= Get From Dictionary ${resp.dict} StatelessAddressAutoConfig 1231 IF ${channel_number}==${1} 1232 Set Test Variable ${slaac_channel_1} ${initial_slaac_iface['IPv6AutoConfigEnabled']} 1233 ELSE 1234 Set Test Variable ${slaac_channel_2} ${initial_slaac_iface['IPv6AutoConfigEnabled']} 1235 END 1236 1237 1238Verify All The Addresses Are Intact 1239 [Documentation] Verify all the addresses and address origins remain intact. 1240 [Arguments] ${channel_number}=${CHANNEL_NUMBER} 1241 ... ${initial_ipv4_addressorigin_list}=${initial_ipv4_addressorigin_list} 1242 ... ${initial_ipv4_addr_list}=${initial_ipv4_addr_list} 1243 1244 # Description of argument(s): 1245 # channel_number Channel number 1(eth0) or 2(eth1). 1246 # initial_ipv4_addressorigin_list Initial IPv4 address origin list. 1247 # initial_ipv4_addr_list Initial IPv4 address list. 1248 1249 # Verify that it will not impact the IPv4 configuration. 1250 Sleep ${NETWORK_TIMEOUT} 1251 Wait For Host To Ping ${OPENBMC_HOST} ${NETWORK_TIMEOUT} 1252 1253 # IPv6 Linklocal address must be present. 1254 @{ipv6_addressorigin_list} ${ipv6_linklocal_addr}= 1255 ... Get Address Origin List And Address For Type LinkLocal ${channel_number} 1256 1257 # IPv4 addresses must remain intact. 1258 ${ipv4_addressorigin_list} ${ipv4_addr_list}= 1259 ... Get Address Origin List And IPv4 or IPv6 Address IPv4Addresses ${channel_number} 1260 1261 Should be Equal ${initial_ipv4_addressorigin_list} ${ipv4_addressorigin_list} 1262 Should be Equal ${initial_ipv4_addr_list} ${ipv4_addr_list} 1263 1264 1265Get Interface ID Of IPv6 1266 [Documentation] Get interface id of IPv6 address. 1267 [Arguments] ${ipv6_address} 1268 1269 # Description of the argument(s): 1270 # ${ipv6_address} IPv6 Address to extract the last 4 hextets. 1271 1272 # Last 64 bits of SLAAC and Linklocal must be the same. 1273 # Sample IPv6 network configurations. 1274 #"IPv6AddressPolicyTable": [], 1275 # "IPv6Addresses": [ 1276 # { 1277 # "Address": "fe80::xxxx:xxxx:xxxx:xxxx", 1278 # "AddressOrigin": "LinkLocal", 1279 # "AddressState": null, 1280 # "PrefixLength": xx 1281 # } 1282 # ], 1283 # { 1284 # "Address": "2002:xxxx:xxxx:xxxx:xxxx", 1285 # "AddressOrigin": "SLAAC", 1286 # "PrefixLength": 64 1287 # } 1288 # ], 1289 1290 ${split_ip_address}= Split String ${ipv6_address} : 1291 ${missing_ip}= Evaluate 8 - len(${split_ip_address}) + 1 1292 ${expanded_ip}= Create List 1293 1294 FOR ${hextet} IN @{split_ip_address} 1295 IF '${hextet}' == '' 1296 FOR ${i} IN RANGE ${missing_ip} 1297 Append To List ${expanded_ip} 0000 1298 END 1299 ELSE 1300 Append To List ${expanded_ip} ${hextet} 1301 END 1302 END 1303 ${interface_id}= Evaluate ':'.join(${expanded_ip}[-4:]) 1304 RETURN ${interface_id} 1305 1306 1307Set And Verify SLAAC Property On Both Interfaces 1308 [Documentation] Set and verify SLAAC property on both interfaces. 1309 [Arguments] ${slaac_value_1} ${slaac_value_2} 1310 1311 # Description of the argument(s): 1312 # slaac_value_1 SLAAC value for channel 1. 1313 # slaac_value_2 SLAAC value for channel 2. 1314 1315 Set SLAAC Configuration State And Verify ${slaac_value_1} [${HTTP_OK}] ${1} 1316 Set SLAAC Configuration State And Verify ${slaac_value_2} [${HTTP_OK}] ${2} 1317 1318 Sleep 30s 1319 1320 # Check SLAAC Settings for eth0. 1321 @{ipv6_addressorigin_list} ${ipv6_slaac_addr}= 1322 ... Get Address Origin List And IPv4 or IPv6 Address IPv6Addresses ${1} 1323 IF "${slaac_value_1}" == "${True}" 1324 Should Not Be Empty ${ipv6_slaac_addr} SLAAC 1325 ELSE 1326 Should Not Contain ${ipv6_addressorigin_list} SLAAC 1327 END 1328 1329 # Check SLAAC Settings for eth1. 1330 @{ipv6_addressorigin_list} ${ipv6_slaac_addr}= 1331 ... Get Address Origin List And IPv4 or IPv6 Address IPv6Addresses ${2} 1332 IF "${slaac_value_2}" == "${True}" 1333 Should Not Be Empty ${ipv6_slaac_addr} SLAAC 1334 ELSE 1335 Should Not Contain ${ipv6_addressorigin_list} SLAAC 1336 END 1337 1338 Verify All The Addresses Are Intact ${1} 1339 Verify All The Addresses Are Intact ${2} 1340 ... ${eth1_initial_ipv4_addressorigin_list} ${eth1_initial_ipv4_addr_list} 1341 1342 1343Set And Verify DHCPv6 Property On Both Interfaces 1344 [Documentation] Set and verify DHCPv6 property on both interfaces. 1345 [Arguments] ${dhcpv6_value_1} ${dhcpv6_value_2} 1346 1347 # Description of the argument(s): 1348 # dhcpv6_value_1 DHCPv6 value for channel 1. 1349 # dhcpv6_value_2 DHCPv6 value for channel 2. 1350 1351 Set And Verify DHCPv6 Property ${dhcpv6_value_1} ${1} 1352 Set And Verify DHCPv6 Property ${dhcpv6_value_2} ${2} 1353 1354 Verify All The Addresses Are Intact ${1} 1355 Verify All The Addresses Are Intact ${2} 1356 ... ${eth1_initial_ipv4_addressorigin_list} ${eth1_initial_ipv4_addr_list} 1357 1358 1359Verify IPv6 Addresses Coexist 1360 [Documentation] Verify IPv6 address type coexist. 1361 [Arguments] ${ipv6_address_type1} ${ipv6_address_type2} 1362 1363 # Description of the argument(s): 1364 # ipv6_address_type1 IPv6 address type. 1365 # ipv6_address_type2 IPv6 address type. 1366 # Valid IPv6 address type (Static, DHCPv6, SLAAC). 1367 1368 IF '${ipv6_address_type1}' == 'Static' and '${ipv6_address_type2}' == 'DHCPv6' 1369 Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length} 1370 Set And Verify DHCPv6 Property Enabled 1371 ELSE IF '${ipv6_address_type1}' == 'DHCPv6' and '${ipv6_address_type2}' == 'SLAAC' 1372 Set And Verify DHCPv6 Property Enabled 1373 Set SLAAC Configuration State And Verify ${True} 1374 ELSE IF '${ipv6_address_type1}' == 'SLAAC' and '${ipv6_address_type2}' == 'Static' 1375 Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length} 1376 Set SLAAC Configuration State And Verify ${True} 1377 ELSE IF '${ipv6_address_type1}' == 'Static' and '${ipv6_address_type2}' == 'Static' 1378 Configure IPv6 Address On BMC ${test_ipv6_addr} ${test_prefix_length} 1379 Configure IPv6 Address On BMC ${test_ipv6_addr1} ${test_prefix_length} 1380 END 1381 1382 Sleep ${NETWORK_TIMEOUT}s 1383 1384 # Verify coexistence. 1385 Verify The Coexistence Of The Address Type ${ipv6_address_type1} ${ipv6_address_type2} 1386 1387 IF '${ipv6_address_type1}' == 'Static' or '${ipv6_address_type2}' == 'Static' 1388 Delete IPv6 Address ${test_ipv6_addr} 1389 END 1390 IF '${ipv6_address_type1}' == 'Static' and '${ipv6_address_type2}' == 'Static' 1391 Delete IPv6 Address ${test_ipv6_addr1} 1392 END 1393 1394 Set And Verify DHCPv6 Property Disabled 1395 Set SLAAC Configuration State And Verify ${False} 1396 1397 1398Verify DHCPv4 Functionality On Eth1 1399 [Documentation] Verify DHCPv4 functions are present as expected on eth1. 1400 1401 # Verify eth1 DHCPv4 is enabled. 1402 ${DHCPEnabled}= Get IPv4 DHCP Enabled Status ${2} 1403 Should Be Equal ${DHCPEnabled} ${True} 1404 1405 # Verify presence of DHCPv4 address origin. 1406 @{ipv4_addressorigin_list} ${ipv4_addr_list}= 1407 ... Get Address Origin List And IPv4 or IPv6 Address IPv4Addresses ${2} 1408 ${ipv4_addressorigin_list}= Combine Lists @{ipv4_addressorigin_list} 1409 Should Contain ${ipv4_addressorigin_list} DHCP 1410 1411 # Verify static is not present in address origin when DHPCv4 enabled. 1412 List Should Not Contain Value ${ipv4_addressorigin_list} Static 1413 1414 1415Verify Static IPv4 Functionality 1416 [Documentation] Verify static IPv4 functionality. 1417 [Arguments] ${channel_number}=${CHANNEL_NUMBER} 1418 1419 # Description of argument(s): 1420 # channel_number Channel number 1(eth0) or 2(eth1). 1421 1422 # Verify presence of Static IPv4 address origin. 1423 @{ipv4_addressorigin_list} ${ipv4_addr_list}= 1424 ... Get Address Origin List And IPv4 or IPv6 Address IPv4Addresses ${channel_number} 1425 ${ipv4_addressorigin_list}= Combine Lists @{ipv4_addressorigin_list} 1426 Should Contain ${ipv4_addressorigin_list} Static 1427 1428 # Verify dhcpv4 is not present in address origin when static IPv4 enabled. 1429 List Should Not Contain Value ${ipv4_addressorigin_list} DHCP 1430 1431 # Verify Static IPv4 address is pingable. 1432 FOR ${ip} IN @{ipv4_addr_list} 1433 Wait For Host To Ping ${ip} ${NETWORK_TIMEOUT} 1434 END 1435