From f73c9760f43897fce0d6aa32042f751a2e7d0de0 Mon Sep 17 00:00:00 2001 From: hanzhijun Date: Sat, 18 Jul 2020 10:30:03 +0800 Subject: [PATCH 2/2] fix compat test --- tests/compat-test | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/compat-test b/tests/compat-test index a61453e..7ee946e 100755 --- a/tests/compat-test +++ b/tests/compat-test @@ -22,6 +22,7 @@ PWD0="compatkey" PWD1="93R4P4pIqAH8" PWD2="mymJeD8ivEhE" PWD3="ocMakf3fAcQO" +PWD4="hkj123HJGS12" PWDW="rUkL4RUryBom" VK_FILE="compattest_vkfile" @@ -225,17 +226,17 @@ echo $PWD1 | $CRYPTSETUP luksAddKey $IMG $FAST_PBKDF_OPT 2>/dev/null && fail echo -e "$PWD1\n$PWD2" | $CRYPTSETUP luksAddKey $IMG $FAST_PBKDF_OPT || fail echo -e "$PWD0\n$PWD1" | $CRYPTSETUP luksAddKey $IMG $FAST_PBKDF_OPT 2>/dev/null && fail echo "[4] change key" -echo -e "$PWD1\n$PWD0\n" | $CRYPTSETUP luksChangeKey $FAST_PBKDF_OPT $IMG || fail +echo -e "$PWD1\n$PWD4\n" | $CRYPTSETUP luksChangeKey $FAST_PBKDF_OPT $IMG || fail echo -e "$PWD1\n$PWD2\n" | $CRYPTSETUP luksChangeKey $FAST_PBKDF_OPT $IMG 2>/dev/null && fail [ $? -ne 2 ] && fail "luksChangeKey should return EPERM exit code" echo "[5] remove key" -# delete active keys PWD0, PWD2 +# delete active keys PWD2, PWD4 echo $PWD1 | $CRYPTSETUP luksRemoveKey $IMG 2>/dev/null && fail [ $? -ne 2 ] && fail "luksRemove should return EPERM exit code" -echo $PWD0 | $CRYPTSETUP luksRemoveKey $IMG || fail echo $PWD2 | $CRYPTSETUP luksRemoveKey $IMG || fail +echo $PWD4 | $CRYPTSETUP luksRemoveKey $IMG || fail # check if keys were deleted -echo $PWD0 | $CRYPTSETUP luksOpen $IMG --test-passphrase 2>/dev/null && fail +echo $PWD4 | $CRYPTSETUP luksOpen $IMG --test-passphrase 2>/dev/null && fail [ $? -ne 1 ] && fail "luksOpen should return ENOENT exit code" echo $PWD2 | $CRYPTSETUP luksOpen $IMG --test-passphrase 2>/dev/null && fail [ $? -ne 1 ] && fail "luksOpen should return ENOENT exit code" @@ -867,16 +868,16 @@ expect timeout abort "Are you sure? (Type 'yes' in capital letters):" send "YES\n" expect timeout abort "Enter passphrase for $EXPECT_DEV:" sleep 0.1 -send "$PWD0\n" +send "$PWD4\n" expect timeout abort "Verify passphrase:" sleep 0.1 -send "$PWD0\n" +send "$PWD4\n" expect timeout abort "Command successful." expect timeout abort eof eval spawn $CRYPTSETUP luksOpen -v $LOOPDEV --test-passphrase expect timeout abort "Enter passphrase for $EXPECT_DEV:" sleep 0.1 -send "$PWD0\n" +send "$PWD4\n" expect timeout abort "Command successful." expect timeout abort eof exit -- 1.8.3.1