[action] [PR:15628] Fix dualtor t0 mock orch crash #16037
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of PR
Summary:
Fixes dualtor tests when ran with mocked setup on t0 topologies.
This PR fixes 2 issues:
Fix
orchagent
crash when setting up dualtor mock environment on a t0 topo with Broadcom platform.When running dualtor tests on t0 topo, the DUT has to enter a mocked dualtor state. Part of this setup is adding a tunnel table to CONFIG_DB, which involves a Broadcom SAI attribute that is only supported when
sai_tunnel_support=1
is set insyncd:/etc/sai.d/config.bcm
- this attribute is not set untilapply_peer_switch_table_to_dut()
is run.Changing an unsupported Broadcom SAI attribute will cause
orchagent
to crash.Fix dualtor mocked tests overwriting /etc/sonic/config_db.json
When running dualtor tests on a t0 topology, the test will overwrite
/etc/sonic/config_db.json
during the test, causingconfig_reload()
at the end of the test to not restore the pre-test state of CONFIG_DB.Fixes # (issue)
Type of change
Back port request
Approach
What is the motivation for this PR?
How did you do it?
Fix
orchagent
crash by first running the setup functionapply_peer_switch_table_to_dut()
that will setsai_tunnel_support=1
, before adding the tunnel table withapply_tunnel_table_to_dut()
.Fix config mismatch by adding a fixture to backupChange config reload source config file to/etc/sonic/config_db.json
before the test, then restore andconfig reload -y
it after the test.running_golden_config
instead ofminigraph
.How did you verify/test it?
orchagent
no longer crashes.Configs are restored properly now.config_db.json
is reverted after tests are run in each test file. However,config_check
may still fail between test cases as some files only apply the fixtures once per test file instead of once per test case. This is okay asconfig_check
fail will only cause a warning log.Any platform specific information?
orchagent
crash seems to only occur to Broadcom platform on Arista hwSkus.Supported testbed topology if it's a new test case?
Documentation