xoxys.udev/molecule/default/tests/test_default.py

16 lines
354 B
Python
Raw Normal View History

2023-04-11 18:44:03 +00:00
import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("all")
def test_udev_symlink(host):
device = host.file("/dev/disk/by-id/molecule")
assert device.exists
assert device.is_symlink
assert device.linked_to == "/dev/sda"