diff options
author | Bartek Grzybowski <b.grzybowski@partner.samsung.com> | 2020-04-30 05:02:03 -0700 |
---|---|---|
committer | Bartek Grzybowski <b.grzybowski@partner.samsung.com> | 2020-04-30 05:37:04 -0700 |
commit | 3a7d5955f7c287f33e1301601909941793d016db (patch) | |
tree | 84346e9bbcad00c9b86ddd01f687c8cc84c2a0cc | |
parent | 69d40108919ea4cece1db1632a6dfd43750d4840 (diff) |
Verify required packages were installed on target host
Change-Id: Ic074cbabfee614daf7862466a1bbafc9ff0fb6be
Issue-ID: INT-1576
Signed-off-by: Bartek Grzybowski <b.grzybowski@partner.samsung.com>
-rw-r--r-- | ansible/roles/docker/molecule/default/tests/test_default.py | 11 |
1 files changed, 11 insertions, 0 deletions
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' ]) |