Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion tests/bgp/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ def _get_namespace(minigraph_config, intf):
elif tbinfo["topo"]["type"] in set(["t1", "t2"]):
setup_func = _setup_interfaces_t1_or_t2
elif tbinfo["topo"]["type"] == "m0":
if topo_scenario == "m0_t1_scenario":
if topo_scenario == "m0_l3_scenario":
setup_func = _setup_interfaces_t1_or_t2
else:
setup_func = _setup_interfaces_t0_or_mx
Expand Down
8 changes: 6 additions & 2 deletions tests/common/helpers/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@
"t1": "t2",
"m0": "m1",
"mx": "m0",
"t2": "t3"
"t2": "t3",
"m0_vlan": "m1",
"m0_l3": "m1"
}
# Describe downstream neighbor of dut in different topos
DOWNSTREAM_NEIGHBOR_MAP = {
"t0": "server",
"t1": "t0",
"m0": "mx",
"mx": "server",
"t2": "t1"
"t2": "t1",
"m0_vlan": "server",
"m0_l3": "mx"
}
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1342,7 +1342,7 @@ def pytest_generate_tests(metafunc):

if 'topo_scenario' in metafunc.fixturenames:
if tbinfo['topo']['type'] == 'm0' and 'topo_scenario' in metafunc.fixturenames:
metafunc.parametrize('topo_scenario', ['m0_t0_scenario', 'm0_t1_scenario'], scope='module')
metafunc.parametrize('topo_scenario', ['m0_vlan_scenario', 'm0_l3_scenario'], scope='module')
else:
metafunc.parametrize('topo_scenario', ['default'], scope='module')

Expand Down
14 changes: 8 additions & 6 deletions tests/everflow/everflow_test_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@
DOWN_STREAM = "downstream"
UP_STREAM = "upstream"
# Topo that downstream neighbor of DUT are servers
DOWNSTREAM_SERVER_TOPO = ["t0"]
DOWNSTREAM_SERVER_TOPO = ["t0", "m0_vlan"]


def gen_setup_information(downStreamDutHost, upStreamDutHost, tbinfo):
def gen_setup_information(downStreamDutHost, upStreamDutHost, tbinfo, topo_scenario):
"""
Generate setup information dictionary for T0 and T1/ T2 topologies.
"""
Expand Down Expand Up @@ -78,6 +78,8 @@ def gen_setup_information(downStreamDutHost, upStreamDutHost, tbinfo):
upstream_acl_capability_facts = upStreamDutHost.acl_capabilities_facts()["ansible_facts"]

topo_type = tbinfo["topo"]["type"]
if topo_type == "m0":
topo_type = "m0_vlan" if "m0_vlan_scenario" in topo_scenario else "m0_l3"
# Get the list of T0/T2 ports
for mg_facts in mg_facts_list:
for dut_port, neigh in mg_facts["minigraph_neighbors"].items():
Expand Down Expand Up @@ -296,7 +298,7 @@ def get_t2_duthost(duthosts, tbinfo):


@pytest.fixture(scope="module")
def setup_info(duthosts, rand_one_dut_hostname, tbinfo, request):
def setup_info(duthosts, rand_one_dut_hostname, tbinfo, request, topo_scenario):
"""
Gather all required test information.

Expand All @@ -314,8 +316,8 @@ def setup_info(duthosts, rand_one_dut_hostname, tbinfo, request):
elif 't2' in topo:
pytest_assert(len(duthosts) > 1, "Test must run on whole chassis")
downstream_duthost, upstream_duthost = get_t2_duthost(duthosts, tbinfo)
setup_information = gen_setup_information(downstream_duthost, upstream_duthost, tbinfo)

setup_information = gen_setup_information(downstream_duthost, upstream_duthost, tbinfo, topo_scenario)

# Disable BGP so that we don't keep on bouncing back mirror packets
# If we send TTL=1 packet we don't need this but in multi-asic TTL > 1
Expand Down Expand Up @@ -374,7 +376,7 @@ def remove_route(duthost, prefix, nexthop, namespace):

@pytest.fixture(scope='module', autouse=True)
def setup_arp_responder(duthost, ptfhost, setup_info):
if setup_info['topo'] != 't0':
if setup_info['topo'] not in ['t0', 'm0_vlan']:
yield
return
ip_list = [TARGET_SERVER_IP, DEFAULT_SERVER_IP]
Expand Down
8 changes: 4 additions & 4 deletions tests/everflow/test_everflow_ipv6.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def setup_mirror_session_dest_ip_route(self, tbinfo, setup_info, setup_mirror_se
Setup the route for mirror session destination ip and update monitor port list.
Remove the route as part of cleanup.
"""
if setup_info['topo'] == 't0':
if setup_info['topo'] in ['t0', 'm0_vlan']:
# On T0 testbed, the collector IP is routed to T1
namespace = setup_info[UP_STREAM]['remote_namespace']
tx_port = setup_info[UP_STREAM]["dest_port"][0]
Expand All @@ -64,7 +64,7 @@ def setup_mirror_session_dest_ip_route(self, tbinfo, setup_info, setup_mirror_se

@pytest.fixture(scope='class')
def everflow_dut(self, setup_info):
if setup_info['topo'] == 't0':
if setup_info['topo'] in ['t0', 'm0_vlan']:
dut = setup_info[UP_STREAM]['everflow_dut']
else:
dut = setup_info[DOWN_STREAM]['everflow_dut']
Expand All @@ -73,7 +73,7 @@ def everflow_dut(self, setup_info):

@pytest.fixture(scope='class')
def everflow_direction(self, setup_info):
if setup_info['topo'] == 't0':
if setup_info['topo'] in ['t0', 'm0_vlan']:
direction = UP_STREAM
else:
direction = DOWN_STREAM
Expand Down Expand Up @@ -553,7 +553,7 @@ def mirror_type(self):
@pytest.fixture(scope='class', autouse=True)
def setup_acl_table(self, setup_info, setup_mirror_session, config_method):

if setup_info['topo'] == 't0':
if setup_info['topo'] in ['t0', 'm0_vlan']:
everflow_dut = setup_info[UP_STREAM]['everflow_dut']
remote_dut = setup_info[UP_STREAM]['remote_dut']
else:
Expand Down
6 changes: 3 additions & 3 deletions tests/everflow/test_everflow_testbed.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ def test_everflow_dscp_with_policer(
if vendorAsic in hostvars.keys() and everflow_dut.facts['hwsku'] in hostvars[vendorAsic]:
pytest.skip("Skipping test since mirror policing is not supported on {0} {1} platforms".format(vendor, asic))

if setup_info['topo'] == 't0':
if setup_info['topo'] in ['t0', 'm0_vlan']:
default_tarffic_port_type = dest_port_type
# Use the second portchannel as missor session nexthop
tx_port = setup_info[dest_port_type]["dest_port"][1]
Expand All @@ -520,7 +520,7 @@ def test_everflow_dscp_with_policer(
bind_interface_namespace = setup_info[dest_port_type]["everflow_namespace"]
rx_port_ptf_id = setup_info[dest_port_type]["src_port_ptf_id"]
tx_port_ptf_id = setup_info[dest_port_type]["dest_port_ptf_id"][0]
if setup_info['topo'] == 't0' and self.acl_stage() == "egress":
if setup_info['topo'] in ['t0', 'm0_vlan'] and self.acl_stage() == "egress":
# For T0 upstream, the EVERFLOW_DSCP table is binded to one of portchannels
bind_interface = setup_info[dest_port_type]["dest_port_lag_name"][0]
mirror_port_id = setup_info[dest_port_type]["dest_port_ptf_id"][1]
Expand Down Expand Up @@ -574,7 +574,7 @@ def _run_everflow_test_scenarios(self, ptfadapter, setup, mirror_session, duthos
tx_port_ids = self._get_tx_port_id_list(tx_ports)
target_ip = "30.0.0.10"
default_ip = self.DEFAULT_DST_IP
if 't0' == setup['topo'] and direction == DOWN_STREAM:
if setup['topo'] in ['t0', 'm0_vlan'] and direction == DOWN_STREAM:
target_ip = TARGET_SERVER_IP
default_ip = DEFAULT_SERVER_IP

Expand Down