xoxys.motd/molecule/centos7/tests/test_default.py
Robert Kaussow 991298f9e8
Some checks failed
continuous-integration/drone/push Build is failing
refactor docs
2020-01-22 22:36:03 +01:00

27 lines
616 B
Python

import os
import testinfra.utils.ansible_runner
import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)
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)