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'
|
2024-07-05 08:02:39 +00:00
|
|
|
|
|
|
|
def test_write_file(host):
|
|
|
|
cmd = host.run('sudo touch /mnt/data_decrypted/test.txt')
|
|
|
|
assert cmd.succeeded
|