xoxys.motd/molecule/centos7/tests/test_default.py

25 lines
537 B
Python
Raw Normal View History

2019-11-09 15:15:28 +00:00
import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
2021-06-07 20:29:01 +00:00
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("all")
2019-11-09 15:15:28 +00:00
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)