From fc740f8b6d588961976e89649ae9c629d33e5e26 Mon Sep 17 00:00:00 2001 From: Milan Broz Date: Thu, 5 Dec 2019 10:18:42 +0100 Subject: [PATCH] Simplify bitlk test and be sure to load dm-crypt module. --- tests/bitlk-compat-test | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/bitlk-compat-test b/tests/bitlk-compat-test index e8fcb58e..5d34ecda 100755 --- a/tests/bitlk-compat-test +++ b/tests/bitlk-compat-test @@ -34,6 +34,7 @@ function skip() function check_eboiv() { + modprobe dm-crypt >/dev/null 2>&1 crypt_version=$(dmsetup targets | grep crypt | cut -d"v" -f2) [ ! -z "$crypt_version" ] || exit 1 @@ -92,6 +93,7 @@ fi check_eboiv has_eboiv=$? +remove_mapping echo "ACTIVATION FS UUID CHECK" for file in $(ls $TST_DIR/bitlk-*) ; do @@ -101,15 +103,15 @@ for file in $(ls $TST_DIR/bitlk-*) ; do # test with both passphrase and recovery passphrase for PASSPHRASE in $PW $RP ; do echo -n " $file" - out=$(echo $PASSPHRASE | $CRYPTSETUP bitlkOpen -r $file --test-passphrase 2>&1) + echo $PASSPHRASE | $CRYPTSETUP bitlkOpen -r $file --test-passphrase >/dev/null 2>&1 ret=$? [ $ret -eq 1 ] && echo " [N/A]" && continue [ $has_eboiv -eq 1 ] && [ "$CIPHER" = "aes-cbc-eboiv" ] && echo " eboiv not supported [N/A]" && continue - out=$(echo $PASSPHRASE | $CRYPTSETUP bitlkOpen -r $file $MAP 2>&1) + echo $PASSPHRASE | $CRYPTSETUP bitlkOpen -r $file $MAP >/dev/null 2>&1 ret=$? [ $ret -eq 1 ] && ( echo "$file" | grep -q -e "cbc-elephant" ) && echo " [N/A]" && continue [ $ret -eq 1 ] && ( echo "$file" | grep -q -e "clearkey" ) && echo " [N/A]" && continue - [ $ret -eq 0 ] || fail " failed to open $file" + [ $ret -eq 0 ] || fail " failed to open $file ($ret)" $CRYPTSETUP status $MAP >/dev/null || fail $CRYPTSETUP status /dev/mapper/$MAP >/dev/null || fail uuid=$(lsblk -n -o UUID /dev/mapper/$MAP)