Skip to content
Open
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
10 changes: 6 additions & 4 deletions tests/bgp/test_prefix_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down Expand Up @@ -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))
Expand All @@ -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"):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading