xoxys.smb/molecule/rocky8/tests/test_default.py
Robert Kaussow 9eddd1f4e3
All checks were successful
continuous-integration/drone/pr Build is passing
feat: add test for Rocky Linux 8
2021-10-03 16:32:58 +02:00

20 lines
527 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_smb_in_fstab(host):
fstab = host.file("/etc/fstab")
assert fstab.contains("//share.example.com/media")
def test_smb_credentials(host):
credentials = host.file("/root/.smbcredentials/multimedia")
assert credentials.exists
assert credentials.contains("username=myuser")
assert credentials.contains("password=secure")