Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
dd152cb
example for PR
gshemesh2 May 28, 2025
9a35c5f
Merge branch 'sonic-net:master' into master
gshemesh2 May 28, 2025
8df4b25
Adding WA to for Port Error Test
gshemesh2 Jun 11, 2025
8045917
Merge branch 'sonic-net:master' into master
gshemesh2 Jun 11, 2025
72572a2
Update test_port_error.py
gshemesh2 Jun 11, 2025
dd22460
Update test_port_error.py
gshemesh2 Jun 16, 2025
e58fe89
Update test_port_error.py
gshemesh2 Jun 16, 2025
c263165
Update test_port_error.py
gshemesh2 Jun 16, 2025
50fa7e4
Update test_port_error.py
gshemesh2 Jun 16, 2025
e6e28ec
Update test_port_error.py
gshemesh2 Jun 17, 2025
b40aa2c
Update test_port_error.py
gshemesh2 Jun 17, 2025
51b1052
Update test_port_error.py
gshemesh2 Jun 18, 2025
81d7e2a
Update test_port_error.py
gshemesh2 Jul 2, 2025
a5fa257
Update code-review-guidlines.md
gshemesh2 Jul 2, 2025
7bf6710
Update test_port_error.py
gshemesh2 Jul 2, 2025
5d4a01f
Update test_port_error.py
gshemesh2 Jul 2, 2025
8cfa578
Update test_port_error.py
gshemesh2 Jul 2, 2025
1a67218
Update test_port_error.py
gshemesh2 Jul 2, 2025
4e115ca
Update test_port_error.py
gshemesh2 Jul 2, 2025
32663a4
Update test_port_error.py
gshemesh2 Jul 2, 2025
5710fca
Update test_port_error.py
gshemesh2 Jul 2, 2025
4916a68
Update test_port_error.py
gshemesh2 Jul 2, 2025
9c21be4
Update test_port_error.py
gshemesh2 Jul 2, 2025
8a7f377
Update test_port_error.py
gshemesh2 Jul 2, 2025
2a9fd16
Update test_port_error.py
gshemesh2 Jul 3, 2025
9cf53ff
Update test_port_error.py
gshemesh2 Jul 17, 2025
75d5d4a
Update test_port_error.py
gshemesh2 Jul 24, 2025
45087e2
Update test_port_error.py
gshemesh2 Jul 27, 2025
ca6f72b
Merge branch 'sonic-net:master' into master
gshemesh2 Aug 3, 2025
29079a7
Update transceiver_utils.py
gshemesh2 Aug 3, 2025
be36623
Update test_port_error.py
gshemesh2 Aug 3, 2025
bfc1e7e
Update test_port_error.py
gshemesh2 Aug 3, 2025
282f51a
Update test_port_error.py
gshemesh2 Aug 3, 2025
f4d44f2
Update transceiver_utils.py
gshemesh2 Aug 3, 2025
3e9ec46
Update test_port_error.py
gshemesh2 Aug 3, 2025
f108723
Update test_port_error.py
gshemesh2 Aug 4, 2025
3969754
Update test_port_error.py
gshemesh2 Aug 4, 2025
4bd0969
Update test_port_error.py
gshemesh2 Aug 25, 2025
682423c
Update conftest.py
gshemesh2 Aug 25, 2025
c83316e
Update test_port_error.py
gshemesh2 Aug 25, 2025
55418ca
Merge branch 'sonic-net:master' into master
gshemesh2 Sep 10, 2025
2a62fb0
Update test_crm.py
gshemesh2 Sep 10, 2025
fd7797f
Update conftest.py
gshemesh2 Sep 10, 2025
7a48b85
Update transceiver_utils.py
gshemesh2 Sep 10, 2025
5b37143
Adjust test_dynamic_acl.py so it can handle only ipv6 topologies.
gshemesh2 Sep 10, 2025
b00168a
Update conftest.py
gshemesh2 Sep 14, 2025
708da22
Update test_crm.py
gshemesh2 Sep 14, 2025
c2d44fb
Update test_port_error.py
gshemesh2 Sep 14, 2025
02ebf47
Update conftest.py
gshemesh2 Sep 14, 2025
1841ee9
Update test_dynamic_acl.py
gshemesh2 Sep 15, 2025
7b372ab
Update tests_mark_conditions.yaml
gshemesh2 Sep 15, 2025
f27e334
Update tests_mark_conditions.yaml
gshemesh2 Sep 15, 2025
488decb
Update test_dynamic_acl.py
gshemesh2 Sep 15, 2025
51f6c83
Update test_dynamic_acl.py
gshemesh2 Sep 15, 2025
c34e143
Update test_dynamic_acl.py
gshemesh2 Sep 16, 2025
582c9a8
Update test_dynamic_acl.py
gshemesh2 Sep 16, 2025
776da84
Merge branch 'sonic-net:master' into ipv6
gshemesh2 Sep 16, 2025
32fe781
Update tests_mark_conditions.yaml
gshemesh2 Sep 28, 2025
384de97
Update tests_mark_conditions.yaml
gshemesh2 Sep 28, 2025
f05a8e4
Update test_dynamic_acl.py
gshemesh2 Oct 9, 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
Original file line number Diff line number Diff line change
Expand Up @@ -2088,6 +2088,12 @@ generic_config_updater/test_dynamic_acl.py::test_gcu_acl_dhcp_rule_creation:
conditions:
- "'t0-isolated' in topo_name"

generic_config_updater/test_dynamic_acl.py::test_gcu_acl_forward_rule_removal:
xfail:
Copy link
Contributor

Choose a reason for hiding this comment

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

Should't skip be used here instead?

reason: "skip for IPv6-only topologies"
conditions:
- "'-v6-' in topo_name"

generic_config_updater/test_ecn_config_update.py::test_ecn_config_updates:
skip:
reason: "This test is not run on this asic type, topology, or version currently"
Expand Down
64 changes: 32 additions & 32 deletions tests/generic_config_updater/test_dynamic_acl.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
from tests.common.dualtor.mux_simulator_control import toggle_all_simulator_ports_to_rand_selected_tor # noqa: F401
from tests.common.dualtor.dual_tor_utils import setup_standby_ports_on_rand_unselected_tor # noqa: F401
from tests.common.utilities import get_all_upstream_neigh_type, get_downstream_neigh_type, \
increment_ipv4_addr, increment_ipv6_addr
increment_ipv4_addr, increment_ipv6_addr, is_ipv6_only_topology

pytestmark = [
pytest.mark.topology('t0', 'm0'),
Expand Down Expand Up @@ -646,16 +646,16 @@ def verify_expected_packet_behavior(exp_pkt, ptfadapter, setup, expect_drop):
testutils.verify_packet_any_port(ptfadapter, exp_pkt, ports=setup["dst_port_indices"], timeout=20)


def generate_packets(setup, dst_ip=DST_IP_FORWARDED_ORIGINAL, dst_ipv6=DST_IPV6_FORWARDED_ORIGINAL):
def generate_packets(setup, tbinfo, dst_ip=DST_IP_FORWARDED_ORIGINAL, dst_ipv6=DST_IPV6_FORWARDED_ORIGINAL):
"""Generate packets that match the destination IP of given ips.
If no IP is given, default to our original forwarding ips"""

packets = {}

packets["IPV4"] = testutils.simple_tcp_packet(eth_dst=setup["router_mac"],
ip_src=IP_SOURCE,
ip_dst=dst_ip,
ip_ttl=64)
if not is_ipv6_only_topology(tbinfo):
packets["IPV4"] = testutils.simple_tcp_packet(eth_dst=setup["router_mac"],
ip_src=IP_SOURCE,
ip_dst=dst_ip,
ip_ttl=64)

packets["IPV6"] = testutils.simple_tcpv6_packet(eth_dst=setup["router_mac"],
ipv6_src=IPV6_SOURCE,
Expand Down Expand Up @@ -1153,7 +1153,7 @@ def test_gcu_acl_arp_rule_creation(rand_selected_dut,
setup,
dynamic_acl_create_table,
prepare_ptf_intf_and_ip,
toggle_all_simulator_ports_to_rand_selected_tor): # noqa: F811
toggle_all_simulator_ports_to_rand_selected_tor, tbinfo): # noqa: F811
"""Test that we can create a blanket ARP/NDP packet forwarding rule with GCU, and that ARP/NDP packets
are correctly forwarded while all others are dropped."""

Expand Down Expand Up @@ -1186,7 +1186,7 @@ def test_gcu_acl_arp_rule_creation(rand_selected_dut,

dynamic_acl_verify_packets(setup,
ptfadapter,
packets=generate_packets(setup, DST_IP_BLOCKED, DST_IPV6_BLOCKED),
packets=generate_packets(setup, tbinfo, DST_IP_BLOCKED, DST_IPV6_BLOCKED),
packets_dropped=True,
src_port=ptf_intf_index)

Expand All @@ -1197,7 +1197,7 @@ def test_gcu_acl_dhcp_rule_creation(rand_selected_dut,
setup,
dynamic_acl_create_table,
toggle_all_simulator_ports_to_rand_selected_tor, # noqa: F811
setup_standby_ports_on_rand_unselected_tor): # noqa: F811
setup_standby_ports_on_rand_unselected_tor, tbinfo): # noqa: F811
"""Verify that DHCP and DHCPv6 forwarding rules can be created, and that dhcp packets are properly forwarded
whereas others are dropped"""

Expand All @@ -1211,7 +1211,7 @@ def test_gcu_acl_dhcp_rule_creation(rand_selected_dut,

dynamic_acl_verify_packets(setup,
ptfadapter,
packets=generate_packets(setup, DST_IP_BLOCKED, DST_IPV6_BLOCKED),
packets=generate_packets(setup, tbinfo, DST_IP_BLOCKED, DST_IPV6_BLOCKED),
packets_dropped=True)


Expand All @@ -1220,19 +1220,19 @@ def test_gcu_acl_drop_rule_creation(rand_selected_dut,
ptfadapter,
setup,
dynamic_acl_create_table,
toggle_all_simulator_ports_to_rand_selected_tor): # noqa: F811
toggle_all_simulator_ports_to_rand_selected_tor, tbinfo): # noqa: F811
"""Test that we can create a drop rule via GCU, and that once this drop rule is in place packets
that match the drop rule are dropped and packets that do not match the drop rule are forwarded"""

dynamic_acl_create_drop_rule_initial(rand_selected_dut, setup)

dynamic_acl_verify_packets(setup,
ptfadapter,
packets=generate_packets(setup, DST_IP_BLOCKED, DST_IPV6_BLOCKED),
packets=generate_packets(setup, tbinfo, DST_IP_BLOCKED, DST_IPV6_BLOCKED),
packets_dropped=True)
dynamic_acl_verify_packets(setup,
ptfadapter,
packets=generate_packets(setup, DST_IP_BLOCKED, DST_IPV6_BLOCKED),
packets=generate_packets(setup, tbinfo, DST_IP_BLOCKED, DST_IPV6_BLOCKED),
packets_dropped=False,
src_port=setup["unblocked_src_port_indice"])

Expand All @@ -1242,15 +1242,15 @@ def test_gcu_acl_drop_rule_removal(rand_selected_dut,
ptfadapter,
setup,
dynamic_acl_create_table,
toggle_all_simulator_ports_to_rand_selected_tor): # noqa: F811
toggle_all_simulator_ports_to_rand_selected_tor, tbinfo): # noqa: F811
"""Test that once a drop rule is removed, packets that were previously being dropped are now forwarded"""

dynamic_acl_create_three_drop_rules(rand_selected_dut, setup)
dynamic_acl_remove_third_drop_rule(rand_selected_dut, setup)

dynamic_acl_verify_packets(setup,
ptfadapter,
packets=generate_packets(setup, DST_IP_BLOCKED, DST_IPV6_BLOCKED),
packets=generate_packets(setup, tbinfo, DST_IP_BLOCKED, DST_IPV6_BLOCKED),
packets_dropped=False,
src_port=setup["scale_port_indices"][2])

Expand All @@ -1260,18 +1260,18 @@ def test_gcu_acl_forward_rule_priority_respected(rand_selected_dut,
ptfadapter,
setup,
dynamic_acl_create_table,
toggle_all_simulator_ports_to_rand_selected_tor): # noqa: F811
toggle_all_simulator_ports_to_rand_selected_tor, tbinfo): # noqa: F811
"""Test that forward rules and drop rules can be created at the same time, with the forward rules having
higher priority than drop. Then, perform a traffic test to confirm that packets that match both the forward
and drop rules are correctly forwarded, as the forwarding rules have higher priority"""

dynamic_acl_create_forward_rules(rand_selected_dut, setup)
dynamic_acl_create_secondary_drop_rule(rand_selected_dut, setup)

dynamic_acl_verify_packets(setup, ptfadapter, packets=generate_packets(setup),
dynamic_acl_verify_packets(setup, ptfadapter, packets=generate_packets(setup, tbinfo),
packets_dropped=False)
dynamic_acl_verify_packets(setup, ptfadapter,
packets=generate_packets(setup, DST_IP_BLOCKED, DST_IPV6_BLOCKED),
packets=generate_packets(setup, tbinfo, DST_IP_BLOCKED, DST_IPV6_BLOCKED),
packets_dropped=True)


Expand All @@ -1280,26 +1280,26 @@ def test_gcu_acl_forward_rule_same_priority(rand_selected_dut,
ptfadapter,
setup,
dynamic_acl_create_table,
toggle_all_simulator_ports_to_rand_selected_tor): # noqa: F811
toggle_all_simulator_ports_to_rand_selected_tor, tbinfo): # noqa: F811
"""Test that forward rules can have the exact same priority and still all be applied correctly
Then, perform a traffic test to confirm that packets that match both the forward
and drop rules are correctly forwarded, as the forwarding rules have higher priority"""

dynamic_acl_create_forward_rules_same_priority(rand_selected_dut, setup)
dynamic_acl_create_secondary_drop_rule(rand_selected_dut, setup)

dynamic_acl_verify_packets(setup, ptfadapter, packets=generate_packets(setup),
dynamic_acl_verify_packets(setup, ptfadapter, packets=generate_packets(setup, tbinfo),
packets_dropped=False)
dynamic_acl_verify_packets(setup, ptfadapter, packets=generate_packets(setup,
dynamic_acl_verify_packets(setup, ptfadapter, packets=generate_packets(setup, tbinfo,
increment_ipv4_addr(DST_IP_FORWARDED_ORIGINAL, 1),
increment_ipv6_addr(DST_IPV6_FORWARDED_ORIGINAL, 1)),
packets_dropped=False)
dynamic_acl_verify_packets(setup, ptfadapter, packets=generate_packets(setup,
dynamic_acl_verify_packets(setup, ptfadapter, packets=generate_packets(setup, tbinfo,
increment_ipv4_addr(DST_IP_FORWARDED_ORIGINAL, 2),
increment_ipv6_addr(DST_IPV6_FORWARDED_ORIGINAL, 2)),
packets_dropped=False)
dynamic_acl_verify_packets(setup, ptfadapter,
packets=generate_packets(setup, DST_IP_BLOCKED, DST_IPV6_BLOCKED),
packets=generate_packets(setup, tbinfo, DST_IP_BLOCKED, DST_IPV6_BLOCKED),
packets_dropped=True)


Expand All @@ -1308,7 +1308,7 @@ def test_gcu_acl_forward_rule_replacement(rand_selected_dut,
ptfadapter,
setup,
dynamic_acl_create_table,
toggle_all_simulator_ports_to_rand_selected_tor): # noqa: F811
toggle_all_simulator_ports_to_rand_selected_tor, tbinfo): # noqa: F811
"""Test that forward rules can be created, and then afterwards can have their match pattern updated to a new value.
Confirm that packets sent that match this new value are correctly forwarded, and that packets that are sent that
match the old, replaced value are correctly dropped."""
Expand All @@ -1319,11 +1319,11 @@ def test_gcu_acl_forward_rule_replacement(rand_selected_dut,

dynamic_acl_verify_packets(setup,
ptfadapter,
packets=generate_packets(setup,
packets=generate_packets(setup, tbinfo,
DST_IP_FORWARDED_REPLACEMENT,
DST_IPV6_FORWARDED_REPLACEMENT),
packets_dropped=False)
dynamic_acl_verify_packets(setup, ptfadapter, packets=generate_packets(setup), packets_dropped=True)
dynamic_acl_verify_packets(setup, ptfadapter, packets=generate_packets(setup, tbinfo), packets_dropped=True)


@pytest.mark.parametrize("ip_type", ["IPV4", "IPV6"])
Expand All @@ -1333,15 +1333,15 @@ def test_gcu_acl_forward_rule_removal(rand_selected_dut,
setup,
ip_type,
dynamic_acl_create_table,
toggle_all_simulator_ports_to_rand_selected_tor): # noqa: F811
toggle_all_simulator_ports_to_rand_selected_tor, tbinfo): # noqa: F811
"""Test that if a forward rule is created, and then removed, that packets associated with that rule are properly
no longer forwarded, and packets associated with the remaining rule are forwarded"""

dynamic_acl_create_forward_rules(rand_selected_dut, setup)
dynamic_acl_create_secondary_drop_rule(rand_selected_dut, setup)
dynamic_acl_remove_ip_forward_rule(rand_selected_dut, ip_type, setup)

forward_packets = generate_packets(setup)
forward_packets = generate_packets(setup, tbinfo)
drop_packets = forward_packets.copy()
if ip_type == "IPV4":
other_type = "IPV6"
Expand All @@ -1355,7 +1355,7 @@ def test_gcu_acl_forward_rule_removal(rand_selected_dut,


def test_gcu_acl_scale_rules(rand_selected_dut, rand_unselected_dut, ptfadapter, setup, dynamic_acl_create_table,
toggle_all_simulator_ports_to_rand_selected_tor): # noqa:F811
toggle_all_simulator_ports_to_rand_selected_tor, tbinfo): # noqa:F811
"""Perform a scale test, creating 150 forward rules with top priority,
and then creating a drop rule for every single VLAN port on our device.
Select any one of our blocked ports, as well as the ips for two of our forward rules,
Expand All @@ -1373,12 +1373,12 @@ def test_gcu_acl_scale_rules(rand_selected_dut, rand_unselected_dut, ptfadapter,

dynamic_acl_verify_packets(setup,
ptfadapter,
generate_packets(setup, v4_dest, v6_dest),
generate_packets(setup, tbinfo, v4_dest, v6_dest),
packets_dropped=False,
src_port=blocked_scale_port)
dynamic_acl_verify_packets(setup,
ptfadapter,
generate_packets(setup, DST_IP_BLOCKED, DST_IPV6_BLOCKED),
generate_packets(setup, tbinfo, DST_IP_BLOCKED, DST_IPV6_BLOCKED),
packets_dropped=True,
src_port=blocked_scale_port)

Expand Down