generated from linux-system-roles/template
-
Notifications
You must be signed in to change notification settings - Fork 11
tests: Add bootc end-to-end validation test #126
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,29 @@ | ||
| # SPDX-License-Identifier: MIT | ||
| --- | ||
| - name: Bootc end-to-end test | ||
| hosts: all | ||
| tags: | ||
| - tests::bootc-e2e | ||
| gather_facts: false | ||
| tasks: | ||
| - name: Bootc image build preparation | ||
| when: ansible_connection | d("") == "buildah" | ||
| block: | ||
| - name: Run postgresql role | ||
| include_role: | ||
| name: linux-system-roles.postgresql | ||
|
|
||
| - name: Create QEMU deployment | ||
| delegate_to: localhost | ||
| command: "{{ lsr_scriptdir }}/bootc-buildah-qcow.sh {{ ansible_host }}" | ||
| changed_when: true | ||
|
|
||
| - name: Validation of deployed image | ||
| when: ansible_connection | d("") != "buildah" | ||
| block: | ||
| - name: Test default settings | ||
| include_tasks: tasks/install_and_check.yml | ||
| vars: | ||
| __run_role: false | ||
| __test_clean_instance: false | ||
| __postgresql_is_booted: true | ||
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.
Under what conditions can
ansible_connectionbe undefined? Because above you reference it without the| d()inpostgresql_server_tuning: "{{ false if ansible_connection == 'buildah' else true }}"?Uh oh!
There was an error while loading. Please reload this page.
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.
ansible_connectionis undefined for QEMU runs, i.e. when not using an external connection plugin.Without the
| d()it fails like this:Apparently Ansible gets along with testing for equality
==against an undefined value, but not with!=. However, that's confusing, and I applied the default everywhere now for consistency.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.
That's really strange. I cannot reproduce this behavior. No matter what I try, I get
"ansible_connection": "ssh"unless I explicitly specify another connection type.Can you provide your exact
toxcommand line?That is even stranger.
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.
Prep (works):
Validate:
Perhaps you forgot the
-e __bootc_validation=true?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.
The variable reference is in a handler - code run in handlers is in a strange variable namespace - I have seen cases where
varsdefined in the playbook are not available in the handler - but this one doesn't make any sense - if I put a debug var: ansible_connection at the beginning of the playbook, it prints the value - I have no idea why it would be removed before the handler is run - I'll chalk this up to a bug in ansible that we have to workaround.