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: