mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2026-10-21 13:52:36 +00:00
The Linux workflow checks the content of the Tests/*.hc volumes by mounting them, which needs root, FUSE and the installed package, and so only runs on x86_64. Add a test that recovers the same data through the volume layer instead, so it also runs on other architectures, e.g. on the big-endian cross build under qemu-user. Tests/volume_read_test.cpp opens a volume read-only and reads its data area with Volume::ReadSectors: in one call, as multi-sector ranges at nonzero offsets with odd sector counts, again with the encryption thread pool running, and one sector at a time; every read must match the first. CPU features are detected as in the application, and the character set is taken from the environment (LC_CTYPE) so that paths with non-ASCII characters work; if that locale is unavailable, the test continues in the C locale and says so. Tests/test_volume_read.py builds it against Volume.a and Platform.a of a finished standard Linux build (CXX and NM can be set for a cross build) and checks the plaintext of every Tests/test.*.hc volume: the FAT boot sector, DUMMY.TXT with the content "Dummy" at the cluster given by the root directory, and a known SHA-256 digest of the whole data area. A volume without a digest, or a digest without a volume, is an error. It runs in the Linux workflow after the .deb build and in the build job of the big-endian workflow (test.sha512.hc only in the automatic check, all volumes in the full run), and requires the thread pool there. Signed-off-by: Ville Takio <ville+git@takio.fi>