xoxys.smb/molecule/default/tests/test_default.py
Robert Kaussow 76d86bcf9b
All checks were successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/notify Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/push/docs Pipeline was successful
ci: migrate to woodpecker
2024-02-19 10:37:58 +01: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")