Skip to content

Commit 5d523ae

Browse files
egress Everflow tests: added a missing destination route for original flow (#4850)
* fixed egress Everflow tests - added a missing destination 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 4db6018 commit 5d523ae

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/everflow/test_everflow_testbed.py

+20
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,26 @@ 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(autouse=True)
95+
def add_dest_routes(self, duthosts, rand_one_dut_hostname, setup_info, tbinfo, dest_port_type):
96+
if self.acl_stage() != 'egress':
97+
yield
98+
return
99+
duthost = duthosts[rand_one_dut_hostname]
100+
101+
default_traffic_port_type = "tor" if dest_port_type == "spine" else "spine"
102+
rx_port = setup_info[default_traffic_port_type]["dest_port"][0]
103+
nexthop_ip = everflow_utils.get_neighbor_info(duthost, rx_port, tbinfo)
104+
105+
ns = setup_info[default_traffic_port_type]["namespace"]
106+
dst_mask = "30.0.0.0/28"
107+
108+
everflow_utils.add_route(duthost, dst_mask, nexthop_ip, ns)
109+
110+
yield
111+
112+
everflow_utils.remove_route(duthost, dst_mask, nexthop_ip, ns)
113+
94114

95115
def test_everflow_basic_forwarding(self, duthosts, rand_one_dut_hostname, setup_info, setup_mirror_session, dest_port_type, ptfadapter, tbinfo):
96116
"""

0 commit comments

Comments
 (0)