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

22 lines
502 B
Python
Raw Permalink Normal View History

2022-03-30 19:23:16 +00:00
"""Role testing files using testinfra."""
import pytest
2022-04-02 06:14:15 +00:00
2022-03-30 19:23:16 +00:00
def test_installed_packages(host):
collectd = host.package("collectd-core")
assert collectd.is_installed
2022-04-02 06:14:15 +00:00
2022-03-30 19:23:16 +00:00
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
2022-04-02 06:14:15 +00:00
2022-03-30 19:23:16 +00:00
def test_service(host):
collectd = host.service("collectd")
assert collectd.is_enabled
assert collectd.is_running