Ansible_workstation/roles/collectd/molecule/default/tests/test_default.py

19 lines
499 B
Python
Raw Permalink Normal View History

2022-03-30 19:23:16 +00:00
"""Role testing files using testinfra."""
import pytest
def test_installed_packages(host):
collectd = host.package("collectd-core")
assert collectd.is_installed
def test_config(host):
collectd_config = host.file("/etc/collectd/collectd.conf")
assert collectd_config.exists
dtypes = host.file("/usr/share/collectd/types.db")
assert dtypes.exists
def test_service(host):
collectd = host.service("collectd")
assert collectd.is_enabled
assert collectd.is_running