sonic-mgmt icon indicating copy to clipboard operation
sonic-mgmt copied to clipboard

Unmatched crm facts

Open anshuldubela opened this issue 1 year ago • 14 comments

This testcase toggles the mux state from standby to active to standby. Testcase fails because the crm facts before and after are not matching.

Summary: Fixes # (issue)

Type of change

  • [x] 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?

Testcase fails because the crm facts before and after are not matching.

How did you do it?

By Verifying different approaches with crm facts collection.

How did you verify/test it?

Verified on T0 Hardware.

Any platform specific information?

NA

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

NA

Documentation

anshuldubela avatar Dec 03 '23 19:12 anshuldubela

@patrickmacarthur Please review.

anshuldubela avatar Jan 17 '24 03:01 anshuldubela

@patrickmacarthur Please review.

anshuldubela avatar Feb 22 '24 04:02 anshuldubela

@wangxin Please review.

anshuldubela avatar Feb 22 '24 04:02 anshuldubela

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/common/utilities.py:493:28: F821 undefined name 'duthost'
tests/common/utilities.py:522:28: F821 undefined name 'duthost'
tests/dualtor/test_standby_tor_upstream_mux_toggle.py:24:20: F405 'duthost' may be undefined, or defined from star imports: tests.common.dualtor.dual_tor_mock

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>

mssonicbld avatar Mar 04 '24 15:03 mssonicbld

rerun p1

anshuldubela avatar Mar 04 '24 15:03 anshuldubela

@anshuldubela The pre-commit check is a mandatory check. Please help fix accordingly.

wsycqyz avatar Mar 05 '24 01:03 wsycqyz

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/dualtor/test_standby_tor_upstream_mux_toggle.py:24:20: F405 'duthost' may be undefined, or defined from star imports: tests.common.dualtor.dual_tor_mock
tests/dualtor/test_standby_tor_upstream_mux_toggle.py:92:45: F405 'duthost' may be undefined, or defined from star imports: tests.common.dualtor.dual_tor_mock

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>

mssonicbld avatar Mar 06 '24 07:03 mssonicbld

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/dualtor/test_standby_tor_upstream_mux_toggle.py:42:8: F405 'duthosts' may be undefined, or defined from star imports: tests.common.dualtor.dual_tor_mock

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>

mssonicbld avatar Mar 15 '24 02:03 mssonicbld

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/common/utilities.py:492:12: F821 undefined name 'duthosts'
tests/common/utilities.py:521:12: F821 undefined name 'duthosts'
tests/dualtor/test_standby_tor_upstream_mux_toggle.py:42:8: F405 'duthosts' may be undefined, or defined from star imports: tests.common.dualtor.dual_tor_mock

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>

mssonicbld avatar Mar 15 '24 02:03 mssonicbld

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/common/utilities.py:492:12: F821 undefined name 'duthosts'
tests/common/utilities.py:521:12: F821 undefined name 'duthosts'

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>

mssonicbld avatar Mar 15 '24 03:03 mssonicbld

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/dualtor/test_standby_tor_upstream_mux_toggle.py:103:17: E128 continuation line under-indented for visual indent
tests/dualtor/test_standby_tor_upstream_mux_toggle.py:108:17: E128 continuation line under-indented for visual indent

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>

mssonicbld avatar Apr 02 '24 03:04 mssonicbld

Hi @bpar9 , could you assist Ansul with the merge conflict?

jamesan47 avatar Apr 08 '24 16:04 jamesan47

Hi @bpar9 , could you assist Ansul with the merge conflict?

@jamesan47 , the conflicts are in utilities.py, Anshul needs to address those accommodating for newer changes in that file

bpar9 avatar Apr 12 '24 07:04 bpar9

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/common/utilities.py:479:1: E302 expected 2 blank lines, found 1
tests/common/utilities.py:491:1: E302 expected 2 blank lines, found 1

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>

mssonicbld avatar Apr 16 '24 02:04 mssonicbld

@wsycqyz @bpar9 @lolyu Please Review.

anshuldubela avatar Jul 15 '24 10:07 anshuldubela