-
Notifications
You must be signed in to change notification settings - Fork 3
[DNM] add content guard test #74
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,16 @@ | |
| name: test_dist_repo | ||
| state: present | ||
|
|
||
| - name: Create test content guard | ||
| pulp.squeezer.x509_cert_guard: | ||
| pulp_url: "{{ pulp_url }}" | ||
| username: "{{ pulp_username }}" | ||
| password: "{{ pulp_password }}" | ||
| validate_certs: "{{ pulp_validate_certs }}" | ||
| name: test_dist_guard | ||
| ca_certificate: "{{ lookup('file', 'files/ca.pem') }}" | ||
| state: present | ||
|
|
||
| - name: Create test container distributions | ||
| stackhpc.pulp.container_distributions: | ||
| pulp_url: "{{ pulp_url }}" | ||
|
|
@@ -33,17 +43,24 @@ | |
| repository: test_dist_repo | ||
| private: true | ||
| state: present | ||
| - name: test_dist_guarded | ||
| base_path: test_dist_guarded | ||
| repository: test_dist_repo | ||
| content_guard: test_dist_guard | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The It is recommended to either update the module to support name resolution for content_guard: "{{ guard_result.x509_cert_guard.pulp_href }}"
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. exactly why this test here ;) |
||
| state: present | ||
| register: create_result | ||
|
|
||
| - name: Verify distribution creation | ||
| assert: | ||
| that: | ||
| - create_result.distributions | length == 2 | ||
| - create_result.distributions | length == 3 | ||
| - create_result.distributions[0].name == "test_dist_1" | ||
| - create_result.distributions[0].distribution.base_path == "test_dist_1" | ||
| - create_result.distributions[0].changed == true | ||
| - create_result.distributions[1].name == "test_dist_2" | ||
| - create_result.distributions[1].distribution.private == true | ||
| - create_result.distributions[2].name == "test_dist_guarded" | ||
| - create_result.distributions[2].distribution.content_guard is search("/contentguards/") | ||
|
Comment on lines
+62
to
+63
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is recommended to verify that the newly created distribution was actually marked as changed during the creation task. - create_result.distributions[2].name == "test_dist_guarded"
- create_result.distributions[2].changed == true
- create_result.distributions[2].distribution.content_guard is search("/contentguards/") |
||
|
|
||
| - name: Update container distributions | ||
| stackhpc.pulp.container_distributions: | ||
|
|
@@ -93,13 +110,25 @@ | |
| state: absent | ||
| - name: test_dist_2 | ||
| state: absent | ||
| - name: test_dist_guarded | ||
| state: absent | ||
| register: delete_result | ||
|
|
||
| - name: Verify distribution deletion | ||
| assert: | ||
| that: | ||
| - delete_result.distributions[0].changed == true | ||
| - delete_result.distributions[1].changed == true | ||
| - delete_result.distributions[2].changed == true | ||
|
|
||
| - name: Clean up test content guard | ||
| pulp.squeezer.x509_cert_guard: | ||
| pulp_url: "{{ pulp_url }}" | ||
| username: "{{ pulp_username }}" | ||
| password: "{{ pulp_password }}" | ||
| validate_certs: "{{ pulp_validate_certs }}" | ||
| name: test_dist_guard | ||
| state: absent | ||
|
|
||
| - name: Clean up test repository | ||
| pulp.squeezer.container_repository: | ||
|
|
||
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.
To ensure the created content guard can be correctly referenced by its HREF in subsequent tasks, it is recommended to register the output of this task. This is particularly important because the
container_distributionsmodule (as seen in the context) does not currently appear to perform name-to-HREF resolution for thecontent_guardparameter.