From Fedora Project Wiki
Description
This test case ensures the correct functioning of cryptsetup
, which is a utility used for setting up encrypted storage using the Device Mapper. The associated cryptsetup-libs
provides the necessary libraries for cryptsetup
.
Setup
- Install
cryptsetup
andcryptsetup-libs
:sudo dnf install cryptsetup cryptsetup-libs
. - Create a blank file for testing:
dd if=/dev/zero of=~/testcrypt bs=1M count=10
.
How to test
- Create a loopback device:
sudo losetup -f ~/testcrypt
. - Find the associated loopback device:
losetup -j ~/testcrypt
(note the loop device name for next steps). - Format the loopback device as a LUKS device:
sudo cryptsetup luksFormat /dev/loopX
(replaceloopX
with your loop device name). - Open the LUKS device:
sudo cryptsetup luksOpen /dev/loopX mycrypt
. - Check that a
/dev/mapper/mycrypt
device now exists. - Close the LUKS device:
sudo cryptsetup luksClose mycrypt
.
Expected Results
- The loopback device should be successfully created without any errors.
- The LUKS format command should prompt for a passphrase and complete without errors.
- After opening, the
/dev/mapper/mycrypt
device should be present. - After closing, the
/dev/mapper/mycrypt
device should be removed.
Optional
For extended testing:
- Try opening the LUKS device with an incorrect passphrase.
- Test various
cryptsetup
commands and options. - Examine manual pages for more commands and utilities: e.g.,
man cryptsetup
.