Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
a05fbd8
Support running acl tests without any IPv4 management configuration.
wrideout-arista Sep 15, 2025
b98a8de
Merge branch 'sonic-net:master' into master-acl_tests_v6
wrideout-arista Nov 3, 2025
d228ba8
Merge branch 'master' into master-acl_tests_v6
wrideout-arista Nov 10, 2025
1a2be2a
Merge branch 'sonic-net:master' into master-acl_tests_v6
wrideout-arista Nov 17, 2025
cee7180
Merge branch 'sonic-net:master' into master-acl_tests_v6
wrideout-arista Nov 19, 2025
9275036
Merge branch 'sonic-net:master' into master-acl_tests_v6
wrideout-arista Dec 5, 2025
1a58d4a
Support running acl tests without any IPv4 management configuration.
wrideout-arista Sep 15, 2025
500339b
Merge branch 'sonic-net:master' into master-acl_tests_v6
wrideout-arista Dec 8, 2025
0972fc6
Merge branch 'sonic-net:master' into master-acl_tests_v6
wrideout-arista Dec 8, 2025
909e5ee
Merge branch 'sonic-net:master' into master-acl_tests_v6
wrideout-arista Dec 10, 2025
0743632
Merge branch 'sonic-net:master' into master-acl_tests_v6
wrideout-arista Dec 11, 2025
6922075
Merge branch 'sonic-net:master' into master-acl_tests_v6
wrideout-arista Dec 15, 2025
413d939
Support running acl tests without any IPv4 management configuration.
wrideout-arista Sep 15, 2025
fa1dbe0
Support running acl tests without any IPv4 management configuration.
wrideout-arista Sep 15, 2025
449a8af
Merge branch 'sonic-net:master' into master-acl_tests_v6
wrideout-arista Dec 17, 2025
8edc65f
Support running acl tests without any IPv4 management configuration
wrideout-arista Dec 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions tests/acl/test_acl.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,8 +537,13 @@ def setup(duthosts, ptfhost, rand_selected_dut, rand_selected_front_end_dut, ran

@pytest.fixture(scope="module", params=["ipv4", "ipv6"])
def ip_version(request, tbinfo, duthosts, rand_one_dut_hostname):
if tbinfo["topo"]["type"] in ["t0"] and request.param == "ipv6":
pytest.skip("IPV6 ACL test not currently supported on t0 testbeds")
v6topo = "isolated-v6" in tbinfo["topo"]["name"]
if request.param == "ipv4":
if v6topo:
pytest.skip("IPV4 ACL test not supported on isolated-v6 testbeds")
else: # ipv6
if tbinfo["topo"]["type"] in ["t0"] and not v6topo:
pytest.skip("IPV6 ACL test not currently supported on t0 testbeds")

return request.param

Expand Down
8 changes: 4 additions & 4 deletions tests/common/fixtures/ptfhost_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,8 @@ def run_garp_service(duthost, ptfhost, tbinfo, change_mac_addresses, request):
mux_cable_table = {}
server_ipv4_base_addr, server_ipv6_base_addr = request.getfixturevalue('mock_server_base_ip_addr')
for i, intf in enumerate(request.getfixturevalue('tor_mux_intfs')):
server_ipv4 = str(server_ipv4_base_addr + i)
server_ipv6 = str(server_ipv6_base_addr + i)
server_ipv4 = str(server_ipv4_base_addr + i) if server_ipv4_base_addr else ''
server_ipv6 = str(server_ipv6_base_addr + i) if server_ipv6_base_addr else ''
mux_cable_table[intf] = {}
mux_cable_table[intf]['server_ipv4'] = six.text_type(server_ipv4) # noqa: F821
mux_cable_table[intf]['server_ipv6'] = six.text_type(server_ipv6) # noqa: F821
Expand All @@ -490,8 +490,8 @@ def run_garp_service(duthost, ptfhost, tbinfo, change_mac_addresses, request):

for vlan_intf, config in list(mux_cable_table.items()):
ptf_port_index = ptf_indices[vlan_intf]
server_ip = ip_interface(config['server_ipv4']).ip
server_ipv6 = ip_interface(config['server_ipv6']).ip
server_ip = ip_interface(config['server_ipv4']).ip if config['server_ipv4'] else ''
server_ipv6 = ip_interface(config['server_ipv6']).ip if config['server_ipv6'] else ''

garp_config[ptf_port_index] = {
'dut_mac': '{}'.format(dut_mac),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ acl/test_acl.py:
reason: "Skip acl for isolated-v6 topology"
conditions:
- "'isolated-v6' in topo_name and https://github.com/sonic-net/sonic-mgmt/issues/18077"
- "asic_type in ['broadcom']"
xfail:
reason: "Test case has issue on the t0-isolated-d256u256s2 topo."
conditions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ acl/test_acl.py::TestAclWithPortToggle::test_icmp_match_forwarded[ipv6-egress-up
- "platform in ['armhf-nokia_ixs7215_52x-r0']"
- https://github.com/sonic-net/sonic-mgmt/issues/8639

acl/test_acl.py::TestAclWithPortToggle::test_icmp_match_forwarded[ipv6-ingress-uplink->downlink-default-Vlan1000]:
xfail:
reason: "Test issue on isolated-v6 topos"
conditions:
- "'isolated-v6' in topo_name"
- https://github.com/sonic-net/sonic-mgmt/issues/18077

acl/test_acl.py::TestAclWithPortToggle::test_icmp_source_ip_match_dropped[ipv6-egress-uplink->downlink-default-Vlan1000]:
xfail:
reason: "Egress issue in Nokia"
Expand Down Expand Up @@ -253,10 +260,8 @@ acl/test_acl.py::TestAclWithPortToggle::test_udp_source_ip_match_dropped[ipv6-eg
acl/test_acl.py::TestAclWithReboot:
skip:
reason: "Skip in t1-lag KVM test due to test time too long and t0 would cover this testbeds, or for isolated-v6 topology"
conditions_logical_operator: or
conditions:
- "topo_type in ['t1'] and asic_type in ['vs']"
- "'isolated-v6' in topo_name and https://github.com/sonic-net/sonic-mgmt/issues/18077"

acl/test_acl.py::TestAclWithReboot::test_dest_ip_match_dropped[ipv6-egress-uplink->downlink-default-Vlan1000]:
xfail:
Expand Down Expand Up @@ -324,6 +329,13 @@ acl/test_acl.py::TestAclWithReboot::test_icmp_match_forwarded[ipv6-egress-uplink
conditions:
- "topo_type in ['t1'] and asic_type in ['vs']"

acl/test_acl.py::TestAclWithReboot::test_icmp_match_forwarded[ipv6-ingress-uplink->downlink-default-Vlan1000]:
xfail:
reason: "Test issue on isolated-v6 topos"
conditions:
- "'isolated-v6' in topo_name"
- https://github.com/sonic-net/sonic-mgmt/issues/18077

acl/test_acl.py::TestAclWithReboot::test_icmp_source_ip_match_dropped[ipv6-egress-uplink->downlink-default-Vlan1000]:
xfail:
reason: "Egress issue in Nokia"
Expand Down Expand Up @@ -697,6 +709,13 @@ acl/test_acl.py::TestBasicAcl::test_icmp_match_forwarded[ipv6-egress-uplink->dow
- "platform in ['armhf-nokia_ixs7215_52x-r0']"
- https://github.com/sonic-net/sonic-mgmt/issues/8639

acl/test_acl.py::TestBasicAcl::test_icmp_match_forwarded[ipv6-ingress-uplink->downlink-default-Vlan1000]:
xfail:
reason: "Test issue on isolated-v6 topos"
conditions:
- "'isolated-v6' in topo_name"
- https://github.com/sonic-net/sonic-mgmt/issues/18077

acl/test_acl.py::TestBasicAcl::test_icmp_source_ip_match_dropped[ipv6-egress-uplink->downlink-default-Vlan1000]:
xfail:
reason: "Egress issue in Nokia"
Expand Down Expand Up @@ -953,6 +972,13 @@ acl/test_acl.py::TestIncrementalAcl::test_icmp_match_forwarded[ipv6-egress-uplin
- "platform in ['armhf-nokia_ixs7215_52x-r0']"
- https://github.com/sonic-net/sonic-mgmt/issues/8639

acl/test_acl.py::TestIncrementalAcl::test_icmp_match_forwarded[ipv6-ingress-uplink->downlink-default-Vlan1000]:
xfail:
reason: "Test issue on isolated-v6 topos"
conditions:
- "'isolated-v6' in topo_name"
- https://github.com/sonic-net/sonic-mgmt/issues/18077

acl/test_acl.py::TestIncrementalAcl::test_icmp_source_ip_match_dropped[ipv6-egress-uplink->downlink-default-Vlan1000]:
xfail:
reason: "Egress issue in Nokia"
Expand Down
35 changes: 20 additions & 15 deletions tests/scripts/garp_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,27 @@ def gen_garp_packets(self):
source_ipv6_str = config['target_ipv6']
dut_mac = config['dut_mac']
dst_ipv6 = config['dst_ipv6']
source_ip = str(ip_interface(source_ip_str).ip)
source_ipv6 = str(ip_interface(source_ipv6_str).ip)
source_ip = str(ip_interface(source_ip_str).ip) if source_ip_str else None
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remind me why garp_service.py was changed? I remember it's only used in dualtor setup. In single-ToR setup, we are using arp_responder

Copy link
Copy Markdown
Contributor Author

@wrideout-arista wrideout-arista Nov 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prior to skipping all v4 cases when run on isolated-v6 testbeds, we found that the garp service was emitting a TypeError when trying to configure and send arp packets using a v4 address which was None. The changes here are meant to prevent this by selectively configuring and sending arp, or nd, or both, all depending on the configuration of the testbed.

Granted, these changes are less impactful due to the fact that the ip_version fixture in test/test_acl.py now skips v4 tests on isolated-v6 testbeds, but the bug still exists without them. With these changes to the service we no longer see a TypeError.

source_ipv6 = str(ip_interface(source_ipv6_str).ip) if source_ipv6_str else None

# PTF uses Scapy to create packets, so this is ok to create
# packets through PTF even though we are using Scapy to send the packets
garp_pkt = testutils.simple_arp_packet(
eth_src=source_mac,
hw_snd=source_mac,
ip_snd=source_ip,
# Re-use server IP as target IP, since it is within the subnet of the VLAN IP
ip_tgt=source_ip,
arp_op=2)

na_pkt = Ether(src=source_mac, dst=dut_mac) \
/ IPv6(dst=dst_ipv6, src=source_ipv6) \
/ ICMPv6ND_NA(tgt=source_ipv6, S=1, R=0, O=0) \
/ ICMPv6NDOptSrcLLAddr(type=2, lladdr=source_mac)
garp_pkt = None
na_pkt = None
if source_ip:
garp_pkt = testutils.simple_arp_packet(
eth_src=source_mac,
hw_snd=source_mac,
ip_snd=source_ip,
# Re-use server IP as target IP, since it is within the subnet of the VLAN IP
ip_tgt=source_ip,
arp_op=2)

if source_ipv6:
na_pkt = Ether(src=source_mac, dst=dut_mac) \
/ IPv6(dst=dst_ipv6, src=source_ipv6) \
/ ICMPv6ND_NA(tgt=source_ipv6, S=1, R=0, O=0) \
/ ICMPv6NDOptSrcLLAddr(type=2, lladdr=source_mac)

self.packets[intf_name] = [garp_pkt, na_pkt]

Expand All @@ -69,7 +73,8 @@ def send_garp_packets(self):
while True:
for socket, packet_list in list(sockets.items()):
for packet in packet_list:
socket.send(packet)
if packet:
socket.send(packet)

if self.interval is None:
break
Expand Down
Loading