parse_devices_in_crypttab();
This sub reads the output of /etc/crypttab and returns %crypttab
reference with its data. Check https://www.freedesktop.org/software/systemd/man/crypttab.html for more info about parsing
parse_cryptsetup_status($dev);
$dev
The encrypted device namereturns the $status
of the encrypted device. If no encrypted device found it returns a reference to an empty anonymous hash.
verify_crypttab_file_existence();
Verify the existence of /etc/crypttab file.
verify_number_of_encrypted_devices($expected_number, $actual_number);
$expected_number
the int number of the expected encrypted devices$actual_number
the int number of the actual encrypted devicesverify_cryptsetup_message($expected_message, $actual_message);
$expected_message
A string with the expected status message of a device$actual_message
A string with the actual status message of a deviceverify_cryptsetup_properties($expected_properties, $actual_properties);
$expected_properties
A hash reference with the expected LUKS properties$actual_properties
A hash reference with the actual LUKS propertiesverify_restoring_luks_backups(%args);
Where %args
expects the following parameters:
$mapped_device
path of encrypted device$backup_file_info
unique string to match with the info of the backup file$backup_path
path to a binary file used for backup of the keysValidates that the device is an encrypted one and tests the backup of the keyslot info.
verify_locked_encrypted_partition($enc_disk_part);
$enc_disk_part
block device name of the encrypted disk partition, i.e.: sda1