Skip to content

Commit 495c8de

Browse files
committed
fixed egress Everflow tests
- added a missing destinatio route Tests checking the Everflow feature on egress stage rely on a default static route to forward packets but the route was removed recently from SONiC so packets get dropped and mirroring is skipped. The route removed in sonic-net/sonic-buildimage#9182
1 parent 8032a7c commit 495c8de

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

tests/everflow/test_everflow_testbed.py

+18-1
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,25 @@ def dest_port_type(self, duthosts, rand_one_dut_hostname, setup_info, setup_mirr
9191
duthost.shell(duthost.get_vtysh_cmd_for_namespace("vtysh -c \"config\" -c \"router bgp\" -c \"address-family ipv4\" -c \"no redistribute static\"",setup_info[request.param]["namespace"]))
9292
time.sleep(15)
9393

94+
@pytest.fixture
95+
def add_dest_routes(self, duthosts, rand_one_dut_hostname, setup_info, tbinfo, dest_port_type):
96+
duthost = duthosts[rand_one_dut_hostname]
97+
98+
default_traffic_port_type = "tor" if dest_port_type == "spine" else "spine"
99+
rx_port = setup_info[default_traffic_port_type]["dest_port"][0]
100+
nexthop_ip = everflow_utils.get_neighbor_info(duthost, rx_port, tbinfo)
101+
102+
ns = setup_info[default_traffic_port_type]["namespace"]
103+
dst_mask = "30.0.0.0/28"
104+
105+
everflow_utils.add_route(duthost, dst_mask, nexthop_ip, ns)
106+
107+
yield
108+
109+
everflow_utils.remove_route(duthost, dst_mask, nexthop_ip, ns)
110+
94111

95-
def test_everflow_basic_forwarding(self, duthosts, rand_one_dut_hostname, setup_info, setup_mirror_session, dest_port_type, ptfadapter, tbinfo):
112+
def test_everflow_basic_forwarding(self, duthosts, rand_one_dut_hostname, setup_info, setup_mirror_session, dest_port_type, ptfadapter, tbinfo, add_dest_routes):
96113
"""
97114
Verify basic forwarding scenarios for the Everflow feature.
98115

0 commit comments

Comments
 (0)