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

23 lines
536 B
Python
Raw Normal View History

2019-10-20 23:43:24 +02:00
import os
import testinfra.utils.ansible_runner
import warnings
2019-10-20 23:43:24 +02:00
warnings.filterwarnings("ignore", category=DeprecationWarning)
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']
).get_hosts('all')
2019-10-20 23:43:24 +02:00
def test_lvm_in_fstab(host):
fstab = host.file("/etc/fstab")
assert fstab.contains("/dev/mapper/vg_test-lv_test")
2019-10-20 23:46:03 +02:00
2019-10-20 23:43:24 +02:00
def test_lvm_mounted(host):
mount = host.check_output("mount")
2019-10-20 23:51:27 +02:00
lvm = "/dev/mapper/vg_test-lv_test on /mnt/data type ext4"
2019-10-20 23:43:24 +02:00
assert lvm in mount