diff --git a/tests/bgp/test_bgp_queue.py b/tests/bgp/test_bgp_queue.py index 88ff7b50387..a4668554706 100644 --- a/tests/bgp/test_bgp_queue.py +++ b/tests/bgp/test_bgp_queue.py @@ -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()) diff --git a/tests/common/fixtures/fib_utils.py b/tests/common/fixtures/fib_utils.py index fdb5c927aea..e282b29ffbf 100644 --- a/tests/common/fixtures/fib_utils.py +++ b/tests/common/fixtures/fib_utils.py @@ -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] @@ -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: diff --git a/tests/common/helpers/sonic_db.py b/tests/common/helpers/sonic_db.py index 33e4edd0ed8..95d975b632e 100644 --- a/tests/common/helpers/sonic_db.py +++ b/tests/common/helpers/sonic_db.py @@ -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') v_dict = ast.literal_eval(v_sanitized) return v_dict diff --git a/tests/common/helpers/voq_lag.py b/tests/common/helpers/voq_lag.py index a529a53689e..68351c45edd 100644 --- a/tests/common/helpers/voq_lag.py +++ b/tests/common/helpers/voq_lag.py @@ -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: diff --git a/tests/everflow/everflow_test_utilities.py b/tests/everflow/everflow_test_utilities.py index 92edf563532..9ff4aa5041e 100644 --- a/tests/everflow/everflow_test_utilities.py +++ b/tests/everflow/everflow_test_utilities.py @@ -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) diff --git a/tests/lldp/test_lldp_syncd.py b/tests/lldp/test_lldp_syncd.py index e8af96bdd12..e9f5cf2d9d5 100644 --- a/tests/lldp/test_lldp_syncd.py +++ b/tests/lldp/test_lldp_syncd.py @@ -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 @@ -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)