Browse Source

Merge "tripleo_container_manage: add check mode testing"

tags/1.3.0^0
Zuul 4 months ago
committed by Gerrit Code Review
parent
commit
2a66695dbd
2 changed files with 23 additions and 1 deletions
  1. +22
    -0
      tripleo_ansible/roles/tripleo_container_manage/molecule/default/converge.yml
  2. +1
    -1
      tripleo_ansible/roles/tripleo_container_manage/molecule/default/molecule.yml

+ 22
- 0
tripleo_ansible/roles/tripleo_container_manage/molecule/default/converge.yml View File

@@ -29,6 +29,8 @@
name: tripleo_container_manage
post_tasks:
- name: Verify that Fedora container was created correctly
when:
- not ansible_check_mode|bool
block:
- name: Check for fedora container
command: podman container exists fedora
@@ -103,12 +105,16 @@
podman_container_info:
name: fedora
register: fedora_infos_old
when:
- not ansible_check_mode|bool
- include_role:
name: tripleo_container_manage
- name: Gather facts about fedora container after new run
podman_container_info:
name: fedora
register: fedora_infos_new
when:
- not ansible_check_mode|bool
post_tasks:
- name: Assert that fedora container has not been re-created
assert:
@@ -116,6 +122,8 @@
- fedora_infos_new == fedora_infos_old
fail_msg: 'fedora container was wrongly re-created'
success_msg: 'fedora container was not re-created'
when:
- not ansible_check_mode|bool

- name: Manage only one container
become: true
@@ -133,6 +141,8 @@
name: tripleo_container_manage
post_tasks:
- name: Verify that all containers still exist
when:
- not ansible_check_mode|bool
block:
- name: Check for fedora container
command: podman container exists fedora
@@ -182,6 +192,8 @@
name: tripleo_container_manage
post_tasks:
- name: Verify that all containers still exist
when:
- not ansible_check_mode|bool
block:
- name: Check for fedora container
command: podman container exists fedora
@@ -226,6 +238,8 @@
name: tripleo_container_manage
post_tasks:
- name: Verify that all containers still exist
when:
- not ansible_check_mode|bool
block:
- name: Check that fedora container was removed
command: podman container exists fedora
@@ -267,6 +281,8 @@
name: tripleo_container_manage
post_tasks:
- name: Verify that Fedora bis container was re-created correctly
when:
- not ansible_check_mode|bool
block:
- name: Check for fedora_bis container
command: podman container exists fedora_bis
@@ -282,6 +298,8 @@
success_msg: 'fedora_bis container has the right image'
- name: Check for fedora_three container
command: podman container exists fedora_three
when:
- not ansible_check_mode|bool

- name: Test a container config override
become: true
@@ -300,6 +318,8 @@
name: tripleo_container_manage
post_tasks:
- name: Verify that Fedora bis container was re-created correctly
when:
- not ansible_check_mode|bool
block:
- name: Check for fedora_bis container
command: podman container exists fedora_bis
@@ -315,3 +335,5 @@
success_msg: 'fedora_bis container has the right image'
- name: Check for fedora_three container
command: podman container exists fedora_three
when:
- not ansible_check_mode|bool

+ 1
- 1
tripleo_ansible/roles/tripleo_container_manage/molecule/default/molecule.yml View File

@@ -44,7 +44,7 @@ scenario:
test_sequence:
- prepare
- converge
- verify
- check

verifier:
name: testinfra

Loading…
Cancel
Save