From 68c52414706f659ae10df26bb5bf05df5a1208b2 Mon Sep 17 00:00:00 2001 From: sresri2 <125845681+sresri2@users.noreply.github.com> Date: Fri, 7 Aug 2026 15:39:35 -0700 Subject: [PATCH 1/2] Initial Fix Signed-off-by: sresri2 <125845681+sresri2@users.noreply.github.com> --- tests/bgp/test_prefix_list.py | 10 ++++++---- .../conditional_mark/tests_mark_conditions_vs_t2.yaml | 5 ----- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/tests/bgp/test_prefix_list.py b/tests/bgp/test_prefix_list.py index 6378695afa8..492388c94c7 100644 --- a/tests/bgp/test_prefix_list.py +++ b/tests/bgp/test_prefix_list.py @@ -5,6 +5,7 @@ import time import yaml from tests.common.helpers.assertions import pytest_assert, pytest_require +from tests.common.helpers.bgp import get_db_cli_prefix, get_vtysh_cmd_for_asic from tests.common.helpers.parallel import parallel_run pytestmark = [ @@ -60,8 +61,9 @@ def verify_prefix_list_in_db(duthost, prefix_type, prefix): def verify_prefix_in_bgp_table(duthost, ip_version, prefix): # Check whether prefix in BGP table for asic_index in duthost.get_frontend_asic_ids(): - asic_ns = f"-n {asic_index}" if duthost.is_multi_asic else "" - cmd = f"vtysh {asic_ns} -c 'show bgp {ip_version} {prefix}'" + cmd = get_vtysh_cmd_for_asic( + duthost, asic_index, f"vtysh -c 'show bgp {ip_version} {prefix}'" + ) outputs = duthost.shell(cmd)["stdout"] if "Network not in table" in outputs: logger.info("Expected prefix {} to be in the BGP table, but it was not found".format(prefix)) @@ -72,8 +74,8 @@ def verify_prefix_in_bgp_table(duthost, ip_version, prefix): def verify_prefix_in_fib_table(duthost, prefix): # Check whether prefix in FIB table for asic_index in duthost.get_frontend_asic_ids(): - asic_ns = f"-n asic{asic_index}" if duthost.is_multi_asic else "" - cmd = f"sonic-db-cli {asic_ns} APPL_DB hgetall \"ROUTE_TABLE:{prefix}\"" + db_cli = get_db_cli_prefix(duthost, asic_index) + cmd = f'{db_cli} APPL_DB hgetall "ROUTE_TABLE:{prefix}"' output = duthost.shell(cmd)["stdout"].strip().replace("'", "\"") route_info = json.loads(output) if output else {} if route_info == {} or ("blackhole" in route_info and route_info["blackhole"] == "true"): diff --git a/tests/common/plugins/conditional_mark/tests_mark_conditions_vs_t2.yaml b/tests/common/plugins/conditional_mark/tests_mark_conditions_vs_t2.yaml index 1cb5e2d3460..0e007be86ac 100644 --- a/tests/common/plugins/conditional_mark/tests_mark_conditions_vs_t2.yaml +++ b/tests/common/plugins/conditional_mark/tests_mark_conditions_vs_t2.yaml @@ -93,11 +93,6 @@ bgp/test_passive_peering.py: conditions: - asic_type in ['vs'] and 't2' in topo_name reason: This test case either cannot pass or should be skipped on virtual chassis -bgp/test_prefix_list.py: - skip: - conditions: - - asic_type in ['vs'] and 't2' in topo_name - reason: This test case either cannot pass or should be skipped on virtual chassis bgp/test_seq_idf_isolation.py: skip: conditions: From 06a2d437fbca97b70d96c58659d342a66f596d4c Mon Sep 17 00:00:00 2001 From: sresri2 <125845681+sresri2@users.noreply.github.com> Date: Mon, 10 Aug 2026 00:43:53 -0700 Subject: [PATCH 2/2] Rerun Signed-off-by: sresri2 <125845681+sresri2@users.noreply.github.com> --- tests/bgp/test_prefix_list.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/bgp/test_prefix_list.py b/tests/bgp/test_prefix_list.py index 492388c94c7..bd1f305f24e 100644 --- a/tests/bgp/test_prefix_list.py +++ b/tests/bgp/test_prefix_list.py @@ -36,7 +36,7 @@ def op_anchor_prefix_with_cmd(duthost, prefix_type, prefix, action, ignore_error=False): - # Add or remove prefix list + # Add or remove prefix list. pytest_assert(action in ["add", "remove"], "Invalid action specified. Must be 'add' or 'remove'.") cmd = "sudo prefix_list {} {} {}".format(action, prefix_type, prefix) duthost.shell(cmd, module_ignore_errors=ignore_error)