Switch tests to use Molecule.

This commit is contained in:
Jeff Geerling
2018-09-26 21:25:42 -05:00
parent 3f1a802d71
commit e14d6eb04a
10 changed files with 81 additions and 30 deletions
+14
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'