sonic-mgmt
sonic-mgmt copied to clipboard
Add Secure Boot & Upgrade Tests
Description of PR
Summary:
- adding new test for secure boot feature
- Improving test_upgrade_path test
Type of change
- [X ] Test case(new/improvement)
Back port request
- [ ] 201911
- [ ] 202012
- [ ] 202205
Approach
What is the motivation for this PR?
We want to add secure upgrade test to validate non successful upgrade of non secure image and to improve the test_upgrade_path test to be able to run on canonical setup by removing the redundant fixtures to the test case
How did you verify/test it?
for secure boot test: took a secured system with feature enabled and ran this test with a non secure image
Supported testbed topology if it's a new test case?
any topology is supported for both tests
Documentation
link to feature HLD: https://github.com/sonic-net/sonic-mgmt/pull/5503
The committers listed above are authorized under a signed CLA.
- :white_check_mark: login: azmyali98 (bbc14f9e9d16c362fdffee7382119faf9740ef16, 77de6c270cd2f371b779d640dc03f3434f552bc0, 8ff103eb0c07f1bd51c79d2879412608f877955f)
The pre-commit check detected issues in the files touched by this pull request. The detected issues may be old or new. For new issues, please try to fix them.
For old issues, it is not mandatory to fix them because they were not caused by this change. It is unfair to blame author of this pull request. But if you can take extra effort to fix the old issues as well, that would be great!
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/platform_tests/test_secure_boot.py:11:1: F401 'tests.upgrade_path.test_upgrade_path.upgrade_path_lists' imported but unused
tests/platform_tests/test_secure_boot.py:23:97: F811 redefinition of unused 'upgrade_path_lists' from line 11
tests/platform_tests/test_secure_boot.py:23:121: E501 line too long (132 > 120 characters)
tests/platform_tests/test_secure_boot.py:33:37: E261 at least two spaces before inline comment
tests/platform_tests/test_secure_boot.py:40:121: E501 line too long (130 > 120 characters)
tests/platform_tests/test_secure_boot.py:42:29: E225 missing whitespace around operator
tests/upgrade_path/test_upgrade_path.py:8:1: F401 'tests.common.fixtures.advanced_reboot.get_advanced_reboot' imported but unused
tests/upgrade_path/test_upgrade_path.py:9:1: F401 'tests.platform_tests.conftest.advanceboot_loganalyzer' imported but unused
tests/upgrade_path/test_upgrade_path.py:29:1: E302 expected 2 blank lines, found 1
tests/upgrade_path/test_upgrade_path.py:40:25: F811 redefinition of unused 'get_advanced_reboot' from line 8
tests/upgrade_path/test_upgrade_path.py:40:25: E127 continuation line over-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:
- 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.
- Ensure that the
pre-commitpackage is installed:
sudo pip install pre-commit
- Go to repository root folder
- Install the pre-commit hooks:
pre-commit install
- Use pre-commit to check staged file:
pre-commit
- Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>
The pre-commit check detected issues in the files touched by this pull request. The detected issues may be old or new. For new issues, please try to fix them.
For old issues, it is not mandatory to fix them because they were not caused by this change. It is unfair to blame author of this pull request. But if you can take extra effort to fix the old issues as well, that would be great!
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/platform_tests/test_secure_boot.py:5:1: W191 indentation contains tabs
tests/platform_tests/test_secure_boot.py:6:1: W191 indentation contains tabs
tests/platform_tests/test_secure_boot.py:9:1: W191 indentation contains tabs
tests/platform_tests/test_secure_boot.py:9:121: E501 line too long (123 > 120 characters)
tests/platform_tests/test_secure_boot.py:17:1: E101 indentation contains mixed spaces and tabs
tests/platform_tests/test_secure_boot.py:18:1: F401 'tests.upgrade_path.test_upgrade_path.upgrade_path_lists' imported but unused
tests/platform_tests/test_secure_boot.py:21:1: E101 indentation contains mixed spaces and tabs
tests/platform_tests/test_secure_boot.py:22:1: E101 indentation contains mixed spaces and tabs
tests/platform_tests/test_secure_boot.py:23:1: E101 indentation contains mixed spaces and tabs
tests/platform_tests/test_secure_boot.py:24:1: E101 indentation contains mixed spaces and tabs
tests/platform_tests/test_secure_boot.py:30:97: F811 redefinition of unused 'upgrade_path_lists' from line 18
...
[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:
- 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.
- Ensure that the
pre-commitpackage is installed:
sudo pip install pre-commit
- Go to repository root folder
- Install the pre-commit hooks:
pre-commit install
- Use pre-commit to check staged file:
pre-commit
- Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>
The pre-commit check detected issues in the files touched by this pull request. The detected issues may be old or new. For new issues, please try to fix them.
For old issues, it is not mandatory to fix them because they were not caused by this change. It is unfair to blame author of this pull request. But if you can take extra effort to fix the old issues as well, that would be great!
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/platform_tests/test_secure_boot.py:5:1: W191 indentation contains tabs
tests/platform_tests/test_secure_boot.py:6:1: W191 indentation contains tabs
tests/platform_tests/test_secure_boot.py:9:1: W191 indentation contains tabs
tests/platform_tests/test_secure_boot.py:9:121: E501 line too long (123 > 120 characters)
tests/platform_tests/test_secure_boot.py:17:1: E101 indentation contains mixed spaces and tabs
tests/platform_tests/test_secure_boot.py:18:1: F401 'tests.upgrade_path.test_upgrade_path.upgrade_path_lists' imported but unused
tests/platform_tests/test_secure_boot.py:21:1: E101 indentation contains mixed spaces and tabs
tests/platform_tests/test_secure_boot.py:22:1: E101 indentation contains mixed spaces and tabs
tests/platform_tests/test_secure_boot.py:23:1: E101 indentation contains mixed spaces and tabs
tests/platform_tests/test_secure_boot.py:24:1: E101 indentation contains mixed spaces and tabs
tests/platform_tests/test_secure_boot.py:30:97: F811 redefinition of unused 'upgrade_path_lists' from line 18
...
[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:
- 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.
- Ensure that the
pre-commitpackage is installed:
sudo pip install pre-commit
- Go to repository root folder
- Install the pre-commit hooks:
pre-commit install
- Use pre-commit to check staged file:
pre-commit
- Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>
The pre-commit check detected issues in the files touched by this pull request. The detected issues may be old or new. For new issues, please try to fix them.
For old issues, it is not mandatory to fix them because they were not caused by this change. It is unfair to blame author of this pull request. But if you can take extra effort to fix the old issues as well, that would be great!
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/platform_tests/test_secure_boot.py:5:1: W191 indentation contains tabs
tests/platform_tests/test_secure_boot.py:6:1: W191 indentation contains tabs
tests/platform_tests/test_secure_boot.py:9:1: W191 indentation contains tabs
tests/platform_tests/test_secure_boot.py:9:121: E501 line too long (123 > 120 characters)
tests/platform_tests/test_secure_boot.py:17:1: E101 indentation contains mixed spaces and tabs
tests/platform_tests/test_secure_boot.py:18:1: F401 'tests.upgrade_path.test_upgrade_path.upgrade_path_lists' imported but unused
tests/platform_tests/test_secure_boot.py:21:1: E101 indentation contains mixed spaces and tabs
tests/platform_tests/test_secure_boot.py:22:1: E101 indentation contains mixed spaces and tabs
tests/platform_tests/test_secure_boot.py:23:1: E101 indentation contains mixed spaces and tabs
tests/platform_tests/test_secure_boot.py:24:1: E101 indentation contains mixed spaces and tabs
tests/platform_tests/test_secure_boot.py:30:97: F811 redefinition of unused 'upgrade_path_lists' from line 18
...
[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:
- 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.
- Ensure that the
pre-commitpackage is installed:
sudo pip install pre-commit
- Go to repository root folder
- Install the pre-commit hooks:
pre-commit install
- Use pre-commit to check staged file:
pre-commit
- Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>
The pre-commit check detected issues in the files touched by this pull request. The detected issues may be old or new. For new issues, please try to fix them.
For old issues, it is not mandatory to fix them because they were not caused by this change. It is unfair to blame author of this pull request. But if you can take extra effort to fix the old issues as well, that would be great!
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/platform_tests/test_secure_boot.py:5:1: W191 indentation contains tabs
tests/platform_tests/test_secure_boot.py:8:1: W191 indentation contains tabs
tests/platform_tests/test_secure_boot.py:14:1: F401 'tests.common.reboot' imported but unused
tests/platform_tests/test_secure_boot.py:16:1: F401 'tests.upgrade_path.upgrade_helpers.check_services' imported but unused
tests/platform_tests/test_secure_boot.py:16:1: F401 'tests.upgrade_path.upgrade_helpers.check_reboot_cause' imported but unused
tests/platform_tests/test_secure_boot.py:17:1: E101 indentation contains mixed spaces and tabs
tests/platform_tests/test_secure_boot.py:18:1: F401 'tests.upgrade_path.test_upgrade_path.upgrade_path_lists' imported but unused
tests/platform_tests/test_secure_boot.py:21:1: E101 indentation contains mixed spaces and tabs
tests/platform_tests/test_secure_boot.py:22:1: E101 indentation contains mixed spaces and tabs
tests/platform_tests/test_secure_boot.py:23:1: E101 indentation contains mixed spaces and tabs
tests/platform_tests/test_secure_boot.py:24:1: E101 indentation contains mixed spaces and tabs
...
[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:
- 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.
- Ensure that the
pre-commitpackage is installed:
sudo pip install pre-commit
- Go to repository root folder
- Install the pre-commit hooks:
pre-commit install
- Use pre-commit to check staged file:
pre-commit
- Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>
The pre-commit check detected issues in the files touched by this pull request. The detected issues may be old or new. For new issues, please try to fix them.
For old issues, it is not mandatory to fix them because they were not caused by this change. It is unfair to blame author of this pull request. But if you can take extra effort to fix the old issues as well, that would be great!
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/platform_tests/test_secure_boot.py:5:1: W191 indentation contains tabs
tests/platform_tests/test_secure_boot.py:8:1: W191 indentation contains tabs
tests/platform_tests/test_secure_boot.py:16:1: F401 'tests.upgrade_path.test_upgrade_path.upgrade_path_lists' imported but unused
tests/platform_tests/test_secure_boot.py:19:1: E101 indentation contains mixed spaces and tabs
tests/platform_tests/test_secure_boot.py:20:1: E101 indentation contains mixed spaces and tabs
tests/platform_tests/test_secure_boot.py:21:1: E101 indentation contains mixed spaces and tabs
tests/platform_tests/test_secure_boot.py:22:1: E101 indentation contains mixed spaces and tabs
tests/platform_tests/test_secure_boot.py:31:1: E101 indentation contains mixed spaces and tabs
tests/platform_tests/test_secure_boot.py:32:1: E101 indentation contains mixed spaces and tabs
tests/platform_tests/test_secure_boot.py:33:1: E101 indentation contains mixed spaces and tabs
tests/platform_tests/test_secure_boot.py:34:1: E101 indentation contains mixed spaces and tabs
...
[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:
- 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.
- Ensure that the
pre-commitpackage is installed:
sudo pip install pre-commit
- Go to repository root folder
- Install the pre-commit hooks:
pre-commit install
- Use pre-commit to check staged file:
pre-commit
- Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>
The pre-commit check detected issues in the files touched by this pull request. The detected issues may be old or new. For new issues, please try to fix them.
For old issues, it is not mandatory to fix them because they were not caused by this change. It is unfair to blame author of this pull request. But if you can take extra effort to fix the old issues as well, that would be great!
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/platform_tests/test_secure_boot.py:24:1: E302 expected 2 blank lines, found 1
tests/platform_tests/test_secure_boot.py:33:34: W605 invalid escape sequence 's'
tests/platform_tests/test_secure_boot.py:33:37: W605 invalid escape sequence ':'
tests/platform_tests/test_secure_boot.py:33:39: W605 invalid escape sequence 's'
tests/platform_tests/test_secure_boot.py:57:37: E261 at least two spaces before inline comment
tests/platform_tests/test_secure_boot.py:64:121: E501 line too long (130 > 120 characters)
To run the pre-commit checks locally, you can follow below steps:
- 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.
- Ensure that the
pre-commitpackage is installed:
sudo pip install pre-commit
- Go to repository root folder
- Install the pre-commit hooks:
pre-commit install
- Use pre-commit to check staged file:
pre-commit
- Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>
The pre-commit check detected issues in the files touched by this pull request. The detected issues may be old or new. For new issues, please try to fix them.
For old issues, it is not mandatory to fix them because they were not caused by this change. It is unfair to blame author of this pull request. But if you can take extra effort to fix the old issues as well, that would be great!
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/platform_tests/test_secure_boot.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/platform_tests/test_secure_boot.py:24:1: E302 expected 2 blank lines, found 1
tests/platform_tests/test_secure_boot.py:33:34: W605 invalid escape sequence 's'
tests/platform_tests/test_secure_boot.py:33:37: W605 invalid escape sequence ':'
tests/platform_tests/test_secure_boot.py:33:39: W605 invalid escape sequence 's'
tests/platform_tests/test_secure_boot.py:57:37: E261 at least two spaces before inline comment
...
[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:
- 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.
- Ensure that the
pre-commitpackage is installed:
sudo pip install pre-commit
- Go to repository root folder
- Install the pre-commit hooks:
pre-commit install
- Use pre-commit to check staged file:
pre-commit
- Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>
The pre-commit check detected issues in the files touched by this pull request. The detected issues may be old or new. For new issues, please try to fix them.
For old issues, it is not mandatory to fix them because they were not caused by this change. It is unfair to blame author of this pull request. But if you can take extra effort to fix the old issues as well, that would be great!
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/platform_tests/test_secure_boot.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/platform_tests/test_secure_boot.py:24:1: E302 expected 2 blank lines, found 1
tests/platform_tests/test_secure_boot.py:65:9: E128 continuation line under-indented for visual indent
To run the pre-commit checks locally, you can follow below steps:
- 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.
- Ensure that the
pre-commitpackage is installed:
sudo pip install pre-commit
- Go to repository root folder
- Install the pre-commit hooks:
pre-commit install
- Use pre-commit to check staged file:
pre-commit
- Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>
The pre-commit check detected issues in the files touched by this pull request. The detected issues may be old or new. For new issues, please try to fix them.
For old issues, it is not mandatory to fix them because they were not caused by this change. It is unfair to blame author of this pull request. But if you can take extra effort to fix the old issues as well, that would be great!
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/platform_tests/test_secure_boot.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/platform_tests/test_secure_boot.py:66:9: E128 continuation line under-indented for visual indent
To run the pre-commit checks locally, you can follow below steps:
- 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.
- Ensure that the
pre-commitpackage is installed:
sudo pip install pre-commit
- Go to repository root folder
- Install the pre-commit hooks:
pre-commit install
- Use pre-commit to check staged file:
pre-commit
- Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>
The pre-commit check detected issues in the files touched by this pull request. The detected issues may be old or new. For new issues, please try to fix them.
For old issues, it is not mandatory to fix them because they were not caused by this change. It is unfair to blame author of this pull request. But if you can take extra effort to fix the old issues as well, that would be great!
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/platform_tests/test_secure_boot.py
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Passed
To run the pre-commit checks locally, you can follow below steps:
- 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.
- Ensure that the
pre-commitpackage is installed:
sudo pip install pre-commit
- Go to repository root folder
- Install the pre-commit hooks:
pre-commit install
- Use pre-commit to check staged file:
pre-commit
- Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>
The pre-commit check detected issues in the files touched by this pull request. The detected issues may be old or new. For new issues, please try to fix them.
For old issues, it is not mandatory to fix them because they were not caused by this change. It is unfair to blame author of this pull request. But if you can take extra effort to fix the old issues as well, that would be great!
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/platform_tests/test_secure_boot.py:11:1: F401 'tests.upgrade_path.test_upgrade_path.upgrade_path_lists' imported but unused
tests/platform_tests/test_secure_boot.py:43:27: F811 redefinition of unused 'upgrade_path_lists' from line 11
To run the pre-commit checks locally, you can follow below steps:
- 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.
- Ensure that the
pre-commitpackage is installed:
sudo pip install pre-commit
- Go to repository root folder
- Install the pre-commit hooks:
pre-commit install
- Use pre-commit to check staged file:
pre-commit
- Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>
The pre-commit check detected issues in the files touched by this pull request. The detected issues may be old or new. For new issues, please try to fix them.
For old issues, it is not mandatory to fix them because they were not caused by this change. It is unfair to blame author of this pull request. But if you can take extra effort to fix the old issues as well, that would be great!
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/platform_tests/test_secure_boot.py
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Passed
To run the pre-commit checks locally, you can follow below steps:
- 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.
- Ensure that the
pre-commitpackage is installed:
sudo pip install pre-commit
- Go to repository root folder
- Install the pre-commit hooks:
pre-commit install
- Use pre-commit to check staged file:
pre-commit
- Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>
The pre-commit check detected issues in the files touched by this pull request. The detected issues may be old or new. For new issues, please try to fix them.
For old issues, it is not mandatory to fix them because they were not caused by this change. It is unfair to blame author of this pull request. But if you can take extra effort to fix the old issues as well, that would be great!
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.........................................................Failed
- hook id: check-ast
- exit code: 1
tests/platform_tests/test_secure_boot.py: failed parsing with CPython 3.8.10:
Traceback (most recent call last):
File "/home/vsts/.cache/pre-commit/repomad60ggo/py_env-python3/lib/python3.8/site-packages/pre_commit_hooks/check_ast.py", line 21, in main
ast.parse(f.read(), filename=filename)
File "/usr/lib/python3.8/ast.py", line 47, in parse
return compile(source, filename, mode, flags,
File "tests/platform_tests/test_secure_boot.py", line 69
<<<<<<< af387af592ef9da73caf04f47ecc46305fe40a01
^
SyntaxError: invalid syntax
...
[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:
- 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.
- Ensure that the
pre-commitpackage is installed:
sudo pip install pre-commit
- Go to repository root folder
- Install the pre-commit hooks:
pre-commit install
- Use pre-commit to check staged file:
pre-commit
- Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>
The pre-commit check detected issues in the files touched by this pull request. The detected issues may be old or new. For new issues, please try to fix them.
For old issues, it is not mandatory to fix them because they were not caused by this change. It is unfair to blame author of this pull request. But if you can take extra effort to fix the old issues as well, that would be great!
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/platform_tests/test_first_time_boot_password_change/manufacture.py
Fixing tests/platform_tests/test_first_time_boot_password_change/default_consts.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/platform_tests/test_first_time_boot_password_change/default_consts.py:5:1: E302 expected 2 blank lines, found 0
tests/platform_tests/test_first_time_boot_password_change/default_consts.py:25:19: E127 continuation line over-indented for visual indent
tests/platform_tests/test_first_time_boot_password_change/manufacture.py:21:1: F403 'from ansible.module_utils.basic import ' used; unable to detect undefined names
tests/platform_tests/test_first_time_boot_password_change/manufacture.py:21:1: F401 'ansible.module_utils.basic.' imported but unused
...
[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:
- 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.
- Ensure that the
pre-commitpackage is installed:
sudo pip install pre-commit
- Go to repository root folder
- Install the pre-commit hooks:
pre-commit install
- Use pre-commit to check staged file:
pre-commit
- Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>
This pull request introduces 1 alert when merging 5e9520d7020cd7a9ba534d5c1064b90bd761569f into b2b45b7980f5f10f4d311dbe4ef5725587236600 - view on LGTM.com
new alerts:
- 1 for Clear-text logging of sensitive information
Heads-up: LGTM.com's PR analysis will be disabled on the 5th of December, and LGTM.com will be shut down ⏻ completely on the 16th of December 2022. Please enable GitHub code scanning, which uses the same CodeQL engine :gear: that powers LGTM.com. For more information, please check out our post on the GitHub blog.
Hi @xumia & @lguohan, Can you help by reviewing this PR as well?
@azmyali98 can you please confirm that if the test run on a system without secured boot enable, the test is skipped and not raised error?
@AntonHryshchuk if comments were handled from your POV can you approve? @yxieca should you assign someone to review it or we can go a head and merge?
LGTM, @wangxin , could you please take a look for it?
@azmyali98 could you please refer to the open question by Xin?
Hi Liat,
I will give it a priority, I am currently loaded with our features 🙂
Azmy Ali
From: Liat Grozovik @.> Sent: 10 May 2023 21:33 To: sonic-net/sonic-mgmt @.> Cc: Azmy Ali @.>; Mention @.> Subject: Re: [sonic-net/sonic-mgmt] Add Secure Upgrade Test (PR #6816)
@azmyali98https://github.com/azmyali98 could you please refer to the open question by Xin?
— Reply to this email directly, view it on GitHubhttps://github.com/sonic-net/sonic-mgmt/pull/6816#issuecomment-1542635439, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AL6IWUYYU2PAO5L5WMINS3DXFPNO5ANCNFSM6AAAAAAR7A5TLA. You are receiving this because you were mentioned.Message ID: @.***>
External e-mail, be judicious when opening attachments or links
@liat-grozovik, fixed :)
@wangxin could you please help to approve so we can merge?