ansible-cockpit/molecule/non_defaults/tests/test_non_defaults.py
2019-02-06 13:47:17 +01:00

26 lines
491 B
Python

import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_package_is_installed(host):
p = host.package('cockpit')
assert p.is_installed
def test_service_enabled(host):
s = host.service('cockpit.socket')
assert s.is_running
assert s.is_enabled
def test_listening(host):
s = host.socket('tcp://0.0.0.0:9091')
assert s.is_listening