-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
playbook and role agisoft: add tests
- Loading branch information
Showing
5 changed files
with
96 additions
and
0 deletions.
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,28 @@ | ||
--- | ||
platforms: | ||
# - name: workspace-src-ubuntu_focal-desktop | ||
# image: ghcr.io/utrechtuniversity/src-test-workspace:ubuntu_focal-desktop | ||
# pre_build_image: true | ||
# registry: | ||
# url: $DOCKER_REGISTRY | ||
# credentials: | ||
# username: $DOCKER_USER | ||
# password: $DOCKER_PW | ||
- name: workspace-src-ubuntu_jammy-desktop | ||
image: ghcr.io/utrechtuniversity/src-test-workspace:ubuntu_jammy-desktop | ||
pre_build_image: true | ||
registry: | ||
url: $DOCKER_REGISTRY | ||
credentials: | ||
username: $DOCKER_USER | ||
password: $DOCKER_PW | ||
provisioner: | ||
name: ansible | ||
env: | ||
components: | ||
- name: agisoft | ||
path: agisoft.yml | ||
parameters: | ||
license: | | ||
FOO | ||
BAR |
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,22 @@ | ||
--- | ||
- name: Verify | ||
hosts: all | ||
gather_facts: false | ||
tasks: | ||
- name: Read license file | ||
ansible.builtin.slurp: | ||
path: /opt/metashape-pro/license.lic | ||
register: slurp_license | ||
|
||
- name: Set result license file | ||
ansible.builtin.set_fact: | ||
slurp_result: "{{ slurp_license['content'] | b64decode }}" | ||
|
||
- name: Debug | ||
ansible.builtin.debug: | ||
var: slurp_result | ||
|
||
- name: Assert license file has correct newlines | ||
ansible.builtin.assert: | ||
that: | ||
- "slurp_result == 'FOO\nBAR\n'" |
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,8 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
gather_facts: true | ||
roles: | ||
- role: agisoft | ||
vars: | ||
license: 'foo\nbar' |
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,37 @@ | ||
--- | ||
driver: | ||
name: ${DRIVER-podman} | ||
image_settings: &image_settings | ||
pre_build_image: true | ||
registry: | ||
url: $DOCKER_REGISTRY | ||
credentials: | ||
username: $DOCKER_USER | ||
password: $DOCKER_PW | ||
provisioner: | ||
name: ansible | ||
playbooks: | ||
converge: ./converge.yml | ||
env: | ||
ANSIBLE_ROLES_PATH: ../../../ | ||
role_name_check: 1 | ||
scenario: | ||
test_sequence: | ||
- dependency | ||
- cleanup | ||
- destroy | ||
- syntax | ||
- create | ||
- prepare | ||
- converge not necessary since we include the role in the verify step | ||
- idempotence not necessary since we're only setting facts in this role | ||
- verify | ||
- cleanup | ||
- destroy | ||
platforms: | ||
- name: workspace-src-ubuntu_focal-desktop | ||
image: ghcr.io/utrechtuniversity/src-test-workspace:ubuntu_focal-desktop | ||
<<: *image_settings | ||
- name: workspace-src-ubuntu_jammy-desktop | ||
image: ghcr.io/utrechtuniversity/src-test-workspace:ubuntu_jammy-desktop | ||
<<: *image_settings |
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