mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-11 10:50:01 +01:00
Allow to set CRYPTSETUP_PATH in tests for system installed cryptsetup tools.
Run: make check CRYPTSETUP_PATH=/sbin
This commit is contained in:
@@ -1,5 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
[ -z "$CRYPTSETUP_PATH" ] && CRYPTSETUP_PATH=".."
|
||||
|
||||
function pversion() {
|
||||
if [ ! -x $CRYPTSETUP_PATH/$1 ] ; then
|
||||
return
|
||||
fi
|
||||
|
||||
echo -n "$CRYPTSETUP_PATH/"
|
||||
$CRYPTSETUP_PATH/$1 --version
|
||||
}
|
||||
|
||||
echo "Cryptsetup test environment ($(date))"
|
||||
uname -a
|
||||
|
||||
@@ -8,10 +19,10 @@ if [ -f /etc/os-release ] ; then
|
||||
echo "$PRETTY_NAME ($NAME) $VERSION"
|
||||
fi
|
||||
|
||||
[ -x ../cryptsetup ] && ../cryptsetup --version
|
||||
[ -x ../veritysetup ] && ../veritysetup --version
|
||||
[ -x ../integritysetup ] && ../integritysetup --version
|
||||
[ -x ../cryptsetup-reencrypt ] && ../cryptsetup-reencrypt --version
|
||||
pversion cryptsetup
|
||||
pversion veritysetup
|
||||
pversion integritysetup
|
||||
pversion cryptsetup-reencrypt
|
||||
|
||||
[ $(id -u) != 0 ] && exit 77
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
CRYPTSETUP="../cryptsetup"
|
||||
[ -z "$CRYPTSETUP_PATH" ] && CRYPTSETUP_PATH=".."
|
||||
CRYPTSETUP=$CRYPTSETUP_PATH/cryptsetup
|
||||
DEV=""
|
||||
DEV_STACKED="luks0xbabe"
|
||||
DEV_NAME="dummyalign"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
CRYPTSETUP="../cryptsetup"
|
||||
[ -z "$CRYPTSETUP_PATH" ] && CRYPTSETUP_PATH=".."
|
||||
CRYPTSETUP=$CRYPTSETUP_PATH/cryptsetup
|
||||
DEV=""
|
||||
DEV_STACKED="luks0xbabe"
|
||||
DEV_NAME="dummyalign"
|
||||
|
||||
@@ -3500,6 +3500,11 @@ int main(int argc, char *argv[])
|
||||
exit(77);
|
||||
}
|
||||
|
||||
if (getenv("CRYPTSETUP_PATH")) {
|
||||
printf("Cannot run this test with CRYPTSETUP_PATH set.\n");
|
||||
exit(77);
|
||||
}
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (!strcmp("-v", argv[i]) || !strcmp("--verbose", argv[i]))
|
||||
_verbose = 1;
|
||||
|
||||
@@ -1879,6 +1879,11 @@ int main(int argc, char *argv[])
|
||||
exit(77);
|
||||
}
|
||||
|
||||
if (getenv("CRYPTSETUP_PATH")) {
|
||||
printf("Cannot run this test with CRYPTSETUP_PATH set.\n");
|
||||
exit(77);
|
||||
}
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (!strcmp("-v", argv[i]) || !strcmp("--verbose", argv[i]))
|
||||
_verbose = 1;
|
||||
|
||||
@@ -304,6 +304,8 @@ run_all() {
|
||||
RUN "$BD_FAIL" $1 write_lseek_blockwise $((BSIZE+1)) $BSIZE $((DEVSIZE-BSIZE))
|
||||
}
|
||||
|
||||
[ -n "$CRYPTSETUP_PATH" ] && skip "Cannot run this test with CRYPTSETUP_PATH set."
|
||||
|
||||
which $STRACE > /dev/null 2>&1 || unset STRACE
|
||||
test -x $BW_UNIT || skip "Run \"make `basename $BW_UNIT`\" first"
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
PS4='$LINENO:'
|
||||
CRYPTSETUP=../cryptsetup
|
||||
[ -z "$CRYPTSETUP_PATH" ] && CRYPTSETUP_PATH=".."
|
||||
CRYPTSETUP=$CRYPTSETUP_PATH/cryptsetup
|
||||
|
||||
CRYPTSETUP_VALGRIND=../.libs/cryptsetup
|
||||
CRYPTSETUP_LIB_VALGRIND=../.libs
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
PS4='$LINENO:'
|
||||
CRYPTSETUP=../cryptsetup
|
||||
[ -z "$CRYPTSETUP_PATH" ] && CRYPTSETUP_PATH=".."
|
||||
CRYPTSETUP=$CRYPTSETUP_PATH/cryptsetup
|
||||
|
||||
CRYPTSETUP_VALGRIND=../.libs/cryptsetup
|
||||
CRYPTSETUP_LIB_VALGRIND=../.libs
|
||||
|
||||
@@ -893,6 +893,11 @@ static void __attribute__((noreturn)) exit_test(const char *msg, int r)
|
||||
|
||||
int main(__attribute__ ((unused)) int argc, __attribute__ ((unused))char *argv[])
|
||||
{
|
||||
if (getenv("CRYPTSETUP_PATH")) {
|
||||
printf("Cannot run this test with CRYPTSETUP_PATH set.\n");
|
||||
exit(77);
|
||||
}
|
||||
|
||||
if (crypt_backend_init(NULL))
|
||||
exit_test("Crypto backend init error.", EXIT_FAILURE);
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
CRYPTSETUP="../cryptsetup"
|
||||
[ -z "$CRYPTSETUP_PATH" ] && CRYPTSETUP_PATH=".."
|
||||
CRYPTSETUP=$CRYPTSETUP_PATH/cryptsetup
|
||||
MNT_DIR="./mnt_luks"
|
||||
DEV_NAME="dummy"
|
||||
DEV_NAME2="ymmud"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
CRYPTSETUP="../cryptsetup"
|
||||
[ -z "$CRYPTSETUP_PATH" ] && CRYPTSETUP_PATH=".."
|
||||
CRYPTSETUP=$CRYPTSETUP_PATH/cryptsetup
|
||||
DEV_NAME="discard-t3st"
|
||||
DEV=""
|
||||
PWD1="93R4P4pIqAH8"
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
#
|
||||
# Test integritysetup compatibility.
|
||||
#
|
||||
INTSETUP=../integritysetup
|
||||
[ -z "$CRYPTSETUP_PATH" ] && CRYPTSETUP_PATH=".."
|
||||
INTSETUP=$CRYPTSETUP_PATH/integritysetup
|
||||
|
||||
INTSETUP_VALGRIND=../.libs/integritysetup
|
||||
INTSETUP_LIB_VALGRIND=../.libs
|
||||
|
||||
|
||||
@@ -22,7 +22,9 @@ CHKS_DMCRYPT=vk_in_dmcrypt.chk
|
||||
CHKS_KEYRING=vk_in_keyring.chk
|
||||
|
||||
PWD="aaa"
|
||||
CRYPTSETUP=../cryptsetup
|
||||
|
||||
[ -z "$CRYPTSETUP_PATH" ] && CRYPTSETUP_PATH=".."
|
||||
CRYPTSETUP=$CRYPTSETUP_PATH/cryptsetup
|
||||
|
||||
function remove_mapping()
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
CRYPTSETUP=../cryptsetup
|
||||
[ -z "$CRYPTSETUP_PATH" ] && CRYPTSETUP_PATH=".."
|
||||
CRYPTSETUP=$CRYPTSETUP_PATH/cryptsetup
|
||||
|
||||
# try to validate using loop-AES losetup/kernel if available
|
||||
LOSETUP_AES=/losetup-aes.old
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
# that you are not using old gcrypt with flawed whirlpool
|
||||
# (see cryptsetup debug output)
|
||||
|
||||
CRYPTSETUP=../cryptsetup
|
||||
[ -z "$CRYPTSETUP_PATH" ] && CRYPTSETUP_PATH=".."
|
||||
CRYPTSETUP=$CRYPTSETUP_PATH/cryptsetup
|
||||
TST_DIR=luks1-images
|
||||
MAP=luks1tst
|
||||
KEYFILE=keyfile1
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
#
|
||||
# Test cryptsetup/authenticated encryption compatibility.
|
||||
#
|
||||
CRYPTSETUP=../cryptsetup
|
||||
[ -z "$CRYPTSETUP_PATH" ] && CRYPTSETUP_PATH=".."
|
||||
CRYPTSETUP=$CRYPTSETUP_PATH/cryptsetup
|
||||
DEV_NAME=dmi_test
|
||||
DEV=mode-test.img
|
||||
PWD1=nHjJHjI23JK
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
#turn on debug mode by following env. variable _DEBUG=1
|
||||
|
||||
PS4='$LINENO:'
|
||||
CRYPTSETUP=../cryptsetup
|
||||
[ -z "$CRYPTSETUP_PATH" ] && CRYPTSETUP_PATH=".."
|
||||
CRYPTSETUP=$CRYPTSETUP_PATH/cryptsetup
|
||||
|
||||
CRYPTSETUP_VALGRIND=../.libs/cryptsetup
|
||||
CRYPTSETUP_LIB_VALGRIND=../.libs
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
#
|
||||
# Test mode compatibility, check input + kernel and cryptsetup cipher status
|
||||
#
|
||||
CRYPTSETUP=../cryptsetup
|
||||
[ -z "$CRYPTSETUP_PATH" ] && CRYPTSETUP_PATH=".."
|
||||
CRYPTSETUP=$CRYPTSETUP_PATH/cryptsetup
|
||||
DEV_NAME=dmc_test
|
||||
HEADER_IMG=mode-test.img
|
||||
PASSWORD=3xrododenron
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
# check hash processing in create command
|
||||
|
||||
CRYPTSETUP=../cryptsetup
|
||||
[ -z "$CRYPTSETUP_PATH" ] && CRYPTSETUP_PATH=".."
|
||||
CRYPTSETUP=$CRYPTSETUP_PATH/cryptsetup
|
||||
DEV_NAME=dmc_test
|
||||
KEY_FILE=keyfile
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
CRYPTSETUP=../cryptsetup
|
||||
REENC=../cryptsetup-reencrypt
|
||||
[ -z "$CRYPTSETUP_PATH" ] && CRYPTSETUP_PATH=".."
|
||||
CRYPTSETUP=$CRYPTSETUP_PATH/cryptsetup
|
||||
REENC=$CRYPTSETUP_PATH/cryptsetup-reencrypt
|
||||
FAST_PBKDF="--pbkdf-force-iterations 1000"
|
||||
|
||||
DEV_NAME=reenc9768
|
||||
@@ -185,7 +186,14 @@ function mount_and_test() {
|
||||
}
|
||||
rm $MNT_DIR/* 2>/dev/null
|
||||
cd $MNT_DIR
|
||||
echo $PWD2 | $START_DIR/$REENC $LOOPDEV1 -q --use-fsync --use-directio --write-log $FAST_PBKDF || return 1
|
||||
|
||||
if [ "${REENC:0:1}" != "/" ] ; then
|
||||
MNT_REENC=$START_DIR/$REENC
|
||||
else
|
||||
MNT_REENC=$REENC
|
||||
fi
|
||||
|
||||
echo $PWD2 | $MNT_REENC $LOOPDEV1 -q --use-fsync --use-directio --write-log $FAST_PBKDF || return 1
|
||||
cd $START_DIR
|
||||
umount $MNT_DIR
|
||||
echo -n [OK]
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
CRYPTSETUP=../cryptsetup
|
||||
REENC=../cryptsetup-reencrypt
|
||||
[ -z "$CRYPTSETUP_PATH" ] && CRYPTSETUP_PATH=".."
|
||||
CRYPTSETUP=$CRYPTSETUP_PATH/cryptsetup
|
||||
REENC=$CRYPTSETUP_PATH/cryptsetup-reencrypt
|
||||
FAST_PBKDF_ARGON="--pbkdf-force-iterations 4 --pbkdf-memory 32 --pbkdf-parallel 1"
|
||||
FAST_PBKDF_PBKDF2="--pbkdf-force-iterations 1000 --pbkdf pbkdf2"
|
||||
DEFAULT_ARGON="argon2i"
|
||||
@@ -193,7 +194,13 @@ function mount_and_test() {
|
||||
}
|
||||
rm $MNT_DIR/* 2>/dev/null
|
||||
cd $MNT_DIR
|
||||
echo $PWD2 | $START_DIR/$REENC $START_DIR/$IMG -q --use-fsync --use-directio --write-log $FAST_PBKDF_ARGON || return 1
|
||||
|
||||
if [ "${REENC:0:1}" != "/" ] ; then
|
||||
MNT_REENC=$START_DIR/$REENC
|
||||
else
|
||||
MNT_REENC=$REENC
|
||||
fi
|
||||
echo $PWD2 | $MNT_REENC $START_DIR/$IMG -q --use-fsync --use-directio --write-log $FAST_PBKDF_ARGON || return 1
|
||||
cd $START_DIR
|
||||
umount $MNT_DIR
|
||||
echo -n [OK]
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
# check tcrypt images parsing
|
||||
|
||||
CRYPTSETUP=../cryptsetup
|
||||
[ -z "$CRYPTSETUP_PATH" ] && CRYPTSETUP_PATH=".."
|
||||
CRYPTSETUP=$CRYPTSETUP_PATH/cryptsetup
|
||||
TST_DIR=tcrypt-images
|
||||
MAP=tctst
|
||||
PASSWORD="aaaaaaaaaaaa"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
VERITYSETUP=../veritysetup
|
||||
[ -z "$CRYPTSETUP_PATH" ] && CRYPTSETUP_PATH=".."
|
||||
VERITYSETUP=$CRYPTSETUP_PATH/veritysetup
|
||||
VERITYSETUP_VALGRIND=../.libs/veritysetup
|
||||
VERITYSETUP_LIB_VALGRIND=../.libs
|
||||
|
||||
|
||||
Reference in New Issue
Block a user