Add mark file for end to end test#12078
Conversation
|
The pre-commit check detected issues in the files touched by this pull request. Detailed pre-commit check results: To run the pre-commit checks locally, you can follow below steps:
|
| mark_file = "/etc/sonic/disable_loganalyzer_mark" | ||
| for duthost in duthosts: | ||
| try: | ||
| duthost.shell("touch %s" % mark_file, module_ignore_errors=True) |
There was a problem hiding this comment.
sonic-net/sonic-utilities#3102
db migrator will use this flag to detect loganalyzer is disabled in end to end test.
There was a problem hiding this comment.
Updated with simplified design.
tests/conftest.py
Outdated
| mark_file = "/etc/sonic/mgmt_test_mark" | ||
| for duthost in duthosts: | ||
| try: | ||
| duthost.shell("touch %s" % mark_file, module_ignore_errors=True) |
There was a problem hiding this comment.
You can use duthosts.shell as well. It will automatically dispatch the shell module to each duthost.
With module_ignore_error should be enough. No need to catch other exceptions. When the DUT is unreachable, the exception will be handled by other functions.
Description of PR
Summary:
Add mark file for mgmt test.
Fixes # (issue)
Microsoft ADO: 24657445
Type of change
Back port request
Approach
What is the motivation for this PR?
We need a flag to mark that DUT is under end to end test.
sonic-net/sonic-utilities#3102
db migrator needs to detect DUT is running in end to end test.
How did you do it?
Create /etc/sonic/mgmt_test_mark with fixture.
How did you verify/test it?
Run end to end test, and check /etc/sonic/mgmt_test_mark.
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation