Skip to content
Closed
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
3 changes: 1 addition & 2 deletions tests/bgp/test_bgp_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ def test_bgp_queues(duthosts, enum_frontend_dut_hostname, enum_asic_index, tbinf
# or "VOQ_CHASSIS_PEER_V4" or "VOQ_CHASSIS_PEER_V6" for VOQ_CHASSIS
# If it's external it will be "RH_V4", "RH_V6", "AH_V4", "AH_V6", ...
# Skip internal neighbors for VOQ_CHASSIS until BRCM fixes iBGP traffic in 2024011
if ("INTERNAL" in v["peer group"] or 'VOQ_CHASSIS' in v["peer group"]) and \
duthost.get_facts().get('modular_chassis'):
if ("INTERNAL" in v["peer group"] or 'VOQ_CHASSIS' in v["peer group"]) :
# Skip iBGP neighbors since we only want to verify eBGP
continue
assert (k in arp_dict.keys() or k in ndp_dict.keys())
Expand Down
7 changes: 5 additions & 2 deletions tests/common/fixtures/fib_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ def get_t2_fib_info(duthosts, duts_cfg_facts, duts_mg_facts, testname=None):
dut_port_channels.setdefault(duthost.hostname, {}).update(asic_cfg_facts[1].get('PORTCHANNEL_MEMBER', {}))
sys_neigh = {}
if switch_type == "voq":
voq_db = VoqDbCli(duthosts.supervisor_nodes[0])
if len(duthosts) == 1:
voq_db = VoqDbCli(duthosts.frontend_nodes[0])
else:
voq_db = VoqDbCli(duthosts.supervisor_nodes[0])
for entry in voq_db.dump_neighbor_table():
neigh_key = entry.split('|')
neigh_ip = neigh_key[-1]
Expand Down Expand Up @@ -320,7 +323,7 @@ def fib_info_files(duthosts, ptfhost, duts_running_config_facts, duts_minigraph_
@pytest.fixture(scope="module")
def single_fib_for_duts(tbinfo, duthosts):
# For a T2 topology, we are generating a single fib file across all asics, but have multiple frontend nodes (DUTS).
if tbinfo['topo']['type'] == "t2":
if tbinfo['topo']['type'] == "t2" and len(duthosts) > 1:
if duthosts[0].facts['switch_type'] == "voq":
return "single-fib-single-hop"
else:
Expand Down
2 changes: 1 addition & 1 deletion tests/common/helpers/sonic_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def hget_all(self, key):
v = result['stdout'].decode('unicode-escape')
else:
v = result['stdout']
v_sanitized = v.replace('\n', '\\n')
v_sanitized = v.replace('\r', '\\r').replace('\n', '\\n')
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need this change

v_dict = ast.literal_eval(v_sanitized)
return v_dict

Expand Down
11 changes: 9 additions & 2 deletions tests/common/helpers/voq_lag.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,15 @@ def get_lag_id_from_chassis_db(duthosts, pc=TMP_PC):
Returns:
lag_id: LAG ID of LAG
"""
for sup in duthosts.supervisor_nodes:
voqdb = VoqDbCli(sup)

duthosts[0].facts['switch_type'] == "voq"
is_chassis = duthosts[0].get_facts().get("modular_chassis")
if duthosts[0].facts['switch_type'] == "voq" and not is_chassis:
nodes = [duthosts[0]]
else:
nodes = duthosts.supervisor_nodes
for node in nodes:
voqdb = VoqDbCli(node)
lag_list = voqdb.get_lag_list()
for lag in lag_list:
if pc in lag:
Expand Down
8 changes: 6 additions & 2 deletions tests/everflow/everflow_test_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,12 @@ def setup_info(duthosts, rand_one_dut_hostname, tbinfo, request, topo_scenario):
if 't1' in topo or 't0' in topo or 'm0' in topo or 'mx' in topo or 'dualtor' in topo:
downstream_duthost = upstream_duthost = duthost = duthosts[rand_one_dut_hostname]
elif 't2' in topo:
pytest_assert(len(duthosts) > 1, "Test must run on whole chassis")
downstream_duthost, upstream_duthost = get_t2_duthost(duthosts, tbinfo)
if len(duthosts) == 1:
downstream_duthost = upstream_duthost = duthost = duthosts[rand_one_dut_hostname]
else:
pytest_assert(len(duthosts) > 2, "Test must run on whole chassis")
downstream_duthost, upstream_duthost = get_t2_duthost(duthosts, tbinfo)


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

Expand Down
12 changes: 12 additions & 0 deletions tests/lldp/test_lldp_syncd.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ def db_instance(duthosts, enum_rand_one_per_hwsku_frontend_hostname):
appl_db = []
for asic in duthost.asics:
appl_db.append(SonicDbCli(asic, APPL_DB))
duthost.facts['switch_type'] == "voq"
is_chassis = duthost.get_facts().get("modular_chassis")
if duthost.facts['switch_type'] == "voq" and not is_chassis:
appl_db.append(SonicDbCli(duthost, APPL_DB))
# Cleanup code here
return appl_db

Expand Down Expand Up @@ -82,6 +86,14 @@ def get_lldpctl_output(duthost):
resultDict["lldp"]["interface"].extend(
json.loads(result)["lldp"]["interface"]
)
is_chassis = duthost.get_facts().get("modular_chassis")
if duthost.facts['switch_type'] == "voq" and not is_chassis:
result = duthost.shell(
"docker exec lldp /usr/sbin/lldpctl -f json")["stdout"]
resultDict["lldp"]["interface"].extend([
json.loads(result)["lldp"]["interface"]]
)

else:
result = duthost.shell("docker exec lldp /usr/sbin/lldpctl -f json")["stdout"]
resultDict = json.loads(result)
Expand Down
Loading