-
Notifications
You must be signed in to change notification settings - Fork 750
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support 2 vlans test in test_acl dynamically (#16551)
What is the motivation for this PR? In pytest_generate_tests hook, depends on how many vlan interfaces in topo file, it parametrizes vlan_name dynamically before testing. It doesn't need to use hardcode to check the topo name then set vlan_name. It's not flexible. How did you do it? In this PR, Add t0-118 topo which has 2 vlan config by default. In test_acl, will choose vlan ip range and rule id separately. If default_vlan_config == two_vlan_a, the IP range should choose DOWNSTREAM_DST_IP_VLAN and DOWNSTREAM_DST_IP_VLAN2000 separately for each vlan. And also chooses different rule id in case test_dest_ip_match_forwarded and test_dest_ip_match_dropped for 2 vlan config. How did you verify/test it? verified on two vlan testbed on 202405 image, 384 all passed -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html -------------------------------------------------------------------------------------------------- live log sessionfinish --------------------------------------------------------------------------------------------------- 12:46:19 __init__.pytest_terminal_summary L0067 INFO | Can not get Allure report URL. Please check logs =============================================================================== 384 passed, 1216 skipped, 1545 warnings in 4036.92s (1:07:16) =============================================================================== DEBUG:tests.conftest:[log_custom_msg] item: <Function test_icmp_match_forwarded[ipv6-ingress-uplink->downlink-default-Vlan2000]> Also verified on one vlan testbed on 202405 image, 192 all passed ================================================================================ 192 passed, 608 skipped, 777 warnings in 2099.37s (0:34:59) ================================================================================ DEBUG:tests.conftest:[log_custom_msg] item: <Function test_icmp_match_forwarded[ipv6-ingress-uplink->downlink-default-Vlan1000]> DEBUG:tests.conftest:append custom_msg: {'dut_check_result': {'core_dump_check_pass': True, 'config_db_check_pass': False}} INFO:root:Can not get Allure report URL. Please check logs zhaohuisun@sonic-mgmt-zhaohuisun:/data/sonic-mgmt-int/tests$
- Loading branch information
Showing
8 changed files
with
361 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
t0-leaf-lag-2.j2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,294 @@ | ||
topology: | ||
host_interfaces: | ||
- 0 | ||
- 1 | ||
- 2 | ||
- 3 | ||
- 4 | ||
- 5 | ||
- 6 | ||
- 7 | ||
- 8 | ||
- 9 | ||
- 10 | ||
- 11 | ||
- 12 | ||
- 13 | ||
- 14 | ||
- 15 | ||
- 16 | ||
- 17 | ||
- 18 | ||
- 19 | ||
- 20 | ||
- 21 | ||
- 30 | ||
- 31 | ||
- 32 | ||
- 33 | ||
- 34 | ||
- 35 | ||
- 36 | ||
- 37 | ||
- 38 | ||
- 39 | ||
- 40 | ||
- 41 | ||
- 42 | ||
- 43 | ||
- 44 | ||
- 45 | ||
- 46 | ||
- 47 | ||
- 48 | ||
- 49 | ||
- 50 | ||
- 51 | ||
- 52 | ||
- 53 | ||
- 54 | ||
- 55 | ||
- 56 | ||
- 57 | ||
- 58 | ||
- 59 | ||
- 60 | ||
- 61 | ||
- 62 | ||
- 63 | ||
- 64 | ||
- 65 | ||
- 66 | ||
- 67 | ||
- 68 | ||
- 69 | ||
- 70 | ||
- 71 | ||
- 72 | ||
- 73 | ||
- 74 | ||
- 75 | ||
- 76 | ||
- 77 | ||
- 78 | ||
- 79 | ||
- 80 | ||
- 81 | ||
- 82 | ||
- 83 | ||
- 84 | ||
- 85 | ||
- 86 | ||
- 87 | ||
- 88 | ||
- 89 | ||
- 90 | ||
- 91 | ||
- 92 | ||
- 93 | ||
- 94 | ||
- 95 | ||
- 96 | ||
- 97 | ||
- 98 | ||
- 99 | ||
- 100 | ||
- 101 | ||
- 102 | ||
- 103 | ||
- 104 | ||
- 105 | ||
- 106 | ||
- 107 | ||
- 108 | ||
- 109 | ||
- 110 | ||
- 111 | ||
- 112 | ||
- 113 | ||
- 114 | ||
- 115 | ||
- 116 | ||
- 117 | ||
VMs: | ||
ARISTA01T1: | ||
vlans: | ||
- 22 | ||
- 23 | ||
vm_offset: 0 | ||
ARISTA02T1: | ||
vlans: | ||
- 24 | ||
- 25 | ||
vm_offset: 1 | ||
ARISTA03T1: | ||
vlans: | ||
- 26 | ||
- 27 | ||
vm_offset: 2 | ||
ARISTA04T1: | ||
vlans: | ||
- 28 | ||
- 29 | ||
vm_offset: 3 | ||
DUT: | ||
vlan_configs: | ||
default_vlan_config: two_vlan_a | ||
one_vlan_a: | ||
Vlan1000: | ||
id: 1000 | ||
intfs: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117] | ||
prefix: 192.168.0.1/21 | ||
prefix_v6: fc02:1000::1/64 | ||
tag: 1000 | ||
two_vlan_a: | ||
Vlan1000: | ||
id: 1000 | ||
intfs: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62] | ||
prefix: 192.168.0.1/25 | ||
prefix_v6: fc02:1000::1/64 | ||
tag: 1000 | ||
Vlan2000: | ||
id: 2000 | ||
intfs: [63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117] | ||
prefix: 192.168.0.129/25 | ||
prefix_v6: fc02:1000:0:1::1/64 | ||
tag: 2000 | ||
four_vlan_a: | ||
Vlan1000: | ||
id: 1000 | ||
intfs: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 30, 31, 33, 34, 35] | ||
prefix: 192.168.0.1/23 | ||
prefix_v6: fc02:400::1/64 | ||
tag: 1000 | ||
Vlan2000: | ||
id: 2000 | ||
intfs: [36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] | ||
prefix: 192.168.2.1/23 | ||
prefix_v6: fc02:401::1/64 | ||
tag: 2000 | ||
Vlan3000: | ||
id: 3000 | ||
intfs: [64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90] | ||
prefix: 192.168.4.1/23 | ||
prefix_v6: fc02:402::1/64 | ||
tag: 3000 | ||
Vlan4000: | ||
id: 4000 | ||
intfs: [91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117] | ||
prefix: 192.168.6.1/23 | ||
prefix_v6: fc02:403::1/64 | ||
tag: 4000 | ||
|
||
configuration_properties: | ||
common: | ||
dut_asn: 4200065100 | ||
dut_type: ToRRouter | ||
swrole: leaf | ||
podset_number: 200 | ||
tor_number: 16 | ||
tor_subnet_number: 2 | ||
max_tor_subnet_number: 16 | ||
tor_subnet_size: 128 | ||
spine_asn: 65534 | ||
leaf_asn_start: 4200064600 | ||
tor_asn_start: 4200065500 | ||
nhipv4: 10.10.246.254 | ||
nhipv6: FC0A::FF | ||
|
||
configuration: | ||
ARISTA01T1: | ||
properties: | ||
- common | ||
bgp: | ||
asn: 4200064600 | ||
peers: | ||
4200065100: | ||
- 10.0.0.32 | ||
- FC00::21 | ||
interfaces: | ||
Loopback0: | ||
ipv4: 100.1.0.33/32 | ||
ipv6: 2064:100::33/128 | ||
Ethernet1: | ||
lacp: 1 | ||
Ethernet2: | ||
lacp: 1 | ||
Port-Channel1: | ||
ipv4: 10.0.0.33/31 | ||
ipv6: fc00::22/126 | ||
bp_interface: | ||
ipv4: 10.10.246.33/24 | ||
ipv6: fc0a::23/64 | ||
|
||
ARISTA02T1: | ||
properties: | ||
- common | ||
bgp: | ||
asn: 4200064600 | ||
peers: | ||
4200065100: | ||
- 10.0.0.34 | ||
- FC00::25 | ||
interfaces: | ||
Loopback0: | ||
ipv4: 100.1.0.35/32 | ||
ipv6: 2064:100::26/128 | ||
Ethernet1: | ||
lacp: 1 | ||
Ethernet2: | ||
lacp: 1 | ||
Port-Channel1: | ||
ipv4: 10.0.0.35/31 | ||
ipv6: fc00::26/126 | ||
bp_interface: | ||
ipv4: 10.10.246.35/24 | ||
ipv6: fc0a::26/64 | ||
|
||
ARISTA03T1: | ||
properties: | ||
- common | ||
bgp: | ||
asn: 4200064600 | ||
peers: | ||
4200065100: | ||
- 10.0.0.36 | ||
- FC00::29 | ||
interfaces: | ||
Loopback0: | ||
ipv4: 100.1.0.37/32 | ||
ipv6: 2064:100::2A/128 | ||
Ethernet1: | ||
lacp: 1 | ||
Ethernet2: | ||
lacp: 1 | ||
Port-Channel1: | ||
ipv4: 10.0.0.37/31 | ||
ipv6: fc00::2A/126 | ||
bp_interface: | ||
ipv4: 10.10.246.37/24 | ||
ipv6: fc0a::2A/64 | ||
|
||
ARISTA04T1: | ||
properties: | ||
- common | ||
bgp: | ||
asn: 4200064600 | ||
peers: | ||
4200065100: | ||
- 10.0.0.38 | ||
- FC00::2D | ||
interfaces: | ||
Loopback0: | ||
ipv4: 100.1.0.39/32 | ||
ipv6: 2064:100::2E/128 | ||
Ethernet1: | ||
lacp: 1 | ||
Ethernet2: | ||
lacp: 1 | ||
Port-Channel1: | ||
ipv4: 10.0.0.39/31 | ||
ipv6: fc00::2E/126 | ||
bp_interface: | ||
ipv4: 10.10.246.39/24 | ||
ipv6: fc0a::2E/64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ all: | |
- t0-64-32 | ||
- t0-80 | ||
- t0-116 | ||
- t0-118 | ||
- t0-backend | ||
- t0-standalone-32 | ||
- t0-standalone-64 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ all: | |
- t0-64 | ||
- t0-64-32 | ||
- t0-116 | ||
- t0-118 | ||
- t0-backend | ||
- dualtor | ||
- dualtor-56 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.