Skip to content

Fix route/test_forced_mgmt_route.py#13118

Merged
StormLiangMS merged 2 commits intosonic-net:masterfrom
vkjammala-arista:test-forced-mgmt-route
Jun 6, 2024
Merged

Fix route/test_forced_mgmt_route.py#13118
StormLiangMS merged 2 commits intosonic-net:masterfrom
vkjammala-arista:test-forced-mgmt-route

Conversation

@vkjammala-arista
Copy link
Contributor

@vkjammala-arista vkjammala-arista commented Jun 4, 2024

Description of PR

Summary: Fix route/test_forced_mgmt_route.py failures during teardown
Fixes # aristanetworks/sonic-qual.msft#113

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Back port request

  • 201911
  • 202012
  • 202205
  • 202305
  • 202311

Approach

What is the motivation for this PR?

Test is tampering the running config of the duthost and leaving the config in this state. This is causing failures during teardown core_dump_and_config_check is failing during config_db_check.

Also seeing loganalyzer failures with symptom similar to ERR syncd#syncd: [none] SAI_API_UNSPECIFIED:sai_api_query:449 Invalid sai_api_t 50 passed to sai_api_query ... (mostly due to config changes)

How did you do it?

Perform "config_reload" with the backup config as part of fixture teardown (backup_restore_config).

How did you verify/test it?

Test is passing consistently with the fix (verified on Arista-7260CX3-C64), verified on 202305 and 202311 branches.

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

Test is tampering the running config of the device, thus "config_reload"
with the backup config is needed as part of test teardown.
@mssonicbld
Copy link
Collaborator

The pre-commit check detected issues in the files touched by this pull request.
The pre-commit check is a mandatory check, please fix detected issues.

Detailed pre-commit check results:
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

tests/route/test_forced_mgmt_route.py:44:5: F821 undefined name 'config_reload'

flake8...............................................(no files to check)Skipped
check conditional mark sort..........................(no files to check)Skipped

To run the pre-commit checks locally, you can follow below steps:

  1. Ensure that default python is python3. In sonic-mgmt docker container, default python is python2. You can run
    the check by activating the python3 virtual environment in sonic-mgmt docker container or outside of sonic-mgmt
    docker container.
  2. Ensure that the pre-commit package is installed:
sudo pip install pre-commit
  1. Go to repository root folder
  2. Install the pre-commit hooks:
pre-commit install
  1. Use pre-commit to check staged file:
pre-commit
  1. Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>

@wsycqyz
Copy link
Contributor

wsycqyz commented Jun 5, 2024

The pre-commit check is mandatory. Please check.

@vkjammala-arista
Copy link
Contributor Author

The pre-commit check is mandatory. Please check.

Somehow missed this. Updated the diff, Thanks!

Copy link
Contributor

@wsycqyz wsycqyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wsycqyz
Copy link
Contributor

wsycqyz commented Jun 6, 2024

Do you need backport to 202305 and 202311 branch?

Copy link
Collaborator

@StormLiangMS StormLiangMS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@StormLiangMS
Copy link
Collaborator

hi @yxieca for 202311 cherry pick.

mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Jun 6, 2024
What is the motivation for this PR?
Test is tampering the running config of the duthost and leaving the config in this state. This is causing failures during teardown core_dump_and_config_check is failing during config_db_check.

Also seeing loganalyzer failures with symptom similar to  ERR syncd#syncd: [none] SAI_API_UNSPECIFIED:sai_api_query:449 Invalid sai_api_t 50 passed to sai_api_query ... (mostly due to config changes)

How did you do it?
Perform "config_reload" with the backup config as part of fixture teardown (backup_restore_config).

How did you verify/test it?
Test is passing consistently with the fix (verified on Arista-7260CX3-C64), verified on 202305 and 202311 branches.
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202305: #13161

mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Jun 12, 2024
What is the motivation for this PR?
Test is tampering the running config of the duthost and leaving the config in this state. This is causing failures during teardown core_dump_and_config_check is failing during config_db_check.

Also seeing loganalyzer failures with symptom similar to  ERR syncd#syncd: [none] SAI_API_UNSPECIFIED:sai_api_query:449 Invalid sai_api_t 50 passed to sai_api_query ... (mostly due to config changes)

How did you do it?
Perform "config_reload" with the backup config as part of fixture teardown (backup_restore_config).

How did you verify/test it?
Test is passing consistently with the fix (verified on Arista-7260CX3-C64), verified on 202305 and 202311 branches.
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202311: #13238

@vkjammala-arista vkjammala-arista deleted the test-forced-mgmt-route branch June 12, 2024 04:08
mssonicbld pushed a commit that referenced this pull request Jun 12, 2024
What is the motivation for this PR?
Test is tampering the running config of the duthost and leaving the config in this state. This is causing failures during teardown core_dump_and_config_check is failing during config_db_check.

Also seeing loganalyzer failures with symptom similar to  ERR syncd#syncd: [none] SAI_API_UNSPECIFIED:sai_api_query:449 Invalid sai_api_t 50 passed to sai_api_query ... (mostly due to config changes)

How did you do it?
Perform "config_reload" with the backup config as part of fixture teardown (backup_restore_config).

How did you verify/test it?
Test is passing consistently with the fix (verified on Arista-7260CX3-C64), verified on 202305 and 202311 branches.
mssonicbld pushed a commit that referenced this pull request Jun 20, 2024
What is the motivation for this PR?
Test is tampering the running config of the duthost and leaving the config in this state. This is causing failures during teardown core_dump_and_config_check is failing during config_db_check.

Also seeing loganalyzer failures with symptom similar to  ERR syncd#syncd: [none] SAI_API_UNSPECIFIED:sai_api_query:449 Invalid sai_api_t 50 passed to sai_api_query ... (mostly due to config changes)

How did you do it?
Perform "config_reload" with the backup config as part of fixture teardown (backup_restore_config).

How did you verify/test it?
Test is passing consistently with the fix (verified on Arista-7260CX3-C64), verified on 202305 and 202311 branches.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants