From 75ca603b159a9807b047fe1e4b6a02035e0e731b Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Thu, 20 Feb 2020 22:51:06 -0500 Subject: [PATCH] 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 --- .../molecule/default/playbook.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tripleo_ansible/roles/tripleo_container_manage/molecule/default/playbook.yml b/tripleo_ansible/roles/tripleo_container_manage/molecule/default/playbook.yml index ecd9440bf..09137da7d 100644 --- a/tripleo_ansible/roles/tripleo_container_manage/molecule/default/playbook.yml +++ b/tripleo_ansible/roles/tripleo_container_manage/molecule/default/playbook.yml @@ -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