19762338dSopenharmony_ci/*
29762338dSopenharmony_ci * Copyright (c) 2021-2023 Huawei Device Co., Ltd.
39762338dSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
49762338dSopenharmony_ci * you may not use this file except in compliance with the License.
59762338dSopenharmony_ci * You may obtain a copy of the License at
69762338dSopenharmony_ci *
79762338dSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
89762338dSopenharmony_ci *
99762338dSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
109762338dSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
119762338dSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
129762338dSopenharmony_ci * See the License for the specific language governing permissions and
139762338dSopenharmony_ci * limitations under the License.
149762338dSopenharmony_ci */
159762338dSopenharmony_ci
169762338dSopenharmony_ci#include "user_auth_hdi_test.h"
179762338dSopenharmony_ci#include "iam_hat_test.h"
189762338dSopenharmony_ci
199762338dSopenharmony_ciusing namespace std;
209762338dSopenharmony_ciusing namespace testing::ext;
219762338dSopenharmony_ciusing namespace OHOS::UserIam::Common;
229762338dSopenharmony_ciusing namespace OHOS::HDI::UserAuth;
239762338dSopenharmony_ciusing namespace OHOS::HDI::UserAuth::V2_0;
249762338dSopenharmony_ci
259762338dSopenharmony_cistatic const uint32_t MAX_FUZZ_STRUCT_LEN = 20;
269762338dSopenharmony_cistatic UserAuthInterfaceService g_service;
279762338dSopenharmony_ciint32_t Expectedvalue = 0;
289762338dSopenharmony_cistatic OHOS::Parcel parcel;
299762338dSopenharmony_ci
309762338dSopenharmony_civoid UserIamUserAuthTest::SetUpTestCase()
319762338dSopenharmony_ci{
329762338dSopenharmony_ci}
339762338dSopenharmony_ci
349762338dSopenharmony_civoid UserIamUserAuthTest::TearDownTestCase()
359762338dSopenharmony_ci{
369762338dSopenharmony_ci}
379762338dSopenharmony_ci
389762338dSopenharmony_civoid UserIamUserAuthTest::SetUp()
399762338dSopenharmony_ci{
409762338dSopenharmony_ci}
419762338dSopenharmony_ci
429762338dSopenharmony_civoid UserIamUserAuthTest::TearDown()
439762338dSopenharmony_ci{
449762338dSopenharmony_ci}
459762338dSopenharmony_ci
469762338dSopenharmony_cistatic void FillAuthTypeVector(Parcel &parcel, vector<int32_t> &vector)
479762338dSopenharmony_ci{
489762338dSopenharmony_ci    uint32_t len = parcel.ReadInt32() % MAX_FUZZ_STRUCT_LEN;
499762338dSopenharmony_ci    vector.resize(len);
509762338dSopenharmony_ci    for (uint32_t i = 0; i < len; i++) {
519762338dSopenharmony_ci        vector[i] = parcel.ReadInt32();
529762338dSopenharmony_ci    }
539762338dSopenharmony_ci}
549762338dSopenharmony_ci
559762338dSopenharmony_cistatic void FillEnrollParam(Parcel &parcel, EnrollParam &enrollParam)
569762338dSopenharmony_ci{
579762338dSopenharmony_ci    enrollParam.authType = static_cast<AuthType>(parcel.ReadInt32());
589762338dSopenharmony_ci    enrollParam.executorSensorHint = parcel.ReadUint32();
599762338dSopenharmony_ci    enrollParam.userId = parcel.ReadInt32();
609762338dSopenharmony_ci}
619762338dSopenharmony_ci
629762338dSopenharmony_cistatic void FillExecutorRegisterInfo(Parcel &parcel, ExecutorRegisterInfo &executorRegisterInfo)
639762338dSopenharmony_ci{
649762338dSopenharmony_ci    executorRegisterInfo.authType = static_cast<AuthType>(parcel.ReadInt32());
659762338dSopenharmony_ci    executorRegisterInfo.executorRole = static_cast<ExecutorRole>(parcel.ReadInt32());
669762338dSopenharmony_ci    executorRegisterInfo.executorSensorHint = parcel.ReadUint32();
679762338dSopenharmony_ci    executorRegisterInfo.executorMatcher = parcel.ReadUint32();
689762338dSopenharmony_ci    executorRegisterInfo.esl = static_cast<ExecutorSecureLevel>(parcel.ReadInt32());
699762338dSopenharmony_ci    FillTestUint8Vector(parcel, executorRegisterInfo.publicKey);
709762338dSopenharmony_ci}
719762338dSopenharmony_ci
729762338dSopenharmony_cistatic void FillExecutorIndexInfo(Parcel &parcel, uint64_t &executorIndex)
739762338dSopenharmony_ci{
749762338dSopenharmony_ci    executorIndex = parcel.ReadUint64();
759762338dSopenharmony_ci}
769762338dSopenharmony_ci
779762338dSopenharmony_cistatic void FillExecutorIndexVector(Parcel &parcel, vector<uint64_t > &vector)
789762338dSopenharmony_ci{
799762338dSopenharmony_ci    uint32_t len = parcel.ReadInt32() % MAX_FUZZ_STRUCT_LEN;
809762338dSopenharmony_ci    vector.resize(len);
819762338dSopenharmony_ci    for (uint32_t i = 0; i < len; i++) {
829762338dSopenharmony_ci        FillExecutorIndexInfo(parcel, vector[i]);
839762338dSopenharmony_ci    }
849762338dSopenharmony_ci}
859762338dSopenharmony_ci
869762338dSopenharmony_cistatic void FillScheduleInfo(Parcel &parcel, ScheduleInfo &scheduleInfo)
879762338dSopenharmony_ci{
889762338dSopenharmony_ci    scheduleInfo.scheduleId = parcel.ReadUint64();
899762338dSopenharmony_ci    FillTestUint64Vector(parcel, scheduleInfo.templateIds);
909762338dSopenharmony_ci    scheduleInfo.authType = static_cast<AuthType>(parcel.ReadInt32());
919762338dSopenharmony_ci    scheduleInfo.executorMatcher = parcel.ReadUint32();
929762338dSopenharmony_ci    scheduleInfo.scheduleMode = static_cast<ScheduleMode>(parcel.ReadInt32());
939762338dSopenharmony_ci    FillExecutorIndexVector(parcel, scheduleInfo.executorIndexes);
949762338dSopenharmony_ci}
959762338dSopenharmony_ci
969762338dSopenharmony_cistatic void FillCredentialInfo(Parcel &parcel, CredentialInfo &credentialInfo)
979762338dSopenharmony_ci{
989762338dSopenharmony_ci    credentialInfo.credentialId = parcel.ReadUint64();
999762338dSopenharmony_ci    credentialInfo.executorIndex = parcel.ReadUint64();
1009762338dSopenharmony_ci    credentialInfo.templateId = parcel.ReadUint64();
1019762338dSopenharmony_ci    credentialInfo.authType = static_cast<AuthType>(parcel.ReadInt32());
1029762338dSopenharmony_ci    credentialInfo.executorMatcher = parcel.ReadUint32();
1039762338dSopenharmony_ci    credentialInfo.executorSensorHint = parcel.ReadUint32();
1049762338dSopenharmony_ci}
1059762338dSopenharmony_ci
1069762338dSopenharmony_cistatic void FillEnrolledInfo(Parcel &parcel, EnrolledInfo &enrolledInfo)
1079762338dSopenharmony_ci{
1089762338dSopenharmony_ci    enrolledInfo.enrolledId = parcel.ReadUint64();
1099762338dSopenharmony_ci    enrolledInfo.authType = static_cast<AuthType>(parcel.ReadInt32());
1109762338dSopenharmony_ci}
1119762338dSopenharmony_ci
1129762338dSopenharmony_cistatic void FillIdentifyResultInfo(Parcel &parcel, IdentifyResultInfo &identifyResultInfo)
1139762338dSopenharmony_ci{
1149762338dSopenharmony_ci    identifyResultInfo.result = parcel.ReadInt32();
1159762338dSopenharmony_ci    identifyResultInfo.userId = parcel.ReadInt32();
1169762338dSopenharmony_ci    FillTestUint8Vector(parcel, identifyResultInfo.token);
1179762338dSopenharmony_ci}
1189762338dSopenharmony_ci
1199762338dSopenharmony_cistatic void FillExecutorSendMsg(Parcel &parcel, ExecutorSendMsg &executorSendMsg)
1209762338dSopenharmony_ci{
1219762338dSopenharmony_ci    executorSendMsg.executorIndex = parcel.ReadUint32();
1229762338dSopenharmony_ci    FillTestUint8Vector(parcel, executorSendMsg.msg);
1239762338dSopenharmony_ci}
1249762338dSopenharmony_ci
1259762338dSopenharmony_cistatic void FillAuthParam(Parcel &parcel, AuthParam &authParam)
1269762338dSopenharmony_ci{
1279762338dSopenharmony_ci    authParam.baseParam.userId = parcel.ReadInt32();
1289762338dSopenharmony_ci    authParam.baseParam.authTrustLevel = parcel.ReadUint32();
1299762338dSopenharmony_ci    authParam.authType = static_cast<AuthType>(parcel.ReadInt32());
1309762338dSopenharmony_ci    authParam.baseParam.executorSensorHint = parcel.ReadUint32();
1319762338dSopenharmony_ci    FillTestUint8Vector(parcel, authParam.baseParam.challenge);
1329762338dSopenharmony_ci}
1339762338dSopenharmony_ci
1349762338dSopenharmony_cistatic void FillScheduleInfoVector(Parcel &parcel, vector<ScheduleInfo> &vector)
1359762338dSopenharmony_ci{
1369762338dSopenharmony_ci    uint32_t len = parcel.ReadInt32() % MAX_FUZZ_STRUCT_LEN;
1379762338dSopenharmony_ci    vector.resize(len);
1389762338dSopenharmony_ci    for (uint32_t i = 0; i < len; i++) {
1399762338dSopenharmony_ci        FillScheduleInfo(parcel, vector[i]);
1409762338dSopenharmony_ci    }
1419762338dSopenharmony_ci}
1429762338dSopenharmony_ci
1439762338dSopenharmony_cistatic void FillCredentialInfoVector(Parcel &parcel, vector<CredentialInfo> &vector)
1449762338dSopenharmony_ci{
1459762338dSopenharmony_ci    uint32_t len = parcel.ReadInt32() % MAX_FUZZ_STRUCT_LEN;
1469762338dSopenharmony_ci    vector.resize(len);
1479762338dSopenharmony_ci    for (uint32_t i = 0; i < len; i++) {
1489762338dSopenharmony_ci        FillCredentialInfo(parcel, vector[i]);
1499762338dSopenharmony_ci    }
1509762338dSopenharmony_ci}
1519762338dSopenharmony_ci
1529762338dSopenharmony_cistatic void FillEnrolledInfoVector(Parcel &parcel, vector<EnrolledInfo> &vector)
1539762338dSopenharmony_ci{
1549762338dSopenharmony_ci    uint32_t len = parcel.ReadInt32() % MAX_FUZZ_STRUCT_LEN;
1559762338dSopenharmony_ci    vector.resize(len);
1569762338dSopenharmony_ci    for (uint32_t i = 0; i < len; i++) {
1579762338dSopenharmony_ci        FillEnrolledInfo(parcel, vector[i]);
1589762338dSopenharmony_ci    }
1599762338dSopenharmony_ci}
1609762338dSopenharmony_ci
1619762338dSopenharmony_cistatic void FillExecutorSendMsgVector(Parcel &parcel, vector<ExecutorSendMsg> &vector)
1629762338dSopenharmony_ci{
1639762338dSopenharmony_ci    uint32_t len = parcel.ReadInt32() % MAX_FUZZ_STRUCT_LEN;
1649762338dSopenharmony_ci    vector.resize(len);
1659762338dSopenharmony_ci    for (uint32_t i = 0; i < len; i++) {
1669762338dSopenharmony_ci        FillExecutorSendMsg(parcel, vector[i]);
1679762338dSopenharmony_ci    }
1689762338dSopenharmony_ci}
1699762338dSopenharmony_ci
1709762338dSopenharmony_cistatic void FillAuthResultInfo(Parcel &parcel, AuthResultInfo &authResultInfo)
1719762338dSopenharmony_ci{
1729762338dSopenharmony_ci    authResultInfo.result = parcel.ReadUint32();
1739762338dSopenharmony_ci    authResultInfo.lockoutDuration = parcel.ReadInt32();
1749762338dSopenharmony_ci    authResultInfo.remainAttempts = parcel.ReadInt32();
1759762338dSopenharmony_ci    FillExecutorSendMsgVector(parcel, authResultInfo.msgs);
1769762338dSopenharmony_ci    FillTestUint8Vector(parcel, authResultInfo.token);
1779762338dSopenharmony_ci}
1789762338dSopenharmony_ci
1799762338dSopenharmony_civoid FillTestScheduleInfo(Parcel &parcel, ScheduleInfo &scheduleInfo)
1809762338dSopenharmony_ci{
1819762338dSopenharmony_ci    scheduleInfo.scheduleId = parcel.ReadUint64();
1829762338dSopenharmony_ci    FillTestUint64Vector(parcel, scheduleInfo.templateIds);
1839762338dSopenharmony_ci    scheduleInfo.authType = static_cast<AuthType>(parcel.ReadInt32());
1849762338dSopenharmony_ci    scheduleInfo.executorMatcher = parcel.ReadUint32();
1859762338dSopenharmony_ci    scheduleInfo.scheduleMode = static_cast<ScheduleMode>(parcel.ReadInt32());
1869762338dSopenharmony_ci    FillExecutorIndexVector(parcel, scheduleInfo.executorIndexes);
1879762338dSopenharmony_ci    std::vector<uint8_t> extraInfo;
1889762338dSopenharmony_ci    FillTestUint8Vector(parcel, extraInfo);
1899762338dSopenharmony_ci    scheduleInfo.executorMessages.push_back(extraInfo);
1909762338dSopenharmony_ci    cout << "success"  << endl;
1919762338dSopenharmony_ci}
1929762338dSopenharmony_ci
1939762338dSopenharmony_civoid FillTestScheduleInfo_Vector(Parcel &parcel, vector<ScheduleInfo> &vector)
1949762338dSopenharmony_ci{
1959762338dSopenharmony_ci    uint32_t len = parcel.ReadInt32() % MAX_FUZZ_STRUCT_LEN;
1969762338dSopenharmony_ci    vector.resize(len);
1979762338dSopenharmony_ci    for (uint32_t i = 0; i < len; i++) {
1989762338dSopenharmony_ci        FillTestScheduleInfo(parcel, vector[i]);
1999762338dSopenharmony_ci    }
2009762338dSopenharmony_ci    cout << "success"  << endl;
2019762338dSopenharmony_ci}
2029762338dSopenharmony_ci
2039762338dSopenharmony_ci/**
2049762338dSopenharmony_ci * @tc.number: Security_IAM_UserAuth_HDI_FUNC_0101
2059762338dSopenharmony_ci * @tc.name: Test Init
2069762338dSopenharmony_ci * @tc.size: MediumTest
2079762338dSopenharmony_ci * @tc.type: Function
2089762338dSopenharmony_ci * @tc.level: Level1
2099762338dSopenharmony_ci */
2109762338dSopenharmony_ciHWTEST_F(UserIamUserAuthTest, Security_IAM_UserAuth_HDI_FUNC_0101, Function | MediumTest | Level1)
2119762338dSopenharmony_ci{
2129762338dSopenharmony_ci    cout << "start Init" << endl;
2139762338dSopenharmony_ci    const std::string deviceUdid = std::string(64, '0');
2149762338dSopenharmony_ci    int32_t ret = g_service.Init(deviceUdid);
2159762338dSopenharmony_ci    EXPECT_EQ(ret, 0);
2169762338dSopenharmony_ci}
2179762338dSopenharmony_ci
2189762338dSopenharmony_ci/**
2199762338dSopenharmony_ci * @tc.number: Security_IAM_UserAuth_HDI_FUNC_0102
2209762338dSopenharmony_ci * @tc.name: Test AddExecutor
2219762338dSopenharmony_ci * @tc.size: MediumTest
2229762338dSopenharmony_ci * @tc.type: Function
2239762338dSopenharmony_ci * @tc.level: Level1
2249762338dSopenharmony_ci */
2259762338dSopenharmony_ciHWTEST_F(UserIamUserAuthTest, Security_IAM_UserAuth_HDI_FUNC_0102, Function | MediumTest | Level1)
2269762338dSopenharmony_ci{
2279762338dSopenharmony_ci    cout << "start AddExecutor" << endl;
2289762338dSopenharmony_ci    ExecutorRegisterInfo info;
2299762338dSopenharmony_ci    FillExecutorRegisterInfo(parcel, info);
2309762338dSopenharmony_ci    uint64_t index = parcel.ReadUint64();
2319762338dSopenharmony_ci    std::vector<uint8_t> publicKey;
2329762338dSopenharmony_ci    FillTestUint8Vector(parcel, publicKey);
2339762338dSopenharmony_ci    std::vector<uint64_t> templateIds;
2349762338dSopenharmony_ci    FillTestUint64Vector(parcel, templateIds);
2359762338dSopenharmony_ci    int32_t ret = g_service.AddExecutor(info, index, publicKey, templateIds);
2369762338dSopenharmony_ci    cout << "ret is " << ret << endl;
2379762338dSopenharmony_ci    ASSERT_EQ(ret != Expectedvalue, true);
2389762338dSopenharmony_ci}
2399762338dSopenharmony_ci
2409762338dSopenharmony_ci/**
2419762338dSopenharmony_ci * @tc.number: Security_IAM_UserAuth_HDI_FUNC_0103
2429762338dSopenharmony_ci * @tc.name: Test GetCredential
2439762338dSopenharmony_ci * @tc.size: MediumTest
2449762338dSopenharmony_ci * @tc.type: Function
2459762338dSopenharmony_ci * @tc.level: Level1
2469762338dSopenharmony_ci */
2479762338dSopenharmony_ciHWTEST_F(UserIamUserAuthTest, Security_IAM_UserAuth_HDI_FUNC_0103, Function | MediumTest | Level1)
2489762338dSopenharmony_ci{
2499762338dSopenharmony_ci    cout << "start GetCredential" << endl;
2509762338dSopenharmony_ci    int32_t userId = parcel.ReadInt32();
2519762338dSopenharmony_ci    int32_t authType = static_cast<int32_t>(parcel.ReadInt32());
2529762338dSopenharmony_ci    std::vector<CredentialInfo> infos;
2539762338dSopenharmony_ci    FillCredentialInfoVector(parcel, infos);
2549762338dSopenharmony_ci    int32_t ret = g_service.GetCredential(userId, authType, infos);
2559762338dSopenharmony_ci    cout << "ret is " << ret << endl;
2569762338dSopenharmony_ci    EXPECT_EQ(ret, 0);
2579762338dSopenharmony_ci}
2589762338dSopenharmony_ci
2599762338dSopenharmony_ci/**
2609762338dSopenharmony_ci * @tc.number: Security_IAM_UserAuth_HDI_FUNC_0104
2619762338dSopenharmony_ci * @tc.name: Test GetUserInfo
2629762338dSopenharmony_ci * @tc.size: MediumTest
2639762338dSopenharmony_ci * @tc.type: Function
2649762338dSopenharmony_ci * @tc.level: Level1
2659762338dSopenharmony_ci */
2669762338dSopenharmony_ciHWTEST_F(UserIamUserAuthTest, Security_IAM_UserAuth_HDI_FUNC_0104, Function | MediumTest | Level1)
2679762338dSopenharmony_ci{
2689762338dSopenharmony_ci    cout << "start GetUserInfo" << endl;
2699762338dSopenharmony_ci    int32_t userId = parcel.ReadInt32();
2709762338dSopenharmony_ci    uint64_t secureUid = parcel.ReadUint64();
2719762338dSopenharmony_ci    int32_t pinSubType = static_cast<int32_t>(parcel.ReadUint32());
2729762338dSopenharmony_ci    std::vector<EnrolledInfo> infos;
2739762338dSopenharmony_ci    FillEnrolledInfoVector(parcel, infos);
2749762338dSopenharmony_ci    int32_t ret = g_service.GetUserInfo(userId, secureUid, pinSubType, infos);
2759762338dSopenharmony_ci    cout << "ret is " << ret << endl;
2769762338dSopenharmony_ci    ASSERT_EQ(ret != Expectedvalue, true);
2779762338dSopenharmony_ci}
2789762338dSopenharmony_ci
2799762338dSopenharmony_ci/**
2809762338dSopenharmony_ci * @tc.number: Security_IAM_UserAuth_HDI_FUNC_0105
2819762338dSopenharmony_ci * @tc.name: Test DeleteUser
2829762338dSopenharmony_ci * @tc.size: MediumTest
2839762338dSopenharmony_ci * @tc.type: Function
2849762338dSopenharmony_ci * @tc.level: Level1
2859762338dSopenharmony_ci */
2869762338dSopenharmony_ciHWTEST_F(UserIamUserAuthTest, Security_IAM_UserAuth_HDI_FUNC_0105, Function | MediumTest | Level1)
2879762338dSopenharmony_ci{
2889762338dSopenharmony_ci    cout << "start DeleteUser" << endl;
2899762338dSopenharmony_ci    int32_t userId = parcel.ReadInt32();
2909762338dSopenharmony_ci    std::vector<uint8_t> authToken;
2919762338dSopenharmony_ci    FillTestUint8Vector(parcel, authToken);
2929762338dSopenharmony_ci    std::vector<CredentialInfo> deletedInfos;
2939762338dSopenharmony_ci    FillCredentialInfoVector(parcel, deletedInfos);
2949762338dSopenharmony_ci    std::vector<uint8_t> rootSecret;
2959762338dSopenharmony_ci    FillTestUint8Vector(parcel, rootSecret);
2969762338dSopenharmony_ci    int32_t ret = g_service.DeleteUser(userId, authToken, deletedInfos, rootSecret);
2979762338dSopenharmony_ci    cout << "ret is " << ret << endl;
2989762338dSopenharmony_ci    ASSERT_EQ(ret != Expectedvalue, true);
2999762338dSopenharmony_ci}
3009762338dSopenharmony_ci
3019762338dSopenharmony_ci/**
3029762338dSopenharmony_ci * @tc.number: Security_IAM_UserAuth_HDI_FUNC_0106
3039762338dSopenharmony_ci * @tc.name: Test BeginIdentification
3049762338dSopenharmony_ci * @tc.size: MediumTest
3059762338dSopenharmony_ci * @tc.type: Function
3069762338dSopenharmony_ci * @tc.level: Level1
3079762338dSopenharmony_ci */
3089762338dSopenharmony_ciHWTEST_F(UserIamUserAuthTest, Security_IAM_UserAuth_HDI_FUNC_0106, Function | MediumTest | Level1)
3099762338dSopenharmony_ci{
3109762338dSopenharmony_ci    cout << "start BeginIdentification" << endl;
3119762338dSopenharmony_ci    uint64_t contextId = parcel.ReadUint64();
3129762338dSopenharmony_ci    AuthType authType = static_cast<AuthType>(parcel.ReadInt32());
3139762338dSopenharmony_ci    std::vector<uint8_t> challenge;
3149762338dSopenharmony_ci    FillTestUint8Vector(parcel, challenge);
3159762338dSopenharmony_ci    uint32_t executorId = parcel.ReadUint32();
3169762338dSopenharmony_ci    ScheduleInfo scheduleInfo;
3179762338dSopenharmony_ci    FillScheduleInfo(parcel, scheduleInfo);
3189762338dSopenharmony_ci    int32_t ret = g_service.BeginIdentification(contextId, authType, challenge, executorId, scheduleInfo);
3199762338dSopenharmony_ci    cout << "ret is " << ret << endl;
3209762338dSopenharmony_ci    ASSERT_EQ(ret != Expectedvalue, true);
3219762338dSopenharmony_ci}
3229762338dSopenharmony_ci
3239762338dSopenharmony_ci/**
3249762338dSopenharmony_ci * @tc.number: Security_IAM_UserAuth_HDI_FUNC_0107
3259762338dSopenharmony_ci * @tc.name: Test DeleteExecutor
3269762338dSopenharmony_ci * @tc.size: MediumTest
3279762338dSopenharmony_ci * @tc.type: Function
3289762338dSopenharmony_ci * @tc.level: Level1
3299762338dSopenharmony_ci */
3309762338dSopenharmony_ciHWTEST_F(UserIamUserAuthTest, Security_IAM_UserAuth_HDI_FUNC_0107, Function | MediumTest | Level1)
3319762338dSopenharmony_ci{
3329762338dSopenharmony_ci    cout << "start DeleteExecutor" << endl;
3339762338dSopenharmony_ci    uint64_t index = parcel.ReadUint64();
3349762338dSopenharmony_ci    int32_t ret = g_service.DeleteExecutor(index);
3359762338dSopenharmony_ci    cout << "ret is " << ret << endl;
3369762338dSopenharmony_ci    ASSERT_EQ(ret != Expectedvalue, true);
3379762338dSopenharmony_ci}
3389762338dSopenharmony_ci
3399762338dSopenharmony_ci/**
3409762338dSopenharmony_ci * @tc.number: Security_IAM_UserAuth_HDI_FUNC_0108
3419762338dSopenharmony_ci * @tc.name: Test OpenSession
3429762338dSopenharmony_ci * @tc.size: MediumTest
3439762338dSopenharmony_ci * @tc.type: Function
3449762338dSopenharmony_ci * @tc.level: Level1
3459762338dSopenharmony_ci */
3469762338dSopenharmony_ciHWTEST_F(UserIamUserAuthTest, Security_IAM_UserAuth_HDI_FUNC_0108, Function | MediumTest | Level1)
3479762338dSopenharmony_ci{
3489762338dSopenharmony_ci    cout << "start OpenSession" << endl;
3499762338dSopenharmony_ci    int32_t userId = parcel.ReadInt32();
3509762338dSopenharmony_ci    std::vector<uint8_t> challenge;
3519762338dSopenharmony_ci    FillTestUint8Vector(parcel, challenge);
3529762338dSopenharmony_ci    int32_t ret = g_service.OpenSession(userId, challenge);
3539762338dSopenharmony_ci    cout << "ret is " << ret << endl;
3549762338dSopenharmony_ci    EXPECT_EQ(ret, 0);
3559762338dSopenharmony_ci}
3569762338dSopenharmony_ci
3579762338dSopenharmony_ci/**
3589762338dSopenharmony_ci * @tc.number: Security_IAM_UserAuth_HDI_FUNC_0109
3599762338dSopenharmony_ci * @tc.name: Test CloseSession
3609762338dSopenharmony_ci * @tc.size: MediumTest
3619762338dSopenharmony_ci * @tc.type: Function
3629762338dSopenharmony_ci * @tc.level: Level1
3639762338dSopenharmony_ci */
3649762338dSopenharmony_ciHWTEST_F(UserIamUserAuthTest, Security_IAM_UserAuth_HDI_FUNC_0109, Function | MediumTest | Level1)
3659762338dSopenharmony_ci{
3669762338dSopenharmony_ci    cout << "start CloseSession" << endl;
3679762338dSopenharmony_ci    int32_t userId = parcel.ReadInt32();
3689762338dSopenharmony_ci    int32_t ret = g_service.CloseSession(userId);
3699762338dSopenharmony_ci    cout << "ret is " << ret << endl;
3709762338dSopenharmony_ci    EXPECT_EQ(ret, 0);
3719762338dSopenharmony_ci}
3729762338dSopenharmony_ci
3739762338dSopenharmony_ci/**
3749762338dSopenharmony_ci * @tc.number: Security_IAM_UserAuth_HDI_FUNC_0110
3759762338dSopenharmony_ci * @tc.name: Test BeginEnrollment
3769762338dSopenharmony_ci * @tc.size: MediumTest
3779762338dSopenharmony_ci * @tc.type: Function
3789762338dSopenharmony_ci * @tc.level: Level1
3799762338dSopenharmony_ci */
3809762338dSopenharmony_ciHWTEST_F(UserIamUserAuthTest, Security_IAM_UserAuth_HDI_FUNC_0110, Function | MediumTest | Level1)
3819762338dSopenharmony_ci{
3829762338dSopenharmony_ci    cout << "start BeginEnrollment" << endl;
3839762338dSopenharmony_ci    std::vector<uint8_t> authToken;
3849762338dSopenharmony_ci    FillTestUint8Vector(parcel, authToken);
3859762338dSopenharmony_ci    EnrollParam param;
3869762338dSopenharmony_ci    FillEnrollParam(parcel, param);
3879762338dSopenharmony_ci    ScheduleInfo info;
3889762338dSopenharmony_ci    FillScheduleInfo(parcel, info);
3899762338dSopenharmony_ci    int32_t ret = g_service.BeginEnrollment(authToken, param, info);
3909762338dSopenharmony_ci    cout << "ret is " << ret << endl;
3919762338dSopenharmony_ci    ASSERT_EQ(ret != Expectedvalue, true);
3929762338dSopenharmony_ci}
3939762338dSopenharmony_ci
3949762338dSopenharmony_ci/**
3959762338dSopenharmony_ci * @tc.number: Security_IAM_UserAuth_HDI_FUNC_0111
3969762338dSopenharmony_ci * @tc.name: Test UpdateEnrollmentResult
3979762338dSopenharmony_ci * @tc.size: MediumTest
3989762338dSopenharmony_ci * @tc.type: Function
3999762338dSopenharmony_ci * @tc.level: Level1
4009762338dSopenharmony_ci */
4019762338dSopenharmony_ciHWTEST_F(UserIamUserAuthTest, Security_IAM_UserAuth_HDI_FUNC_0111, Function | MediumTest | Level1)
4029762338dSopenharmony_ci{
4039762338dSopenharmony_ci    cout << "start UpdateEnrollmentResult" << endl;
4049762338dSopenharmony_ci    int32_t userId = parcel.ReadInt32();
4059762338dSopenharmony_ci    std::vector<uint8_t> scheduleResult;
4069762338dSopenharmony_ci    FillTestUint8Vector(parcel, scheduleResult);
4079762338dSopenharmony_ci    EnrollResultInfo info = {};
4089762338dSopenharmony_ci    FillCredentialInfo(parcel, info.oldInfo);
4099762338dSopenharmony_ci    info.credentialId = parcel.ReadUint64();
4109762338dSopenharmony_ci    FillTestUint8Vector(parcel, info.rootSecret);
4119762338dSopenharmony_ci    int32_t ret = g_service.UpdateEnrollmentResult(userId, scheduleResult, info);
4129762338dSopenharmony_ci    cout << "ret is " << ret << endl;
4139762338dSopenharmony_ci    ASSERT_EQ(ret != Expectedvalue, true);
4149762338dSopenharmony_ci}
4159762338dSopenharmony_ci
4169762338dSopenharmony_ci/**
4179762338dSopenharmony_ci * @tc.number: Security_IAM_UserAuth_HDI_FUNC_0112
4189762338dSopenharmony_ci * @tc.name: Test CancelEnrollment
4199762338dSopenharmony_ci * @tc.size: MediumTest
4209762338dSopenharmony_ci * @tc.type: Function
4219762338dSopenharmony_ci * @tc.level: Level1
4229762338dSopenharmony_ci */
4239762338dSopenharmony_ciHWTEST_F(UserIamUserAuthTest, Security_IAM_UserAuth_HDI_FUNC_0112, Function | MediumTest | Level1)
4249762338dSopenharmony_ci{
4259762338dSopenharmony_ci    cout << "start CancelEnrollment" << endl;
4269762338dSopenharmony_ci    int32_t userId = parcel.ReadInt32();
4279762338dSopenharmony_ci    int32_t ret = g_service.CancelEnrollment(userId);
4289762338dSopenharmony_ci    cout << "ret is " << ret << endl;
4299762338dSopenharmony_ci    EXPECT_EQ(ret, 0);
4309762338dSopenharmony_ci}
4319762338dSopenharmony_ci
4329762338dSopenharmony_ci/**
4339762338dSopenharmony_ci * @tc.number: Security_IAM_UserAuth_HDI_FUNC_0113
4349762338dSopenharmony_ci * @tc.name: Test DeleteCredential
4359762338dSopenharmony_ci * @tc.size: MediumTest
4369762338dSopenharmony_ci * @tc.type: Function
4379762338dSopenharmony_ci * @tc.level: Level1
4389762338dSopenharmony_ci */
4399762338dSopenharmony_ciHWTEST_F(UserIamUserAuthTest, Security_IAM_UserAuth_HDI_FUNC_0113, Function | MediumTest | Level1)
4409762338dSopenharmony_ci{
4419762338dSopenharmony_ci    cout << "start DeleteCredential" << endl;
4429762338dSopenharmony_ci    int32_t userId = parcel.ReadInt32();
4439762338dSopenharmony_ci    uint64_t credentialId = parcel.ReadUint64();
4449762338dSopenharmony_ci    std::vector<uint8_t> authToken;
4459762338dSopenharmony_ci    FillTestUint8Vector(parcel, authToken);
4469762338dSopenharmony_ci    CredentialInfo info;
4479762338dSopenharmony_ci    FillCredentialInfo(parcel, info);
4489762338dSopenharmony_ci    int32_t ret = g_service.DeleteCredential(userId, credentialId, authToken, info);
4499762338dSopenharmony_ci    cout << "ret is " << ret << endl;
4509762338dSopenharmony_ci    ASSERT_EQ(ret != Expectedvalue, true);
4519762338dSopenharmony_ci}
4529762338dSopenharmony_ci
4539762338dSopenharmony_ci/**
4549762338dSopenharmony_ci * @tc.number: Security_IAM_UserAuth_HDI_FUNC_0114
4559762338dSopenharmony_ci * @tc.name: Test EnforceDeleteUser
4569762338dSopenharmony_ci * @tc.size: MediumTest
4579762338dSopenharmony_ci * @tc.type: Function
4589762338dSopenharmony_ci * @tc.level: Level1
4599762338dSopenharmony_ci */
4609762338dSopenharmony_ciHWTEST_F(UserIamUserAuthTest, Security_IAM_UserAuth_HDI_FUNC_0114, Function | MediumTest | Level1)
4619762338dSopenharmony_ci{
4629762338dSopenharmony_ci    cout << "start EnforceDeleteUser" << endl;
4639762338dSopenharmony_ci    int32_t userId = parcel.ReadInt32();
4649762338dSopenharmony_ci    std::vector<CredentialInfo> deletedInfos;
4659762338dSopenharmony_ci    FillCredentialInfoVector(parcel, deletedInfos);
4669762338dSopenharmony_ci    int32_t ret = g_service.EnforceDeleteUser(userId, deletedInfos);
4679762338dSopenharmony_ci    cout << "ret is " << ret << endl;
4689762338dSopenharmony_ci    ASSERT_EQ(ret != Expectedvalue, true);
4699762338dSopenharmony_ci}
4709762338dSopenharmony_ci
4719762338dSopenharmony_ci/**
4729762338dSopenharmony_ci * @tc.number: Security_IAM_UserAuth_HDI_FUNC_0115
4739762338dSopenharmony_ci * @tc.name: Test BeginAuthentication
4749762338dSopenharmony_ci * @tc.size: MediumTest
4759762338dSopenharmony_ci * @tc.type: Function
4769762338dSopenharmony_ci * @tc.level: Level1
4779762338dSopenharmony_ci */
4789762338dSopenharmony_ciHWTEST_F(UserIamUserAuthTest, Security_IAM_UserAuth_HDI_FUNC_0115, Function | MediumTest | Level1)
4799762338dSopenharmony_ci{
4809762338dSopenharmony_ci    cout << "start BeginAuthentication" << endl;
4819762338dSopenharmony_ci    uint64_t contextId = parcel.ReadUint64();
4829762338dSopenharmony_ci    AuthParam param;
4839762338dSopenharmony_ci    FillAuthParam(parcel, param);
4849762338dSopenharmony_ci    std::vector<ScheduleInfo> scheduleInfos;
4859762338dSopenharmony_ci    FillScheduleInfoVector(parcel, scheduleInfos);
4869762338dSopenharmony_ci    int32_t ret = g_service.BeginAuthentication(contextId, param, scheduleInfos);
4879762338dSopenharmony_ci    cout << "ret is " << ret << endl;
4889762338dSopenharmony_ci    ASSERT_EQ(ret != Expectedvalue, true);
4899762338dSopenharmony_ci}
4909762338dSopenharmony_ci
4919762338dSopenharmony_ci/**
4929762338dSopenharmony_ci * @tc.number: Security_IAM_UserAuth_HDI_FUNC_0116
4939762338dSopenharmony_ci * @tc.name: Test UpdateAuthenticationResult
4949762338dSopenharmony_ci * @tc.size: MediumTest
4959762338dSopenharmony_ci * @tc.type: Function
4969762338dSopenharmony_ci * @tc.level: Level1
4979762338dSopenharmony_ci */
4989762338dSopenharmony_ciHWTEST_F(UserIamUserAuthTest, Security_IAM_UserAuth_HDI_FUNC_0116, Function | MediumTest | Level1)
4999762338dSopenharmony_ci{
5009762338dSopenharmony_ci    cout << "start UpdateAuthenticationResult" << endl;
5019762338dSopenharmony_ci    uint64_t contextId = parcel.ReadUint64();
5029762338dSopenharmony_ci    std::vector<uint8_t> scheduleResult;
5039762338dSopenharmony_ci    FillTestUint8Vector(parcel, scheduleResult);
5049762338dSopenharmony_ci    AuthResultInfo info;
5059762338dSopenharmony_ci    FillAuthResultInfo(parcel, info);
5069762338dSopenharmony_ci    EnrolledState enrolledState;
5079762338dSopenharmony_ci    int32_t ret = g_service.UpdateAuthenticationResult(contextId, scheduleResult, info, enrolledState);
5089762338dSopenharmony_ci    cout << "ret is " << ret << endl;
5099762338dSopenharmony_ci    ASSERT_EQ(ret != Expectedvalue, true);
5109762338dSopenharmony_ci}
5119762338dSopenharmony_ci
5129762338dSopenharmony_ci/**
5139762338dSopenharmony_ci * @tc.number: Security_IAM_UserAuth_HDI_FUNC_0117
5149762338dSopenharmony_ci * @tc.name: Test CancelAuthentication
5159762338dSopenharmony_ci * @tc.size: MediumTest
5169762338dSopenharmony_ci * @tc.type: Function
5179762338dSopenharmony_ci * @tc.level: Level1
5189762338dSopenharmony_ci */
5199762338dSopenharmony_ciHWTEST_F(UserIamUserAuthTest, Security_IAM_UserAuth_HDI_FUNC_0117, Function | MediumTest | Level1)
5209762338dSopenharmony_ci{
5219762338dSopenharmony_ci    cout << "start CancelAuthentication" << endl;
5229762338dSopenharmony_ci    uint64_t contextId = parcel.ReadUint64();
5239762338dSopenharmony_ci    int32_t ret = g_service.CancelAuthentication(contextId);
5249762338dSopenharmony_ci    cout << "ret is " << ret << endl;
5259762338dSopenharmony_ci    ASSERT_EQ(ret != Expectedvalue, true);
5269762338dSopenharmony_ci}
5279762338dSopenharmony_ci
5289762338dSopenharmony_ci/**
5299762338dSopenharmony_ci * @tc.number: Security_IAM_UserAuth_HDI_FUNC_0118
5309762338dSopenharmony_ci * @tc.name: Test UpdateIdentificationResult
5319762338dSopenharmony_ci * @tc.size: MediumTest
5329762338dSopenharmony_ci * @tc.type: Function
5339762338dSopenharmony_ci * @tc.level: Level1
5349762338dSopenharmony_ci */
5359762338dSopenharmony_ciHWTEST_F(UserIamUserAuthTest, Security_IAM_UserAuth_HDI_FUNC_0118, Function | MediumTest | Level1)
5369762338dSopenharmony_ci{
5379762338dSopenharmony_ci    cout << "start UpdateIdentificationResult" << endl;
5389762338dSopenharmony_ci    uint64_t contextId = parcel.ReadUint64();
5399762338dSopenharmony_ci    std::vector<uint8_t> scheduleResult;
5409762338dSopenharmony_ci    FillTestUint8Vector(parcel, scheduleResult);
5419762338dSopenharmony_ci    IdentifyResultInfo info;
5429762338dSopenharmony_ci    FillIdentifyResultInfo(parcel, info);
5439762338dSopenharmony_ci    int32_t ret = g_service.UpdateIdentificationResult(contextId, scheduleResult, info);
5449762338dSopenharmony_ci    cout << "ret is " << ret << endl;
5459762338dSopenharmony_ci    ASSERT_EQ(ret != Expectedvalue, true);
5469762338dSopenharmony_ci}
5479762338dSopenharmony_ci
5489762338dSopenharmony_ci/**
5499762338dSopenharmony_ci * @tc.number: Security_IAM_UserAuth_HDI_FUNC_0119
5509762338dSopenharmony_ci * @tc.name: Test CancelIdentification
5519762338dSopenharmony_ci * @tc.size: MediumTest
5529762338dSopenharmony_ci * @tc.type: Function
5539762338dSopenharmony_ci * @tc.level: Level1
5549762338dSopenharmony_ci */
5559762338dSopenharmony_ciHWTEST_F(UserIamUserAuthTest, Security_IAM_UserAuth_HDI_FUNC_0119, Function | MediumTest | Level1)
5569762338dSopenharmony_ci{
5579762338dSopenharmony_ci    cout << "start CancelIdentification" << endl;
5589762338dSopenharmony_ci    uint64_t contextId = parcel.ReadUint64();
5599762338dSopenharmony_ci    int32_t ret = g_service.CancelIdentification(contextId);
5609762338dSopenharmony_ci    cout << "ret is " << ret << endl;
5619762338dSopenharmony_ci    ASSERT_EQ(ret != Expectedvalue, true);
5629762338dSopenharmony_ci}
5639762338dSopenharmony_ci
5649762338dSopenharmony_ci/**
5659762338dSopenharmony_ci * @tc.number: Security_IAM_UserAuth_HDI_FUNC_0120
5669762338dSopenharmony_ci * @tc.name: Test GetAvailableStatus
5679762338dSopenharmony_ci * @tc.size: MediumTest
5689762338dSopenharmony_ci * @tc.type: Function
5699762338dSopenharmony_ci * @tc.level: Level1
5709762338dSopenharmony_ci */
5719762338dSopenharmony_ciHWTEST_F(UserIamUserAuthTest, Security_IAM_UserAuth_HDI_FUNC_0120, Function | MediumTest | Level1)
5729762338dSopenharmony_ci{
5739762338dSopenharmony_ci    cout << "start GetAvailableStatus" << endl;
5749762338dSopenharmony_ci    int32_t userId = parcel.ReadInt32();
5759762338dSopenharmony_ci    AuthType authType = static_cast<AuthType>(parcel.ReadInt32());
5769762338dSopenharmony_ci    uint32_t authTrustLevel = parcel.ReadUint32();
5779762338dSopenharmony_ci    int32_t checkResult = parcel.ReadInt32();
5789762338dSopenharmony_ci    int32_t ret = g_service.GetAvailableStatus(userId, authType, authTrustLevel, checkResult);
5799762338dSopenharmony_ci    cout << "ret is " << ret << endl;
5809762338dSopenharmony_ci    ASSERT_EQ(checkResult != Expectedvalue, true);
5819762338dSopenharmony_ci}
5829762338dSopenharmony_ci
5839762338dSopenharmony_ci/**
5849762338dSopenharmony_ci * @tc.number: Security_IAM_UserAuth_HDI_FUNC_0121
5859762338dSopenharmony_ci * @tc.name: Test GetValidSolution
5869762338dSopenharmony_ci * @tc.size: MediumTest
5879762338dSopenharmony_ci * @tc.type: Function
5889762338dSopenharmony_ci * @tc.level: Level1
5899762338dSopenharmony_ci */
5909762338dSopenharmony_ciHWTEST_F(UserIamUserAuthTest, Security_IAM_UserAuth_HDI_FUNC_0121, Function | MediumTest | Level1)
5919762338dSopenharmony_ci{
5929762338dSopenharmony_ci    cout << "start GetValidSolution" << endl;
5939762338dSopenharmony_ci    int32_t userId = parcel.ReadInt32();
5949762338dSopenharmony_ci    std::vector<int32_t> authTypes;
5959762338dSopenharmony_ci    FillAuthTypeVector(parcel, authTypes);
5969762338dSopenharmony_ci    uint32_t authTrustLevel = parcel.ReadUint32();
5979762338dSopenharmony_ci    std::vector<int32_t> validTypes;
5989762338dSopenharmony_ci    FillAuthTypeVector(parcel, validTypes);
5999762338dSopenharmony_ci    int32_t ret = g_service.GetValidSolution(userId, authTypes, authTrustLevel, validTypes);
6009762338dSopenharmony_ci    cout << "ret is " << ret << endl;
6019762338dSopenharmony_ci    ASSERT_EQ(ret != Expectedvalue, true);
6029762338dSopenharmony_ci}
6039762338dSopenharmony_ci
6049762338dSopenharmony_ci/**
6059762338dSopenharmony_ci * @tc.number: Security_IAM_UserAuth_HDI_NEW_FUNC_0101
6069762338dSopenharmony_ci * @tc.name: Test BeginEnrollmentV1_1
6079762338dSopenharmony_ci * @tc.size: MediumTest
6089762338dSopenharmony_ci * @tc.type: Function
6099762338dSopenharmony_ci * @tc.level: Level1
6109762338dSopenharmony_ci */
6119762338dSopenharmony_ciHWTEST_F(UserIamUserAuthTest, Security_IAM_UserAuth_HDI_NEW_FUNC_0101, Function | MediumTest | Level1)
6129762338dSopenharmony_ci{
6139762338dSopenharmony_ci    cout << "start BeginEnrollmentV1_1" << endl;
6149762338dSopenharmony_ci    std::vector<uint8_t> authToken;
6159762338dSopenharmony_ci    FillTestUint8Vector(parcel, authToken);
6169762338dSopenharmony_ci    EnrollParam param;
6179762338dSopenharmony_ci    FillEnrollParam(parcel, param);
6189762338dSopenharmony_ci    ScheduleInfo info;
6199762338dSopenharmony_ci    FillTestScheduleInfo(parcel, info);
6209762338dSopenharmony_ci    int32_t ret = g_service.BeginEnrollment(authToken, param, info);
6219762338dSopenharmony_ci
6229762338dSopenharmony_ci    ASSERT_EQ(ret != Expectedvalue, true);
6239762338dSopenharmony_ci}
6249762338dSopenharmony_ci
6259762338dSopenharmony_ci/**
6269762338dSopenharmony_ci * @tc.number: Security_IAM_UserAuth_HDI_NEW_FUNC_0102
6279762338dSopenharmony_ci * @tc.name: Test BeginAuthenticationV1_1
6289762338dSopenharmony_ci * @tc.size: MediumTest
6299762338dSopenharmony_ci * @tc.type: Function
6309762338dSopenharmony_ci * @tc.level: Level1
6319762338dSopenharmony_ci */
6329762338dSopenharmony_ciHWTEST_F(UserIamUserAuthTest, Security_IAM_UserAuth_HDI_NEW_FUNC_0102, Function | MediumTest | Level1)
6339762338dSopenharmony_ci{
6349762338dSopenharmony_ci    cout << "start BeginAuthenticationV1_1" << endl;
6359762338dSopenharmony_ci    uint64_t contextId = parcel.ReadUint64();
6369762338dSopenharmony_ci    AuthParam param;
6379762338dSopenharmony_ci    FillAuthParam(parcel, param);
6389762338dSopenharmony_ci    std::vector<ScheduleInfo> scheduleInfos;
6399762338dSopenharmony_ci    FillTestScheduleInfo_Vector(parcel, scheduleInfos);
6409762338dSopenharmony_ci    int32_t ret = g_service.BeginAuthentication(contextId, param, scheduleInfos);
6419762338dSopenharmony_ci
6429762338dSopenharmony_ci    ASSERT_EQ(ret != Expectedvalue, true);
6439762338dSopenharmony_ci}
6449762338dSopenharmony_ci
6459762338dSopenharmony_ci/**
6469762338dSopenharmony_ci * @tc.number: Security_IAM_UserAuth_HDI_NEW_FUNC_0103
6479762338dSopenharmony_ci * @tc.name: Test BeginIdentificationV1_1
6489762338dSopenharmony_ci * @tc.size: MediumTest
6499762338dSopenharmony_ci * @tc.type: Function
6509762338dSopenharmony_ci * @tc.level: Level1
6519762338dSopenharmony_ci */
6529762338dSopenharmony_ciHWTEST_F(UserIamUserAuthTest, Security_IAM_UserAuth_HDI_NEW_FUNC_0103, Function | MediumTest | Level1)
6539762338dSopenharmony_ci{
6549762338dSopenharmony_ci    cout << "start BeginIdentificationV1_1" << endl;
6559762338dSopenharmony_ci    uint64_t contextId = parcel.ReadUint64();
6569762338dSopenharmony_ci    AuthType authType = static_cast<AuthType>(parcel.ReadInt32());
6579762338dSopenharmony_ci    std::vector<uint8_t> challenge;
6589762338dSopenharmony_ci    FillTestUint8Vector(parcel, challenge);
6599762338dSopenharmony_ci    uint32_t executorId = parcel.ReadUint32();
6609762338dSopenharmony_ci    ScheduleInfo scheduleInfo;
6619762338dSopenharmony_ci    FillTestScheduleInfo(parcel, scheduleInfo);
6629762338dSopenharmony_ci    int32_t ret = g_service.BeginIdentification(contextId, authType, challenge, executorId, scheduleInfo);
6639762338dSopenharmony_ci
6649762338dSopenharmony_ci    ASSERT_EQ(ret != Expectedvalue, true);
6659762338dSopenharmony_ci}