From 3a7d5955f7c287f33e1301601909941793d016db Mon Sep 17 00:00:00 2001 From: Bartek Grzybowski Date: Thu, 30 Apr 2020 05:02:03 -0700 Subject: Verify required packages were installed on target host Change-Id: Ic074cbabfee614daf7862466a1bbafc9ff0fb6be Issue-ID: INT-1576 Signed-off-by: Bartek Grzybowski --- ansible/roles/docker/molecule/default/tests/test_default.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'ansible/roles/docker') diff --git a/ansible/roles/docker/molecule/default/tests/test_default.py b/ansible/roles/docker/molecule/default/tests/test_default.py index a73572fd..fc87a6c8 100644 --- a/ansible/roles/docker/molecule/default/tests/test_default.py +++ b/ansible/roles/docker/molecule/default/tests/test_default.py @@ -8,6 +8,17 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') +@pytest.mark.parametrize('os_family, packages', [ + ('debian', ['python3-docker', 'python3-json-pointer', 'iproute2', + 'docker-ce']), + ('centos', ['python-docker-py', 'python-jsonpointer', 'docker-ce']) +]) +def test_packages_installed(host, os_family, packages): + if host.system_info.distribution == os_family: + for package in packages: + assert host.package(package).is_installed + + @pytest.mark.parametrize('svc', [ 'docker' ]) -- cgit 1.2.3-korg