-
Notifications
You must be signed in to change notification settings - Fork 740
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix dualtor t0 mock orch crash #15628
Merged
StormLiangMS
merged 3 commits into
sonic-net:master
from
justin-wong-ce:fix-dualtor-t0-mock-orch-crash
Dec 9, 2024
Merged
Fix dualtor t0 mock orch crash #15628
StormLiangMS
merged 3 commits into
sonic-net:master
from
justin-wong-ce:fix-dualtor-t0-mock-orch-crash
Dec 9, 2024
+2
−2
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 in `syncd:/etc/sai.d/config.bcm` - this attribute is not set until `apply_peer_switch_table_to_dut()` is run. Changing an unsupported Broadcom SAI attribute will cause orchagent to crash. Fix this issue by first running the setup function `apply_peer_switch_table_to_dut()` that will set `sai_tunnel_support=1`, before adding the tunnel table with `apply_tunnel_table_to_dut()`.
When running dualtor tests on a t0 topology, the test will overwrite `/etc/sonic/config_db.json` during the test, causing `config_reload()` at the end of the test to not restore the pre-test state of CONFIG_DB. Fix by adding a fixture to backup `/etc/sonic/config_db.json` before the test, then restore and `config reload -y` it after the test.
/azpw run |
/AzurePipelines run |
Azure Pipelines successfully started running 1 pipeline(s). |
lolyu
approved these changes
Dec 6, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/azpw run |
/AzurePipelines run |
Azure Pipelines successfully started running 1 pipeline(s). |
Hi @StormLiangMS, please help review/merge. |
mssonicbld
pushed a commit
to mssonicbld/sonic-mgmt
that referenced
this pull request
Dec 12, 2024
* Fix orchagent crash when setting up mock dualtor environment for t0 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 in `syncd:/etc/sai.d/config.bcm` - this attribute is not set until `apply_peer_switch_table_to_dut()` is run. Changing an unsupported Broadcom SAI attribute will cause orchagent to crash. Fix this issue by first running the setup function `apply_peer_switch_table_to_dut()` that will set `sai_tunnel_support=1`, before adding the tunnel table with `apply_tunnel_table_to_dut()`. * Fix dualtor 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, causing `config_reload()` at the end of the test to not restore the pre-test state of CONFIG_DB. Fix by adding a fixture to backup `/etc/sonic/config_db.json` before the test, then restore and `config reload -y` it after the test. * Change to reuse old config restore and use running_golden_config source
Cherry-pick PR to 202405: #16036 |
8 tasks
mssonicbld
pushed a commit
to mssonicbld/sonic-mgmt
that referenced
this pull request
Dec 12, 2024
* Fix orchagent crash when setting up mock dualtor environment for t0 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 in `syncd:/etc/sai.d/config.bcm` - this attribute is not set until `apply_peer_switch_table_to_dut()` is run. Changing an unsupported Broadcom SAI attribute will cause orchagent to crash. Fix this issue by first running the setup function `apply_peer_switch_table_to_dut()` that will set `sai_tunnel_support=1`, before adding the tunnel table with `apply_tunnel_table_to_dut()`. * Fix dualtor 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, causing `config_reload()` at the end of the test to not restore the pre-test state of CONFIG_DB. Fix by adding a fixture to backup `/etc/sonic/config_db.json` before the test, then restore and `config reload -y` it after the test. * Change to reuse old config restore and use running_golden_config source
mssonicbld
pushed a commit
to mssonicbld/sonic-mgmt
that referenced
this pull request
Dec 19, 2024
* Fix orchagent crash when setting up mock dualtor environment for t0 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 in `syncd:/etc/sai.d/config.bcm` - this attribute is not set until `apply_peer_switch_table_to_dut()` is run. Changing an unsupported Broadcom SAI attribute will cause orchagent to crash. Fix this issue by first running the setup function `apply_peer_switch_table_to_dut()` that will set `sai_tunnel_support=1`, before adding the tunnel table with `apply_tunnel_table_to_dut()`. * Fix dualtor 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, causing `config_reload()` at the end of the test to not restore the pre-test state of CONFIG_DB. Fix by adding a fixture to backup `/etc/sonic/config_db.json` before the test, then restore and `config reload -y` it after the test. * Change to reuse old config restore and use running_golden_config source
liushilongbuaa
added
Approved for 202411 branch
and removed
Approved for 202411 branch
labels
Dec 19, 2024
mssonicbld
pushed a commit
to mssonicbld/sonic-mgmt
that referenced
this pull request
Dec 19, 2024
* Fix orchagent crash when setting up mock dualtor environment for t0 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 in `syncd:/etc/sai.d/config.bcm` - this attribute is not set until `apply_peer_switch_table_to_dut()` is run. Changing an unsupported Broadcom SAI attribute will cause orchagent to crash. Fix this issue by first running the setup function `apply_peer_switch_table_to_dut()` that will set `sai_tunnel_support=1`, before adding the tunnel table with `apply_tunnel_table_to_dut()`. * Fix dualtor 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, causing `config_reload()` at the end of the test to not restore the pre-test state of CONFIG_DB. Fix by adding a fixture to backup `/etc/sonic/config_db.json` before the test, then restore and `config reload -y` it after the test. * Change to reuse old config restore and use running_golden_config source
Cherry-pick PR to 202411: #16037 |
8 tasks
mssonicbld
pushed a commit
that referenced
this pull request
Dec 19, 2024
* Fix orchagent crash when setting up mock dualtor environment for t0 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 in `syncd:/etc/sai.d/config.bcm` - this attribute is not set until `apply_peer_switch_table_to_dut()` is run. Changing an unsupported Broadcom SAI attribute will cause orchagent to crash. Fix this issue by first running the setup function `apply_peer_switch_table_to_dut()` that will set `sai_tunnel_support=1`, before adding the tunnel table with `apply_tunnel_table_to_dut()`. * Fix dualtor 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, causing `config_reload()` at the end of the test to not restore the pre-test state of CONFIG_DB. Fix by adding a fixture to backup `/etc/sonic/config_db.json` before the test, then restore and `config reload -y` it after the test. * Change to reuse old config restore and use running_golden_config source
mssonicbld
added
Included in 202411 branch
and removed
Created PR to 202411 branch
labels
Dec 19, 2024
mssonicbld
pushed a commit
that referenced
this pull request
Dec 28, 2024
* Fix orchagent crash when setting up mock dualtor environment for t0 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 in `syncd:/etc/sai.d/config.bcm` - this attribute is not set until `apply_peer_switch_table_to_dut()` is run. Changing an unsupported Broadcom SAI attribute will cause orchagent to crash. Fix this issue by first running the setup function `apply_peer_switch_table_to_dut()` that will set `sai_tunnel_support=1`, before adding the tunnel table with `apply_tunnel_table_to_dut()`. * Fix dualtor 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, causing `config_reload()` at the end of the test to not restore the pre-test state of CONFIG_DB. Fix by adding a fixture to backup `/etc/sonic/config_db.json` before the test, then restore and `config reload -y` it after the test. * Change to reuse old config restore and use running_golden_config source
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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