xoxys.lvm/molecule/centos8/tests/test_default.py

19 lines
455 B
Python
Raw Normal View History

2020-01-26 14:42:22 +00:00
import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
2021-06-07 20:28:33 +00:00
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("all")
2020-01-26 14:42:22 +00:00
def test_lvm_in_fstab(host):
fstab = host.file("/etc/fstab")
assert fstab.contains("/dev/mapper/vg_test-lv_test")
def test_lvm_mounted(host):
mount = host.check_output("mount")
lvm = "/dev/mapper/vg_test-lv_test on /mnt/data type ext4"
assert lvm in mount