ansible-role-luks/molecule/default/tests/test_default.py

17 lines
502 B
Python
Raw Normal View History

2021-09-12 21:58:11 +00:00
import testinfra.utils.ansible_runner
def test_packages(host):
for package_name in ['cryptsetup', 'util-linux']:
package = host.package(package_name)
assert package.is_installed
def test_mount_device_encrypted(host):
mount = host.mount_point('/mnt/data_decrypted')
assert mount.exists
assert mount.device == '/dev/mapper/data_encrypted'
assert mount.filesystem == 'ext4'
def test_write_file(host):
cmd = host.run('sudo touch /mnt/data_decrypted/test.txt')
assert cmd.succeeded