You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
with allure.step("disabling all counterpolls"):
for asic in duthost.asics:
ConterpollHelper.disable_counterpoll(asic, list(CounterpollConstants.COUNTERPOLL_MAPPING.values()))
# verify relevant counterpolls (queue/watermark/pg-drop) are disabled
with allure.step("Verifying initial output of {} on {} ..."
.format(CounterpollConstants.COUNTERPOLL_SHOW, duthost.hostname)):
verify_all_counterpoll_status(duthost, DISABLE)
with allure.step("saving config on dut {} after counterpoll disable...".format(duthost.hostname)):
duthost.command('config save -y')
The test expects the fixture backup_and_restore_config_db to restore the config_db.json file back to it's original contents after the test completes.
However, the test uses a different fixture to pick the dut than the backup_and_restore_config_db fixture uses.
I.E. test_counterpoll_queue_watermark_pg_drop uses enum_rand_one_per_hwsku_frontend_hostname backup_and_restore_config_db uses rand_one_dut_hostname
This can result in the dut that is being backed up to be different from the one which is being tested.
E.G. test is run on LC4 and LC6
But looking at the logs I see the config_db that is backed up is on LC5:
10/12/2024 23:00:08 duthost_utils._backup_and_restore_config L0043 INFO | Backup /etc/sonic/config_db.json to /host/config_db.json.before_test_function on cmp227-5
Additionally the bottom level function _backup_and_restore_config_db doesn't support multi-asic config_dbs:
CONFIG_DB = "/etc/sonic/config_db.json"
CONFIG_DB_BAK = "/host/config_db.json.before_test_{}".format(scope)
if type(duts) is not list:
duthosts = [duts]
else:
duthosts = duts
for duthost in duthosts:
logger.info("Backup {} to {} on {}".format(CONFIG_DB, CONFIG_DB_BAK, duthost.hostname))
duthost.shell("cp {} {}".format(CONFIG_DB, CONFIG_DB_BAK))
yield
for duthost in duthosts:
logger.info("Restore {} with {} on {}".format(CONFIG_DB, CONFIG_DB_BAK, duthost.hostname))
duthost.shell("mv {} {}".format(CONFIG_DB_BAK, CONFIG_DB))
Results you see
The config_db.json files are modified after running platform_test/counterpoll/test_counterpoll_watermark.py
E.G.
Before:
/etc/sonic/config_db.json
Issue Description
platform_test/counterpoll/test_counterpoll_watermark.py
disables FLEX_COUNTERs and saves the config:sonic-mgmt/tests/platform_tests/counterpoll/test_counterpoll_watermark.py
Line 113 in 422856c
The test expects the fixture
backup_and_restore_config_db
to restore the config_db.json file back to it's original contents after the test completes.However, the test uses a different fixture to pick the dut than the
backup_and_restore_config_db
fixture uses.I.E.
test_counterpoll_queue_watermark_pg_drop
usesenum_rand_one_per_hwsku_frontend_hostname
backup_and_restore_config_db
usesrand_one_dut_hostname
This can result in the dut that is being backed up to be different from the one which is being tested.
E.G. test is run on LC4 and LC6
But looking at the logs I see the config_db that is backed up is on LC5:
Additionally the bottom level function
_backup_and_restore_config_db
doesn't support multi-asic config_dbs:sonic-mgmt/tests/common/fixtures/duthost_utils.py
Line 27 in 87ee066
Results you see
The config_db.json files are modified after running
platform_test/counterpoll/test_counterpoll_watermark.py
E.G.
Before:
/etc/sonic/config_db.json
After:
/etc/sonic/config_db.json
Results you expected to see
The config_db.json files should not be modified after running
platform_test/counterpoll/test_counterpoll_watermark.py
Is it platform specific
generic
Relevant log output
No response
Output of
show version
No response
Attach files (if any)
No response
The text was updated successfully, but these errors were encountered: