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 e0c1b07a..fd9138e2 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 @@ -340,7 +340,7 @@ HWTEST_F(KeyManagerTest, KeyManager_ActiveCeSceSeceUserKey_002, TestSize.Level1) EXPECT_CALL(*fscryptControlMock_, KeyCtrlHasFscryptSyspara()).WillOnce(Return(true)); EXPECT_CALL(*fscryptControlMock_, GetFscryptVersionFromPolicy()).WillOnce(Return(FSCRYPT_V2)); EXPECT_CALL(*keyControlMock_, KeyCtrlGetFscryptVersion(_)).WillOnce(Return(FSCRYPT_V2)); - EXPECT_CALL(*fscryptKeyMock_, DecryptClassE(_, _, _, _, _)).WillOnce(Return(true)); + EXPECT_CALL(*fscryptKeyMock_, DecryptClassE(_, _, _, _, _)).WillOnce(Return(false)); EXPECT_EQ(KeyManager::GetInstance()->ActiveCeSceSeceUserKey(user, EL5_KEY, token, secret), -EFAULT); EXPECT_CALL(*fscryptControlMock_, KeyCtrlHasFscryptSyspara()).WillOnce(Return(true)); @@ -1226,10 +1226,9 @@ HWTEST_F(KeyManagerTest, KeyManager_InActiveUserKey_002, TestSize.Level1) KeyManager::GetInstance()->userEl2Key_[user] = elKey; KeyManager::GetInstance()->userEl3Key_[user] = elKey; KeyManager::GetInstance()->userEl4Key_[user] = elKey; - KeyManager::GetInstance()->userEl5Key_[user] = elKey; KeyManager::GetInstance()->userLockScreenTask_[user] = std::make_shared(user); EXPECT_CALL(*fscryptKeyMock_, InactiveKey(_, _)).WillOnce(Return(true)).WillOnce(Return(true)) - .WillOnce(Return(true)).WillOnce(Return(true)); + .WillOnce(Return(true)); EXPECT_CALL(*fscryptControlMock_, KeyCtrlHasFscryptSyspara()).WillOnce(Return(true)); EXPECT_EQ(KeyManager::GetInstance()->InActiveUserKey(user), -ENOENT); EXPECT_TRUE(KeyManager::GetInstance()->userEl2Key_.find(user) == KeyManager::GetInstance()->userEl2Key_.end()); @@ -1241,9 +1240,8 @@ HWTEST_F(KeyManagerTest, KeyManager_InActiveUserKey_002, TestSize.Level1) KeyManager::GetInstance()->userEl2Key_[user] = elKey; KeyManager::GetInstance()->userEl3Key_[user] = elKey; KeyManager::GetInstance()->userEl4Key_[user] = elKey; - KeyManager::GetInstance()->userEl5Key_[user] = elKey; EXPECT_CALL(*fscryptKeyMock_, InactiveKey(_, _)).WillOnce(Return(true)).WillOnce(Return(true)) - .WillOnce(Return(true)).WillOnce(Return(true)); + .WillOnce(Return(true)); EXPECT_CALL(*fscryptControlMock_, KeyCtrlHasFscryptSyspara()).WillOnce(Return(true)); EXPECT_EQ(KeyManager::GetInstance()->InActiveUserKey(user), -ENOENT); EXPECT_TRUE(KeyManager::GetInstance()->userEl2Key_.find(user) == KeyManager::GetInstance()->userEl2Key_.end());