Increase interactive expect test timeout if runing under valgrind.

This commit is contained in:
Milan Broz
2021-05-22 09:33:42 +02:00
parent 2f9b22f5ff
commit 29e4bca24b

View File

@@ -816,10 +816,12 @@ which expect >/dev/null 2>&1 || skip "WARNING: expect tool missing, interactive
prepare "[32] Interactive password retry from terminal." new
EXPECT_DEV=$(losetup $LOOPDEV | sed -e "s/.*(\(.*\))/\1/")
EXPECT_TIMEOUT=10
[ -n "$VALG" ] && EXPECT_TIMEOUT=60
expect_run - >/dev/null <<EOF
proc abort {} { send_error "Timeout. "; exit 2 }
set timeout 10
set timeout $EXPECT_TIMEOUT
eval spawn $CRYPTSETUP_RAW luksOpen -v -T 2 $LOOPDEV $DEV_NAME
expect timeout abort "Enter passphrase for $EXPECT_DEV:"
sleep 0.1
@@ -840,7 +842,7 @@ $CRYPTSETUP -q luksClose $DEV_NAME || fail
prepare "[33] Interactive unsuccessful password retry from terminal." new
expect_run - >/dev/null <<EOF
proc abort {} { send_error "Timeout. "; exit 2 }
set timeout 10
set timeout $EXPECT_TIMEOUT
eval spawn $CRYPTSETUP_RAW luksOpen -v -T 2 $LOOPDEV $DEV_NAME
expect timeout abort "Enter passphrase for $EXPECT_DEV:"
sleep 0.1
@@ -858,7 +860,7 @@ EOF
prepare "[34] Interactive kill of last key slot." new
expect_run - >/dev/null <<EOF
proc abort {} { send_error "Timeout. "; exit 2 }
set timeout 10
set timeout $EXPECT_TIMEOUT
eval spawn $CRYPTSETUP_RAW luksKillSlot -v $LOOPDEV 0
expect timeout abort "Are you sure? (Type 'yes' in capital letters):"
send "YES\n"
@@ -877,7 +879,7 @@ EOF
prepare "[35] Interactive format of device." wipe
expect_run - >/dev/null <<EOF
proc abort {} { send_error "Timeout. "; exit 2 }
set timeout 10
set timeout $EXPECT_TIMEOUT
eval spawn $CRYPTSETUP_RAW luksFormat --type luks1 $FAST_PBKDF_OPT -v $LOOPDEV
expect timeout abort "Are you sure? (Type 'yes' in capital letters):"
send "YES\n"
@@ -902,7 +904,7 @@ EOF
prepare "[36] Interactive unsuccessful format of device." new
expect_run - >/dev/null <<EOF
proc abort {} { send_error "Timeout. "; exit 2 }
set timeout 10
set timeout $EXPECT_TIMEOUT
eval spawn $CRYPTSETUP_RAW erase -v $LOOPDEV
expect timeout abort "Are you sure? (Type 'yes' in capital letters):"
send "YES\n"
@@ -932,7 +934,7 @@ EOF
prepare "[37] Interactive add key." new
expect_run - >/dev/null <<EOF
proc abort {} { send_error "Timeout. "; exit 2 }
set timeout 10
set timeout $EXPECT_TIMEOUT
eval spawn $CRYPTSETUP_RAW luksAddKey -S 2 $FAST_PBKDF_OPT -v $LOOPDEV
expect timeout abort "Enter any existing passphrase:"
sleep 0.1
@@ -967,7 +969,7 @@ EOF
prepare "[38] Interactive change key." new
expect_run - >/dev/null <<EOF
proc abort {} { send_error "Timeout. "; exit 2 }
set timeout 10
set timeout $EXPECT_TIMEOUT
eval spawn $CRYPTSETUP_RAW luksChangeKey $FAST_PBKDF_OPT -v $LOOPDEV
expect timeout abort "Enter passphrase to be changed:"
sleep 0.1
@@ -994,7 +996,7 @@ prepare "[39] Interactive suspend and resume." new
echo $PWD0 | $CRYPTSETUP luksOpen $LOOPDEV $DEV_NAME || fail
expect_run - >/dev/null <<EOF
proc abort {} { send_error "Timeout. "; exit 2 }
set timeout 10
set timeout $EXPECT_TIMEOUT
eval spawn $CRYPTSETUP_RAW luksSuspend -v $DEV_NAME
expect timeout abort "Command successful."
expect timeout abort eof
@@ -1041,7 +1043,7 @@ echo -n "$LONG_PWD" >$KEYE
expect_run - >/dev/null <<EOF
proc abort {} { send_error "Timeout. "; exit 2 }
set timeout 10
set timeout $EXPECT_TIMEOUT
eval spawn $CRYPTSETUP_RAW luksFormat --type luks1 $FAST_PBKDF_OPT -v $LOOPDEV
expect timeout abort "Are you sure? (Type 'yes' in capital letters):"
send "YES\n"