Skip to content

Commit

Permalink
ensure flex_db counters match expected number on setup of pfcwd_statu…
Browse files Browse the repository at this point in the history
…s tests (sonic-net#14274)

move number of flex_db counters per port to FLEXDB_COUNTERS_PER_PORT

Change-Id: I0d63e2c4de5de424dd7ba993706e0569a5a9f6d4
  • Loading branch information
illia-kotvitskyi authored Sep 23, 2024
1 parent a4e6d2e commit 78cf50d
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions tests/generic_config_updater/test_pfcwd_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

READ_FLEXDB_TIMEOUT = 20
READ_FLEXDB_INTERVAL = 5
FLEXDB_COUNTERS_PER_PORT = 3


@pytest.fixture(autouse=True)
Expand Down Expand Up @@ -72,7 +73,7 @@ def set_default_pfcwd_config(duthost):


@pytest.fixture
def ensure_dut_readiness(duthost):
def ensure_dut_readiness(duthost, extract_pfcwd_config):
"""
Verify dut health/create and rollback checkpoint
Expand All @@ -82,6 +83,10 @@ def ensure_dut_readiness(duthost):
verify_orchagent_running_or_assert(duthost)
create_checkpoint(duthost)

pfcwd_config = extract_pfcwd_config
number_of_ports = len(pfcwd_config)
check_config_update(duthost, number_of_ports * FLEXDB_COUNTERS_PER_PORT)

yield

try:
Expand Down Expand Up @@ -190,9 +195,10 @@ def test_stop_pfcwd(duthost, extract_pfcwd_config, ensure_dut_readiness, port):
4. Validates that orchagent is running fine pre and post test
"""
pfcwd_config = extract_pfcwd_config
initial_count = len(pfcwd_config) * FLEXDB_COUNTERS_PER_PORT

if port == 'single':
expected_count = get_flex_db_count(duthost) - 3
expected_count = initial_count - FLEXDB_COUNTERS_PER_PORT
else:
expected_count = 0
json_patch = list()
Expand Down Expand Up @@ -232,9 +238,9 @@ def test_start_pfcwd(duthost, extract_pfcwd_config, ensure_dut_readiness, stop_p
pfcwd_config = extract_pfcwd_config

if port == 'single':
expected_count = 3
expected_count = FLEXDB_COUNTERS_PER_PORT
else:
expected_count = len(pfcwd_config) * 3
expected_count = len(pfcwd_config) * FLEXDB_COUNTERS_PER_PORT
json_patch = list()
exp_str = 'Ethernet'
op = 'add'
Expand Down

0 comments on commit 78cf50d

Please sign in to comment.