mirror of
https://gitee.com/openharmony/filemanagement_storage_service
synced 2024-11-26 16:53:57 +00:00
commit
4ec4fa7bcb
@ -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<DelayHandler>(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());
|
||||
|
Loading…
Reference in New Issue
Block a user