Skip to content

Add mgmt test for testing fabric link isolation cli commands.#10994

Merged
arlakshm merged 4 commits intosonic-net:masterfrom
jfeng-arista:master-fabric-cli-and-db-test
Jan 24, 2024
Merged

Add mgmt test for testing fabric link isolation cli commands.#10994
arlakshm merged 4 commits intosonic-net:masterfrom
jfeng-arista:master-fabric-cli-and-db-test

Conversation

@jfeng-arista
Copy link
Copy Markdown
Contributor

@jfeng-arista jfeng-arista commented Dec 11, 2023

Description of PR

Summary: Add mgmt test for testing fabric link isolation cli commands.

This change adds a test for the fabric link isolation command.
The test iterates over the fabric links on a linecard. It isolates and unisolates fabric links. Each time the state of the link is changed the state is checked in both CONFIG_DB and APPL_DB. The values in CONFIG_DB are updated by the fabric CLI commands and the values in APPL_DB are updated by the fabric manager daemon. The test check if the 2 major part work as expected.

need to wait sonic-net/sonic-buildimage#17473
Fixes # (issue)

Type of change

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

Back port request

  • 201911
  • 202012
  • 202205
  • 202305

Approach

What is the motivation for this PR?

How did you do it?

How did you verify/test it?

Any platform specific information?

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

Documentation

@jfeng-arista
Copy link
Copy Markdown
Contributor Author

sonic-net/sonic-buildimage#17473 need to be merged first

@mssonicbld
Copy link
Copy Markdown
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.........................................................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook

Fixing tests/voq/test_fabric_cli_and_db.py

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/voq/test_fabric_cli_and_db.py:11:18: E221 multiple spaces before operator
tests/voq/test_fabric_cli_and_db.py:21:1: E302 expected 2 blank lines, found 1
tests/voq/test_fabric_cli_and_db.py:32:8: E111 indentation is not a multiple of 4
tests/voq/test_fabric_cli_and_db.py:33:8: E111 indentation is not a multiple of 4
tests/voq/test_fabric_cli_and_db.py:34:8: E111 indentation is not a multiple of 4
...
[truncated extra lines, please run pre-commit locally to view full check results]

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>

@mssonicbld
Copy link
Copy Markdown
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.........................................................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook

Fixing tests/voq/test_fabric_cli_and_db.py

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/voq/test_fabric_cli_and_db.py:57:26: F821 undefined name 'random'
tests/voq/test_fabric_cli_and_db.py:64:13: E265 block comment should start with '# '
tests/voq/test_fabric_cli_and_db.py:66:121: E501 line too long (126 > 120 characters)
tests/voq/test_fabric_cli_and_db.py:71:19: E128 continuation line under-indented for visual indent
tests/voq/test_fabric_cli_and_db.py:79:23: E128 continuation line under-indented for visual indent
...
[truncated extra lines, please run pre-commit locally to view full check results]

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>

@jfeng-arista jfeng-arista force-pushed the master-fabric-cli-and-db-test branch from ab78d99 to e38cda1 Compare December 12, 2023 04:08
@jfeng-arista
Copy link
Copy Markdown
Contributor Author

the failures do not seem related to the change

@jfeng-arista
Copy link
Copy Markdown
Contributor Author

/Azpw run Azure.sonic-mgmt

@mssonicbld
Copy link
Copy Markdown
Collaborator

/AzurePipelines run Azure.sonic-mgmt

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@jfeng-arista
Copy link
Copy Markdown
Contributor Author

/Azpw run Azure.sonic-mgmt

@mssonicbld
Copy link
Copy Markdown
Collaborator

/AzurePipelines run Azure.sonic-mgmt

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@judyjoseph judyjoseph requested a review from arlakshm December 14, 2023 21:39
@arlakshm
Copy link
Copy Markdown
Contributor

@jfeng-arista please add more details in the PR description on new tests are added.

Copy link
Copy Markdown
Contributor

@arlakshm arlakshm left a comment

Choose a reason for hiding this comment

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

test looks good. minor comments

@jfeng-arista
Copy link
Copy Markdown
Contributor Author

@jfeng-arista please add more details in the PR description on new tests are added.

revised. thank you !

@arlakshm arlakshm merged commit 0b3225e into sonic-net:master Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants