summaryrefslogtreecommitdiffstats
path: root/ansible/roles/package-repository-check/molecule/ubuntu/tests/test_default.py
diff options
context:
space:
mode:
authorJan Benedikt <j.benedikt@partner.samsung.com>2020-05-05 08:46:19 +0200
committerJan Benedikt <j.benedikt@partner.samsung.com>2020-05-14 09:28:34 +0200
commite56bd4f45f5d9f68aeb406510cf4aa5741405d80 (patch)
tree9436bb14f10ba9e9f480dc73e8921895aa4093ca /ansible/roles/package-repository-check/molecule/ubuntu/tests/test_default.py
parent56af1f9d2c3e2d0b6529d71014d619619cf25933 (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/test_default.py')
-rwxr-xr-xansible/roles/package-repository-check/molecule/ubuntu/tests/test_default.py17
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