Switch tests to use Molecule.

This commit is contained in:
Jeff Geerling
2018-09-26 22:13:32 -05:00
parent bac7157eda
commit 41f9315a49
11 changed files with 97 additions and 56 deletions

View File

@@ -0,0 +1,14 @@
import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_hosts_file(host):
f = host.file('/etc/hosts')
assert f.exists
assert f.user == 'root'
assert f.group == 'root'