latchset / luksmeta

GNU Lesser General Public License v2.1
25 stars 8 forks source link

Multiple tests fail #15

Open jhe2 opened 1 month ago

jhe2 commented 1 month ago

When running the tests on my system, 6 out of 7 fail. I'm running Void Linux on x86_64 with glibc. My cryptsetup version is 2.7.0 (cryptsetup 2.7.0 flags: UDEV BLKID KEYRING KERNEL_CAPI). Interestingly the last test (test-luksmeta) appears to fail for two reasons. For one the test file is too small to house a LUKS container and also the cryptsetup luksFormat command used in the tests does not specify the desired LUKS version, so it now defaults to LUKS2 (which might also explain the file-too-small issue). That then causes the test to fail.

As for the other test failures, the error messages don't tell me much. I have attached the test-suite.log file.

jhe2 commented 1 month ago

I have investigted this a little further. As for test-luksmeta, it calls cryptsetup luksFormat to create the LUKSv1 container, but doesn't specify the type. At some point the default LUKS container type has been changed from version 1 to version 2. When explicitly adding --type luks1 the test passes.

All the other tests fail for another reason, but it appears to be the same reason for all of them. As far as I can tell, each of the test starts by creating a file with a LUKSv1 container, then - depending on the particular test - metadata is added to the container and finally it is checked if the layout is as expected.

Each of those tests fails with the same unexpected nonzero: 3072 error, which apparantly means that the test expected to find a zero at that offset but didn't.

Interestingly even the test-lm-assumptions test fails in the same way and this test appears to do nothing but create the container and then immediately test if the layout is as expected. Maybe there has been some change to the LUKSv1 format at some point in time, due to which the assumptions made here aren't valid anymore?