xoxys.logrotate/molecule/default/tests/test_default.py
Robert Kaussow 5b2ad0da4c
All checks were successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/push/docs Pipeline was successful
ci/woodpecker/push/notify Pipeline was successful
ci: migrate to woodpecker
2024-02-18 20:19:33 +01:00

30 lines
747 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_logrotate_install(host):
assert host.package("logrotate").is_installed
def test_logrotate_globals(host):
conf = host.file("/etc/logrotate.conf")
assert conf.exists
assert conf.contains("# Ansible managed")
assert conf.contains("rotate 4")
assert conf.contains("include /etc/logrotate.d")
def test_logrotate_sysconfig(host):
conf = host.file("/etc/logrotate.d/syslog")
assert conf.exists
assert conf.contains("# Ansible managed")
assert conf.contains("missingok")
assert conf.contains("/usr/bin/systemctl kill")