mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2026-01-06 07:25:29 +01:00
Add valgrind support to more tests.
This commit is contained in:
committed by
Milan Broz
parent
abfb5e374f
commit
429afe8fc3
@@ -3,6 +3,9 @@
|
||||
[ -z "$CRYPTSETUP_PATH" ] && CRYPTSETUP_PATH=".."
|
||||
CRYPTSETUP=$CRYPTSETUP_PATH/cryptsetup
|
||||
|
||||
CRYPTSETUP_VALGRIND=../.libs/cryptsetup
|
||||
CRYPTSETUP_LIB_VALGRIND=../.libs
|
||||
|
||||
# try to validate using loop-AES losetup/kernel if available
|
||||
LOSETUP_AES=/losetup-aes.old
|
||||
|
||||
@@ -42,6 +45,18 @@ function skip()
|
||||
exit 77
|
||||
}
|
||||
|
||||
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"
|
||||
}
|
||||
|
||||
function valgrind_run()
|
||||
{
|
||||
INFOSTRING="$(basename ${BASH_SOURCE[1]})-line-${BASH_LINENO[0]}" ./valg.sh ${CRYPTSETUP_VALGRIND} "$@"
|
||||
}
|
||||
|
||||
function prepare()
|
||||
{
|
||||
remove_mapping
|
||||
@@ -145,6 +160,7 @@ function check_version()
|
||||
[ $(id -u) != 0 ] && skip "WARNING: You must be root to run this test, test skipped."
|
||||
[ -z "$LOOPDEV" ] && skip "Cannot find free loop device, test skipped."
|
||||
[ ! -x "$CRYPTSETUP" ] && skip "Cannot find $CRYPTSETUP, test skipped."
|
||||
[ -n "$VALG" ] && valgrind_setup && CRYPTSETUP=valgrind_run
|
||||
command -v uuencode >/dev/null || skip "WARNING: test require uuencode binary, test skipped."
|
||||
check_version || skip "Probably old kernel, test skipped."
|
||||
|
||||
|
||||
Reference in New Issue
Block a user