-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ansible changes for Image Verification and GPG key installation #380
Open
aravindmani-1
wants to merge
12
commits into
ansible-collections:main
Choose a base branch
from
aravindmani-1:image_verification
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 6 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
c756ff8
Ansible changes for Image Verification
aravindmani-1 fd1c2e4
add fragments
aravindmani-1 14a1b7c
resolve build issues
aravindmani-1 63df33c
resolve pep8 issues
aravindmani-1 c6c989f
resolve pep8 issues
aravindmani-1 ec0a8f2
code coverage fix
aravindmani-1 e0082ae
version changes
aravindmani-1 47b9ff2
update log
aravindmani-1 3fddb66
Update 380-sonic-image-verification.yaml
aravindmani-1 224503b
fix pylint issue
aravindmani-1 7b5bdce
Merge branch 'ansible-collections:main' into image_verification
aravindmani-1 afb7eb5
Update lldp_global.py
aravindmani-1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
minor_changes: | ||
- sonic_image_management - Add support for image GPG Key installation and verification in sonic_image_management module (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/380). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
tests/regression/roles/sonic_image_management/tasks/image_gpg.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
- name: Test case - image gpg-key - Installs GPG key | ||
dellemc.enterprise_sonic.sonic_image_management: | ||
image: | ||
command: 'gpg-key' | ||
keyserver: 'hkp://keyserver.ubuntu.com:80' | ||
pubkeyid: 'DC6E36CC7FDA043B' | ||
register: result | ||
ignore_errors: yes | ||
|
||
- ansible.builtin.assert: | ||
that: | ||
- result.failed == false | ||
- result.status is defined | ||
- result.status == 'Installed public GPG key successfully' | ||
register: assert_result | ||
ignore_errors: yes | ||
|
||
- ansible.builtin.include_tasks: image_management.test.facts.report.yml | ||
vars: | ||
test_case_name: 'image_gpg_key_01' | ||
test_case_input: | ||
image: | ||
command: 'gpg-key' | ||
keyserver: 'hkp://keyserver.ubuntu.com:80' | ||
pubkeyid: 'DC6E36CC7FDA043B' | ||
|
||
- name: Test case - image gpg-key - Installs GPG key | ||
dellemc.enterprise_sonic.sonic_image_management: | ||
image: | ||
command: 'gpg-key' | ||
keyserver: 'hkp://keyserver.ubuntu.com:80' | ||
pubkeyid: 'DC6E36CC7FDA043A' | ||
register: result | ||
ignore_errors: yes | ||
|
||
- ansible.builtin.assert: | ||
that: | ||
- result.failed == false | ||
- result.status is defined | ||
- result.status == 'Failed to install public GPG key' | ||
register: assert_result | ||
ignore_errors: yes | ||
|
||
- ansible.builtin.include_tasks: image_management.test.facts.report.yml | ||
vars: | ||
test_case_name: 'image_gpg_key_02' | ||
test_case_input: | ||
image: | ||
command: 'gpg-key' | ||
keyserver: 'hkp://keyserver.ubuntu.com:80' | ||
pubkeyid: 'DC6E36CC7FDA043A' |
119 changes: 119 additions & 0 deletions
119
tests/regression/roles/sonic_image_management/tasks/image_verify.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
--- | ||
- name: Test case - image verify - Verifies image using GPG-01 | ||
dellemc.enterprise_sonic.sonic_image_management: | ||
image: | ||
command: 'verify' | ||
verifymethod: 'gpg' | ||
name: 'home://sonic-verify.bin' | ||
signaturefile: 'home://sign.gpg' | ||
register: result | ||
ignore_errors: yes | ||
|
||
|
||
- ansible.builtin.assert: | ||
that: | ||
- result.failed == false | ||
- result.status is defined | ||
- result.status == 'gpg validation succeeded.' | ||
register: assert_result | ||
ignore_errors: yes | ||
|
||
- ansible.builtin.include_tasks: image_management.test.facts.report.yml | ||
vars: | ||
test_case_name: 'image_verify_gpg_01' | ||
test_case_input: | ||
image: | ||
command: 'verify' | ||
verifymethod: 'gpg' | ||
name: 'home://sonic-verify.bin' | ||
signaturefile: 'home://sign.gpg' | ||
|
||
- name: Test case - image verify - Verifies image using GPG-02 | ||
dellemc.enterprise_sonic.sonic_image_management: | ||
image: | ||
command: 'verify' | ||
verifymethod: 'gpg' | ||
name: 'home://sonic-verify.bin' | ||
signaturefile: 'home://sign.sig' | ||
register: result | ||
ignore_errors: yes | ||
|
||
|
||
- ansible.builtin.assert: | ||
that: | ||
- result.failed == false | ||
- result.status is defined | ||
- result.status == 'gpg validation failed.' | ||
register: assert_result | ||
ignore_errors: yes | ||
|
||
- ansible.builtin.include_tasks: image_management.test.facts.report.yml | ||
vars: | ||
test_case_name: 'image_verify_gpg_02' | ||
test_case_input: | ||
image: | ||
command: 'verify' | ||
verifymethod: 'gpg' | ||
name: 'home://sonic-verify.bin' | ||
signaturefile: 'home://sign.sig' | ||
|
||
- name: Test case - image verify - Verifies image using PKI | ||
dellemc.enterprise_sonic.sonic_image_management: | ||
image: | ||
command: 'verify' | ||
verifymethod: 'pki' | ||
name: 'home://sonic-verify.bin' | ||
signaturefile: 'home://sign.sig' | ||
pubkeyfilename: 'home://DellOS10.cert.pem' | ||
register: result | ||
ignore_errors: yes | ||
|
||
|
||
- ansible.builtin.assert: | ||
that: | ||
- result.failed == false | ||
- result.status is defined | ||
- result.status == 'pki validation succeeded.' | ||
register: assert_result | ||
ignore_errors: yes | ||
|
||
- ansible.builtin.include_tasks: image_management.test.facts.report.yml | ||
vars: | ||
test_case_name: 'image_verify_pki_01' | ||
test_case_input: | ||
image: | ||
command: 'verify' | ||
verifymethod: 'pki' | ||
name: 'home://sonic-verify.bin' | ||
signaturefile: 'home://sign.sig' | ||
pubkeyfilename: 'home://DellOS10.cert.pem' | ||
|
||
- name: Test case - image verify - Verifies image using PKI | ||
dellemc.enterprise_sonic.sonic_image_management: | ||
image: | ||
command: 'verify' | ||
verifymethod: 'pki' | ||
name: 'home://sonic-verify.bin' | ||
signaturefile: 'home://sign.gpg' | ||
pubkeyfilename: 'home://DellOS10.cert.pem' | ||
register: result | ||
ignore_errors: yes | ||
|
||
- ansible.builtin.assert: | ||
that: | ||
- result.failed == false | ||
- result.status is defined | ||
- result.status == 'pki validation failed.' | ||
register: assert_result | ||
ignore_errors: yes | ||
|
||
- ansible.builtin.include_tasks: image_management.test.facts.report.yml | ||
vars: | ||
test_case_name: 'image_verify_pki_02' | ||
test_case_input: | ||
image: | ||
command: 'verify' | ||
verifymethod: 'pki' | ||
name: 'home://sonic-verify.bin' | ||
signaturefile: 'home://sign.gpg' | ||
pubkeyfilename: 'home://DellOS10.cert.pem' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this PR is still in draft, but please make sure to add version_added to each new attribute
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.