summaryrefslogtreecommitdiffstats
path: root/ansible/roles/package-repository-check/molecule/ubuntu/tests/test_default.py
blob: 3e7f3864f354adbb602dae082a12a62847406cc0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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