tripleo_container_manage: add systemd testcase for service reload

Add a test that update a container managed by systemd; with a new image.
The container should be removed and re-created; and its systemd files.

We have seen race conditions in Ansible/Systemd where the unit file
could not be found. This patch will prevent that to happen thanks to a
functional test.

Change-Id: I7b7392f68d7f5b4b991c5238e7abd40d72a08b10
This commit is contained in:
Emilien Macchi 2020-02-20 22:51:06 -05:00
parent f3729699ff
commit 75ca603b15
1 changed files with 13 additions and 0 deletions

View File

@ -125,6 +125,9 @@
tripleo_container_manage_config: '/tmp/container-configs'
tripleo_container_manage_debug: true
tripleo_container_manage_config_patterns: 'fedora.json'
tripleo_container_manage_config_overrides:
fedora:
image: fedora:rawhide
tasks:
- include_role:
name: tripleo_container_manage
@ -133,6 +136,16 @@
block:
- name: Check for fedora container
command: podman container exists fedora
- name: Gather facts about fedora container
podman_container_info:
name: fedora
register: fedora_infos
- name: Assert that fedora container has the right image
assert:
that:
- "'fedora:rawhide' in fedora_infos.containers.0.ImageName"
fail_msg: 'fedora container has wrong image'
success_msg: 'fedora container has the right image'
- name: Check if tripleo_fedora systemd service is active
command: systemctl is-active --quiet tripleo_fedora
register: tripleo_fedora_active_result