summaryrefslogtreecommitdiffstats
path: root/gatekeeper
diff options
context:
space:
mode:
Diffstat (limited to 'gatekeeper')
-rw-r--r--gatekeeper/1.0/vts/functional/VtsHalGatekeeperV1_0TargetTest.cpp32
1 files changed, 31 insertions, 1 deletions
diff --git a/gatekeeper/1.0/vts/functional/VtsHalGatekeeperV1_0TargetTest.cpp b/gatekeeper/1.0/vts/functional/VtsHalGatekeeperV1_0TargetTest.cpp
index 67b448222b..7da229318d 100644
--- a/gatekeeper/1.0/vts/functional/VtsHalGatekeeperV1_0TargetTest.cpp
+++ b/gatekeeper/1.0/vts/functional/VtsHalGatekeeperV1_0TargetTest.cpp
@@ -281,7 +281,6 @@ TEST_F(GatekeeperHidlTest, TrustedReenroll) {
*/
TEST_F(GatekeeperHidlTest, UntrustedReenroll) {
GatekeeperResponse enrollRsp;
- GatekeeperRequest reenrollReq;
GatekeeperResponse reenrollRsp;
GatekeeperResponse verifyRsp;
GatekeeperResponse reenrollVerifyRsp;
@@ -349,6 +348,37 @@ TEST_F(GatekeeperHidlTest, DeleteUserTest) {
}
/**
+ * Ensure we can not delete a user that does not exist
+ */
+TEST_F(GatekeeperHidlTest, DeleteInvalidUserTest) {
+ hidl_vec<uint8_t> password;
+ GatekeeperResponse enrollRsp;
+ GatekeeperResponse verifyRsp;
+ GatekeeperResponse delRsp1;
+ GatekeeperResponse delRsp2;
+ ALOGI("Testing deleteUser (expected failure)");
+ setUid(10002);
+ generatePassword(password, 0);
+ enrollNewPassword(password, enrollRsp, true);
+ verifyPassword(password, enrollRsp.data, 0, verifyRsp, true);
+ ALOGI("Enroll+Verify done");
+
+ // Delete the user
+ doDeleteUser(delRsp1);
+ EXPECT_EQ(UINT32_C(0), delRsp1.data.size());
+ EXPECT_TRUE(delRsp1.code == GatekeeperStatusCode::ERROR_NOT_IMPLEMENTED ||
+ delRsp1.code == GatekeeperStatusCode::STATUS_OK);
+
+ // Delete the user again
+ doDeleteUser(delRsp2);
+ EXPECT_EQ(UINT32_C(0), delRsp2.data.size());
+ EXPECT_TRUE(delRsp2.code == GatekeeperStatusCode::ERROR_NOT_IMPLEMENTED ||
+ delRsp2.code == GatekeeperStatusCode::ERROR_GENERAL_FAILURE);
+ ALOGI("DeleteUser done");
+ ALOGI("Testing deleteUser done: rsp=%" PRIi32, delRsp2.code);
+}
+
+/**
* Ensure we can not verify passwords after we enrolled them and then deleted
* all users
*/