Commit e678d5ae authored by Ondrej Kozina's avatar Ondrej Kozina Committed by Milan Broz

test: drop useless luks2 test image

parent 13b17208
......@@ -33,7 +33,6 @@ EXTRA_DIST = compatimage.img.bz2 compatv10image.img.bz2 \
luks2_keyslot_unassigned.img.xz \
img_fs_ext4.img.bz2 img_fs_vfat.img.bz2 img_fs_xfs.img.bz2 \
valid_header_file.bz2 \
luks2_header_file.xz \
luks2_valid_hdr.img.xz \
luks2_header_requirements.xz \
luks2_header_requirements_free.xz \
......
......@@ -60,7 +60,6 @@ typedef int32_t key_serial_t;
#define L_DEVICE_0S "luks_zerosec"
#define L_DEVICE_WRONG "luks_wr"
#define L_DEVICE_OK "luks_ok"
#define VALID_LUKS2_HEADER "luks2_header_file"
#define REQS_LUKS2_HEADER "luks2_header_requirements"
#define NO_REQS_LUKS2_HEADER "luks2_header_requirements_free"
#define BACKUP_FILE "csetup_backup_file"
......@@ -123,7 +122,6 @@ static char *DEVICE_2 = NULL;
static char *DEVICE_3 = NULL;
static char *DEVICE_4 = NULL;
static char *DEVICE_5 = NULL;
static char *DEVICE_6 = NULL;
static char *tmp_file_1 = NULL;
static char *test_loop_file = NULL;
......@@ -252,9 +250,6 @@ static void _cleanup(void)
if (loop_device(DEVICE_5))
loop_detach(DEVICE_5);
if (loop_device(DEVICE_6))
loop_detach(DEVICE_6);
_system("rm -f " IMAGE_EMPTY, 0);
_system("rm -f " IMAGE1, 0);
_system("rm -rf " CONV_DIR, 0);
......@@ -264,7 +259,6 @@ static void _cleanup(void)
if (tmp_file_1)
remove(tmp_file_1);
remove(VALID_LUKS2_HEADER);
remove(REQS_LUKS2_HEADER);
remove(NO_REQS_LUKS2_HEADER);
remove(BACKUP_FILE);
......@@ -279,7 +273,6 @@ static void _cleanup(void)
free(DEVICE_3);
free(DEVICE_4);
free(DEVICE_5);
free(DEVICE_6);
}
static int _setup(void)
......@@ -323,18 +316,14 @@ static int _setup(void)
fd = loop_attach(&DEVICE_2, IMAGE_EMPTY, 0, 0, &ro);
close(fd);
_system(" [ ! -e " VALID_LUKS2_HEADER " ] && xz -dk " VALID_LUKS2_HEADER ".xz", 1);
fd = loop_attach(&DEVICE_4, VALID_LUKS2_HEADER, 0, 0, &ro);
_system(" [ ! -e " NO_REQS_LUKS2_HEADER " ] && xz -dk " NO_REQS_LUKS2_HEADER ".xz", 1);
fd = loop_attach(&DEVICE_4, NO_REQS_LUKS2_HEADER, 0, 0, &ro);
close(fd);
_system(" [ ! -e " REQS_LUKS2_HEADER " ] && xz -dk " REQS_LUKS2_HEADER ".xz", 1);
fd = loop_attach(&DEVICE_5, REQS_LUKS2_HEADER, 0, 0, &ro);
close(fd);
_system(" [ ! -e " NO_REQS_LUKS2_HEADER " ] && xz -dk " NO_REQS_LUKS2_HEADER ".xz", 1);
fd = loop_attach(&DEVICE_6, NO_REQS_LUKS2_HEADER, 0, 0, &ro);
close(fd);
_system(" [ ! -d " CONV_DIR " ] && tar xJf " CONV_DIR ".tar.xz", 1);
if (_system("modprobe dm-crypt", 1))
......@@ -884,8 +873,8 @@ static void Luks2HeaderRestore(void)
OK_(crypt_init(&cd, DMDIR L_DEVICE_OK));
OK_(crypt_format(cd, CRYPT_PLAIN, cipher, cipher_mode, NULL, NULL, key_size, &pl_params));
OK_(crypt_activate_by_volume_key(cd, CDEVICE_1, key, key_size, 0));
FAIL_(crypt_header_restore(cd, CRYPT_PLAIN, VALID_LUKS2_HEADER), "Cannot restore header to PLAIN type device");
FAIL_(crypt_header_restore(cd, CRYPT_LUKS2, VALID_LUKS2_HEADER), "Cannot restore header over PLAIN type device");
FAIL_(crypt_header_restore(cd, CRYPT_PLAIN, NO_REQS_LUKS2_HEADER), "Cannot restore header to PLAIN type device");
FAIL_(crypt_header_restore(cd, CRYPT_LUKS2, NO_REQS_LUKS2_HEADER), "Cannot restore header over PLAIN type device");
EQ_(crypt_status(cd, CDEVICE_1), CRYPT_ACTIVE);
OK_(crypt_deactivate(cd, CDEVICE_1));
crypt_free(cd);
......@@ -902,7 +891,7 @@ static void Luks2HeaderRestore(void)
params.data_alignment = 8193;
OK_(crypt_init(&cd, DMDIR L_DEVICE_OK));
OK_(crypt_format(cd, CRYPT_LUKS2, cipher, cipher_mode, NULL, key, key_size, &params));
FAIL_(crypt_header_restore(cd, CRYPT_LUKS2, VALID_LUKS2_HEADER), "Payload offset mismatch");
FAIL_(crypt_header_restore(cd, CRYPT_LUKS2, NO_REQS_LUKS2_HEADER), "Payload offset mismatch");
crypt_free(cd);
params.data_alignment = 4096;
OK_(crypt_init(&cd, DMDIR L_DEVICE_OK));
......@@ -919,7 +908,7 @@ static void Luks2HeaderRestore(void)
crypt_free(cd);
OK_(crypt_init(&cd, DMDIR L_DEVICE_OK));
OK_(crypt_load(cd, CRYPT_LUKS, NULL));
FAIL_(crypt_header_restore(cd, CRYPT_LUKS2, VALID_LUKS2_HEADER), "LUKS1 format detected");
FAIL_(crypt_header_restore(cd, CRYPT_LUKS2, NO_REQS_LUKS2_HEADER), "LUKS1 format detected");
crypt_free(cd);
_cleanup_dmdevices();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment