1 Star 0 Fork 19

openeuler-embedded/cryptsetup

forked from src-openEuler/cryptsetup 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0002-fix-compat-test.patch 2.53 KB
一键复制 编辑 原始数据 按行查看 历史
geruijun 提交于 2020-07-18 10:48 . update to 2.3.3 version
From f73c9760f43897fce0d6aa32042f751a2e7d0de0 Mon Sep 17 00:00:00 2001
From: hanzhijun <hanzhijun1@huawei.com>
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
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openeuler-embedded/cryptsetup.git
git@gitee.com:openeuler-embedded/cryptsetup.git
openeuler-embedded
cryptsetup
cryptsetup
openEuler-embedded

搜索帮助

0d507c66 1850385 C8b1a773 1850385