From 663282cb46bfcbb95a99148aaa6423af175e0fba Mon Sep 17 00:00:00 2001 From: dengrenqi <1069093439@qq.com> Date: Fri, 18 Oct 2024 17:14:44 +0800 Subject: [PATCH] =?UTF-8?q?UT=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: dengrenqi <1069093439@qq.com> --- .../crypto/test/key_manager_test/key_manager_test.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/services/storage_daemon/crypto/test/key_manager_test/key_manager_test.cpp b/services/storage_daemon/crypto/test/key_manager_test/key_manager_test.cpp index 7fbee12b..7c53d4ba 100644 --- a/services/storage_daemon/crypto/test/key_manager_test/key_manager_test.cpp +++ b/services/storage_daemon/crypto/test/key_manager_test/key_manager_test.cpp @@ -1632,7 +1632,7 @@ HWTEST_F(KeyManagerTest, KeyManager_Generate_Elx_And_Install_User_key_101, TestS EXPECT_CALL(*keyControlMock_, KeyCtrlGetFscryptVersion(_)).WillOnce(Return(FSCRYPT_INVALID)) .WillOnce(Return(FSCRYPT_INVALID)); auto ret = KeyManager::GetInstance()->GenerateElxAndInstallUserKey(userId); - EXPECT_EQ(ret, -ENOMEM); + EXPECT_EQ(ret, -EEXIST); RmDirRecurse(EL1_PATH); MkDir(EL2_PATH, S_IRWXU); @@ -1641,7 +1641,7 @@ HWTEST_F(KeyManagerTest, KeyManager_Generate_Elx_And_Install_User_key_101, TestS EXPECT_CALL(*keyControlMock_, KeyCtrlGetFscryptVersion(_)).WillOnce(Return(FSCRYPT_INVALID)) .WillOnce(Return(FSCRYPT_INVALID)); ret = KeyManager::GetInstance()->GenerateElxAndInstallUserKey(userId); - EXPECT_EQ(ret, -ENOMEM); + EXPECT_EQ(ret, -EEXIST); RmDirRecurse(EL2_PATH); MkDir(EL3_PATH, S_IRWXU); @@ -1650,7 +1650,7 @@ HWTEST_F(KeyManagerTest, KeyManager_Generate_Elx_And_Install_User_key_101, TestS EXPECT_CALL(*keyControlMock_, KeyCtrlGetFscryptVersion(_)).WillOnce(Return(FSCRYPT_INVALID)) .WillOnce(Return(FSCRYPT_INVALID)); ret = KeyManager::GetInstance()->GenerateElxAndInstallUserKey(userId); - EXPECT_EQ(ret, -ENOMEM); + EXPECT_EQ(ret, -EEXIST); RmDirRecurse(EL3_PATH); MkDir(EL4_PATH, S_IRWXU); @@ -1659,7 +1659,7 @@ HWTEST_F(KeyManagerTest, KeyManager_Generate_Elx_And_Install_User_key_101, TestS EXPECT_CALL(*keyControlMock_, KeyCtrlGetFscryptVersion(_)).WillOnce(Return(FSCRYPT_INVALID)) .WillOnce(Return(FSCRYPT_INVALID)); ret = KeyManager::GetInstance()->GenerateElxAndInstallUserKey(userId); - EXPECT_EQ(ret, -ENOMEM); + EXPECT_EQ(ret, -EEXIST); RmDirRecurse(EL4_PATH); MkDir(EL5_PATH, S_IRWXU); @@ -1668,7 +1668,7 @@ HWTEST_F(KeyManagerTest, KeyManager_Generate_Elx_And_Install_User_key_101, TestS EXPECT_CALL(*keyControlMock_, KeyCtrlGetFscryptVersion(_)).WillOnce(Return(FSCRYPT_INVALID)) .WillOnce(Return(FSCRYPT_INVALID)); ret = KeyManager::GetInstance()->GenerateElxAndInstallUserKey(userId); - EXPECT_EQ(ret, -ENOMEM); + EXPECT_EQ(ret, -EEXIST); GTEST_LOG_(INFO) << "KeyManager_GenerateElxAndInstallUserKey_0101 end"; }