diff options
author | Jan Benedikt <j.benedikt@partner.samsung.com> | 2020-05-05 08:46:19 +0200 |
---|---|---|
committer | Jan Benedikt <j.benedikt@partner.samsung.com> | 2020-05-14 09:28:34 +0200 |
commit | e56bd4f45f5d9f68aeb406510cf4aa5741405d80 (patch) | |
tree | 9436bb14f10ba9e9f480dc73e8921895aa4093ca /ansible/roles/package-repository-check/molecule/ubuntu/tests | |
parent | 56af1f9d2c3e2d0b6529d71014d619619cf25933 (diff) |
Fix lint errors in package-repository-check role
In package-repository-check was changed command module to service module due to lint failing.
Failing was caused by errors:
[301] Commands should not change things if nothing needs doing
[303] service used in place of service module
Added molecule test.
Issue-ID: OOM-2395
Signed-off-by: Jan Benedikt <j.benedikt@partner.samsung.com>
Change-Id: I6cfdfe920eabfb9a0c43cc9ba4ffcd81df1d6852
Diffstat (limited to 'ansible/roles/package-repository-check/molecule/ubuntu/tests')
-rwxr-xr-x | ansible/roles/package-repository-check/molecule/ubuntu/tests/test_default.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/ansible/roles/package-repository-check/molecule/ubuntu/tests/test_default.py b/ansible/roles/package-repository-check/molecule/ubuntu/tests/test_default.py new file mode 100755 index 00000000..3e7f3864 --- /dev/null +++ b/ansible/roles/package-repository-check/molecule/ubuntu/tests/test_default.py @@ -0,0 +1,17 @@ +import os +import pytest + +import testinfra.utils.ansible_runner + +testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( + os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') + + +@pytest.mark.parametrize('distro,pkg', [ + ('ubuntu', 'resolvconf') +]) +def test_pkg(host, distro, pkg): + os = host.system_info.distribution + if distro == os: + package = host.package(pkg) + assert package.is_installed |