sonic-net / sonic-mgmt

Configuration management examples for SONiC
Other
196 stars 716 forks source link

Config_db.json is overwritten with Config_db0.json in case of Multi-asic Environment in conftest.py #9015

Open vikshaw-Nokia opened 1 year ago

vikshaw-Nokia commented 1 year ago

Description The Issue is related to PR https://github.com/sonic-net/sonic-mgmt/pull/8884, The Particular PR replaces the indexing from None to 'ASIC0' irrespective of type of dut(Multi-asci, single asic).

Currently the variable duts_data[duthost.hostname]["pre_running_config"]["asic0"] stores the config_db.json. This Creates a issue in a multi asic Environment, As in multi-asic Environment the variable- duts_data[duthost.hostname]["pre_running_config"]["asic0"] is used to store configdb0.json. The current code replaces the stored config_db.json in duts_data with config_db0.json in core_dump_and _config_check function and reloads the config_db.json with data stored for asic0 ,if comparison fails.

For a multi_asic environment config_db0.json,config_db1.json and config_db.json each holds different set of configuration. config_db,json cannot be replaced by config_db0.json

Describe the results you received: The Content of /etc/sonic/configdb.json get overridden by the contents of /etc/sonic/configdb0.json.

Describe the results you expected: The Content of /etc/sonic/configdb.json are two different files with different data/etc/sonic/configdb0.json.

kenneth-arista commented 1 year ago

Also see https://github.com/sonic-net/sonic-mgmt/issues/9051

rlhui commented 1 year ago

Hi @yutongzhang-microsoft , let's prioritize this and work with Arvind, thanks. Tagging @wangxin

judyjoseph commented 1 year ago

Triaged with @yutongzhang-microsoft - working on a fix