summaryrefslogtreecommitdiffstats
path: root/tests/tcrypt-compat-test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 08:35:41 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 08:35:41 +0000
commitf7458043ae6a2d2d54b911fac52e50341646bef2 (patch)
tree6c58e084cd8728490fd5bb8eead07db0be0038f4 /tests/tcrypt-compat-test
parentAdding upstream version 2:2.6.1. (diff)
downloadcryptsetup-f7458043ae6a2d2d54b911fac52e50341646bef2.tar.xz
cryptsetup-f7458043ae6a2d2d54b911fac52e50341646bef2.zip
Adding upstream version 2:2.7.0.upstream/2%2.7.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/tcrypt-compat-test')
-rwxr-xr-xtests/tcrypt-compat-test28
1 files changed, 18 insertions, 10 deletions
diff --git a/tests/tcrypt-compat-test b/tests/tcrypt-compat-test
index c0fc50a..0708b32 100755
--- a/tests/tcrypt-compat-test
+++ b/tests/tcrypt-compat-test
@@ -11,8 +11,12 @@ PASSWORD_HIDDEN="bbbbbbbbbbbb"
PASSWORD_72C="aaaaaaaaaaaabbbbbbbbbbbbccccccccccccddddddddddddeeeeeeeeeeeeffffffffffff"
PIM=1234
-CRYPTSETUP_VALGRIND=../.libs/cryptsetup
-CRYPTSETUP_LIB_VALGRIND=../.libs
+if [ -n "$CRYPTSETUP_TESTS_RUN_IN_MESON" ]; then
+ CRYPTSETUP_VALGRIND=$CRYPTSETUP
+else
+ CRYPTSETUP_VALGRIND=../.libs/cryptsetup
+ CRYPTSETUP_LIB_VALGRIND=../.libs
+fi
[ -z "$srcdir" ] && srcdir="."
@@ -54,12 +58,12 @@ function test_one() # cipher mode keysize rm_pattern
fi
}
-function test_kdf() # hash
+function test_kdf() # hash img_hash
{
$CRYPTSETUP benchmark -h "$1" >/dev/null 2>&1
if [ $? -ne 0 ] ; then
echo "pbkdf2-$1 [N/A]"
- IMGS=$(ls $TST_DIR/[tv]c* | grep "$1")
+ IMGS=$(ls $TST_DIR/[tv]c* | grep "$2")
[ -n "$IMGS" ] && rm $IMGS
else
echo "pbkdf2-$1 [OK]"
@@ -78,11 +82,12 @@ function test_required()
command -v blkid >/dev/null || skip "blkid tool required, test skipped."
echo "REQUIRED KDF TEST"
- test_kdf sha256
- test_kdf sha512
- test_kdf ripemd160
- test_kdf whirlpool
- test_kdf stribog512
+ test_kdf sha256 sha256
+ test_kdf sha512 sha512
+ test_kdf blake2s-256 blake2
+ test_kdf ripemd160 ripemd160
+ test_kdf whirlpool whirlpool
+ test_kdf stribog512 stribog
echo "REQUIRED CIPHERS TEST"
test_one aes cbc 256 cbc-aes
@@ -114,7 +119,10 @@ function valgrind_setup()
{
command -v valgrind >/dev/null || fail "Cannot find valgrind."
[ ! -f $CRYPTSETUP_VALGRIND ] && fail "Unable to get location of cryptsetup executable."
- export LD_LIBRARY_PATH="$CRYPTSETUP_LIB_VALGRIND:$LD_LIBRARY_PATH"
+ [ ! -f valg.sh ] && fail "Unable to get location of valg runner script."
+ if [ -z "$CRYPTSETUP_TESTS_RUN_IN_MESON" ]; then
+ export LD_LIBRARY_PATH="$CRYPTSETUP_LIB_VALGRIND:$LD_LIBRARY_PATH"
+ fi
}
function valgrind_run()