xoxys.motd/molecule/default/tests/test_default.py
Robert Kaussow 37303a4697
All checks were successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/push/notify Pipeline was successful
ci/woodpecker/push/docs Pipeline was successful
ci: migrate to woodpecker
2024-02-18 13:59:30 +01:00

25 lines
537 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_motd_files(host):
org_name = "Exaple Inc."
motd = host.file("/etc/motd")
issue = host.file("/etc/issue")
issue_net = host.file("/etc/issue.net")
assert motd.exists
assert motd.contains(org_name)
assert issue.exists
assert issue.contains(org_name)
assert issue_net.exists
assert issue_net.contains(org_name)