diff --git a/security/BUILD.gn b/security/BUILD.gn index 9c2ddc1c77b40b9f32552001dbd7c14893899200..cc6f6b1168394b955cd5872171dc47dcaba8f6de 100755 --- a/security/BUILD.gn +++ b/security/BUILD.gn @@ -20,9 +20,7 @@ group("security") { # "authentication_standard/deviceauth_p2p:DeviceauthP2PFunctionCPPTest", "dataprotect/huks_standard_adapter:huks_std_function_test", "deviceauth/deviceauth_function:DeviceAuthFunctionTest", - "permission/permissionkitcpp:PermissionKitFunctionCPPTest", - "permission/permissionkitcpp:PermissionKitPerformanceCPPTest", - "permission/permissionkitcpp:PermissionKitReliabilityCPPTest", + "permission/permissionkitcpp:PermissionKitCPPTest", ] } else { deps = diff --git a/security/permission/permissionkitcpp/BUILD.gn b/security/permission/permissionkitcpp/BUILD.gn index c8d28206a105916f77b7adcda0aeedc67a1dfc39..973692365bedb63dfb83cab785054bc7b0fcfee3 100644 --- a/security/permission/permissionkitcpp/BUILD.gn +++ b/security/permission/permissionkitcpp/BUILD.gn @@ -75,3 +75,25 @@ ohos_moduletest_suite("PermissionKitReliabilityCPPTest") { "//utils/native/base:utils", ] } + +################################################################################## +ohos_moduletest_suite("PermissionKitCPPTest") { + subsystem_name = "hits" + part_name = "permission_standard" + module_out_path = subsystem_name + "/" + part_name + + configs = [ ":module_private_config" ] + + cflags_cc = [ "-DHILOG_ENABLE" ] + + sources = [ + "src/PermissionKitFunctionCPPTest.cpp", + "src/PermissionKitPerformanceCPPTest.cpp", + "src/PermissionKitReliabilityCPPTest.cpp", + ] + deps = [ + "//base/security/permission/frameworks/permission_standard/permissioninfrastructure:permission_standard_infrastructure_cxx", + "//base/security/permission/interfaces/innerkits/permission_standard/permissionsdk:libpermissionsdk_standard", + "//utils/native/base:utils", + ] +} diff --git a/security/permission/permissionkitcpp/Test.json b/security/permission/permissionkitcpp/Test.json index cf74ac102cf5ef8411a4a2bc940b6e4c08dd57ed..d60b8674934a3f4b3d9cceacf857561eff4145b1 100644 --- a/security/permission/permissionkitcpp/Test.json +++ b/security/permission/permissionkitcpp/Test.json @@ -2,9 +2,7 @@ "kits": [ { "push": [ - "PermissionKitFunctionCPPTest->/data/local/tmp/PermissionKitFunctionCPPTest", - "PermissionKitPerformanceCPPTest->/data/local/tmp/PermissionKitPerformanceCPPTest", - "PermissionKitReliabilityCPPTest->/data/local/tmp/PermissionKitReliabilityCPPTest" + "PermissionKitCPPTest->/data/local/tmp/PermissionKitCPPTest" ], "type": "PushKit", "post-push": [ diff --git a/security/permission/permissionkitcpp/src/PermissionKitFunctionCPPTest.cpp b/security/permission/permissionkitcpp/src/PermissionKitFunctionCPPTest.cpp index 791428b6e0fea82424720aae2387761cc44239d7..a2d2a5d28799833088a16ac60b528f4ac092b339 100644 --- a/security/permission/permissionkitcpp/src/PermissionKitFunctionCPPTest.cpp +++ b/security/permission/permissionkitcpp/src/PermissionKitFunctionCPPTest.cpp @@ -24,7 +24,15 @@ static vector permDefNormal; static vector permDefAbnormal1; static vector permDefAbnormal2; -void PermissionKitTest::SetUpTestCase() +class PermissionKitFunctionTest : public testing::Test { +public: + static void SetUpTestCase(); + static void TearDownTestCase(); + void SetUp(); + void TearDown(); +}; + +void PermissionKitFunctionTest::SetUpTestCase() { vector permDefList1; vector permDefList2; @@ -80,10 +88,10 @@ void PermissionKitTest::SetUpTestCase() permDefAbnormal2 = permDefList3; } -void PermissionKitTest::TearDownTestCase() +void PermissionKitFunctionTest::TearDownTestCase() {} -void PermissionKitTest::SetUp() +void PermissionKitFunctionTest::SetUp() { PermissionKit::RemoveDefPermissions(TEST_BUNDLE_NAME); PermissionKit::RemoveDefPermissions(ABNORMAL_BUNDLE_NAME); @@ -96,7 +104,7 @@ void PermissionKitTest::SetUp() PermissionKit::RevokeSystemGrantedPermission(TEST_BUNDLE_NAME, TEST_PERMISSION_NAME_BETA); } -void PermissionKitTest::TearDown() +void PermissionKitFunctionTest::TearDown() { PermissionKit::RemoveDefPermissions(TEST_BUNDLE_NAME); PermissionKit::RemoveDefPermissions(ABNORMAL_BUNDLE_NAME); @@ -119,7 +127,7 @@ void PermissionKitTest::TearDown() * @tc.type FUNC * @tc.level Level0 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddDefPer_001, TestSize.Level0) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_AddDefPer_001, TestSize.Level0) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -141,7 +149,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddDefPer_ * @tc.type FUNC * @tc.level Level3 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddDefPer_002, TestSize.Level3) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_AddDefPer_002, TestSize.Level3) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -162,7 +170,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddDefPer_ * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddDefPer_004, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_AddDefPer_004, TestSize.Level4) { int ret = PermissionKit::AddDefPermissions(permDefAbnormal2); ASSERT_EQ(RET_SUCCESS, ret); @@ -178,7 +186,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddDefPer_ * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddDefPer_005, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_AddDefPer_005, TestSize.Level4) { int ret = PermissionKit::AddDefPermissions(permDefAbnormal1); ASSERT_EQ(RET_SUCCESS, ret); @@ -194,7 +202,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddDefPer_ * @tc.type FUNC * @tc.level Level0 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveDefPer_001, TestSize.Level0) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_RemoveDefPer_001, TestSize.Level0) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -221,7 +229,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveDefP * @tc.type FUNC * @tc.level Level3 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveDefPer_002, TestSize.Level3) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_RemoveDefPer_002, TestSize.Level3) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -246,7 +254,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveDefP * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveDefPer_003, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_RemoveDefPer_003, TestSize.Level4) { int ret = PermissionKit::RemoveDefPermissions(BUNDLE_NAME_NOT_EXIST); ASSERT_EQ(RET_SUCCESS, ret); @@ -262,7 +270,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveDefP * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveDefPer_005, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_RemoveDefPer_005, TestSize.Level4) { int ret = PermissionKit::RemoveDefPermissions(ABNORMAL_BUNDLE_NAME); ASSERT_EQ(RET_SUCCESS, ret); @@ -278,7 +286,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveDefP * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveDefPer_006, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_RemoveDefPer_006, TestSize.Level4) { int ret = PermissionKit::RemoveDefPermissions(LONG_BUNDLE_NAME); ASSERT_EQ(RET_SUCCESS, ret); @@ -294,7 +302,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveDefP * @tc.type FUNC * @tc.level Level0 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GetDefPer_001, TestSize.Level0) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_GetDefPer_001, TestSize.Level0) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -316,7 +324,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GetDefPer_ * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GetDefPer_002, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_GetDefPer_002, TestSize.Level4) { PermissionDef permissionDefResultAlpha; int ret = PermissionKit::GetDefPermission(PERMISSION_NAME_NOT_EXIST, permissionDefResultAlpha); @@ -333,7 +341,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GetDefPer_ * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GetDefPer_004, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_GetDefPer_004, TestSize.Level4) { PermissionDef permissionDefResultAlpha; int ret = PermissionKit::GetDefPermission(ABNORMAL_BUNDLE_NAME, permissionDefResultAlpha); @@ -350,7 +358,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GetDefPer_ * @tc.type FUNC * @tc.level Level0 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddUserGrantedPer_001, TestSize.Level0) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_AddUserGrantedPer_001, TestSize.Level0) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -374,7 +382,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddUserGra * @tc.type FUNC * @tc.level Level1 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddUserGrantedPer_002, TestSize.Level1) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_AddUserGrantedPer_002, TestSize.Level1) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -398,7 +406,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddUserGra * @tc.type FUNC * @tc.level Level3 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddUserGrantedPer_004, TestSize.Level3) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_AddUserGrantedPer_004, TestSize.Level3) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -422,7 +430,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddUserGra * @tc.type FUNC * @tc.level Level1 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddUserGrantedPer_005, TestSize.Level1) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_AddUserGrantedPer_005, TestSize.Level1) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -444,7 +452,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddUserGra * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddUserGrantedPer_006, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_AddUserGrantedPer_006, TestSize.Level4) { vector permList; permList.push_back(TEST_PERMISSION_NAME_ALPHA); @@ -466,7 +474,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddUserGra * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddUserGrantedPer_007, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_AddUserGrantedPer_007, TestSize.Level4) { vector permList; permList.push_back(TEST_PERMISSION_NAME_ALPHA); @@ -484,7 +492,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddUserGra * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddUserGrantedPer_008, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_AddUserGrantedPer_008, TestSize.Level4) { vector permList; int ret = PermissionKit::AddUserGrantedReqPermissions(TEST_BUNDLE_NAME, permList, TEST_USER_ID); @@ -501,7 +509,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddUserGra * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddUserGrantedPer_010, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_AddUserGrantedPer_010, TestSize.Level4) { vector permList; permList.push_back(TEST_PERMISSION_NAME_ALPHA); @@ -519,7 +527,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddUserGra * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddUserGrantedPer_011, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_AddUserGrantedPer_011, TestSize.Level4) { vector permList; permList.push_back(TEST_PERMISSION_NAME_ALPHA); @@ -537,7 +545,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddUserGra * @tc.type FUNC * @tc.level Level0 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddSystemGrantedPer_001, TestSize.Level0) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_AddSystemGrantedPer_001, TestSize.Level0) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -561,7 +569,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddSystemG * @tc.type FUNC * @tc.level Level1 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddSystemGrantedPer_003, TestSize.Level1) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_AddSystemGrantedPer_003, TestSize.Level1) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -585,7 +593,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddSystemG * @tc.type FUNC * @tc.level Level1 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddSystemGrantedPer_004, TestSize.Level1) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_AddSystemGrantedPer_004, TestSize.Level1) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -611,7 +619,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddSystemG * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddSystemGrantedPer_005, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_AddSystemGrantedPer_005, TestSize.Level4) { vector permList; permList.push_back(TEST_PERMISSION_NAME_BETA); @@ -629,7 +637,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddSystemG * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddSystemGrantedPer_006, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_AddSystemGrantedPer_006, TestSize.Level4) { vector permList; int ret = PermissionKit::AddSystemGrantedReqPermissions(TEST_BUNDLE_NAME, permList); @@ -646,7 +654,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddSystemG * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddSystemGrantedPer_007, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_AddSystemGrantedPer_007, TestSize.Level4) { vector permList; permList.push_back(TEST_PERMISSION_NAME_BETA); @@ -664,7 +672,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddSystemG * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddSystemGrantedPer_008, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_AddSystemGrantedPer_008, TestSize.Level4) { vector permList; permList.push_back(TEST_PERMISSION_NAME_BETA); @@ -682,7 +690,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddSystemG * @tc.type FUNC * @tc.level Level0 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveUserGrantedPer_001, TestSize.Level0) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_RemoveUserGrantedPer_001, TestSize.Level0) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -718,7 +726,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveUser * @tc.type FUNC * @tc.level Level1 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveUserGrantedPer_002, TestSize.Level1) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_RemoveUserGrantedPer_002, TestSize.Level1) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -754,7 +762,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveUser * @tc.type FUNC * @tc.level Level3 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveUserGrantedPer_003, TestSize.Level3) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_RemoveUserGrantedPer_003, TestSize.Level3) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -784,7 +792,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveUser * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveUserGrantedPer_004, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_RemoveUserGrantedPer_004, TestSize.Level4) { int ret = PermissionKit::RemoveUserGrantedReqPermissions(BUNDLE_NAME_NOT_EXIST, TEST_USER_ID); ASSERT_EQ(RET_SUCCESS, ret); @@ -800,7 +808,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveUser * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveUserGrantedPer_005, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_RemoveUserGrantedPer_005, TestSize.Level4) { int ret = PermissionKit::RemoveUserGrantedReqPermissions(TEST_BUNDLE_NAME, USER_ID_NOT_EXIST); ASSERT_EQ(RET_SUCCESS, ret); @@ -816,7 +824,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveUser * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveUserGrantedPer_006, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_RemoveUserGrantedPer_006, TestSize.Level4) { int ret = PermissionKit::RemoveUserGrantedReqPermissions("", TEST_USER_ID); ASSERT_EQ(RET_SUCCESS, ret); @@ -832,7 +840,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveUser * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveUserGrantedPer_008, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_RemoveUserGrantedPer_008, TestSize.Level4) { int ret = PermissionKit::RemoveUserGrantedReqPermissions(ABNORMAL_BUNDLE_NAME, TEST_USER_ID); ASSERT_EQ(RET_SUCCESS, ret); @@ -848,7 +856,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveUser * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveUserGrantedPer_009, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_RemoveUserGrantedPer_009, TestSize.Level4) { int ret = PermissionKit::RemoveUserGrantedReqPermissions(LONG_BUNDLE_NAME, TEST_USER_ID); ASSERT_EQ(RET_SUCCESS, ret); @@ -864,7 +872,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveUser * @tc.type FUNC * @tc.level Level0 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveSystemGrantedPer_001, TestSize.Level0) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_RemoveSystemGrantedPer_001, TestSize.Level0) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -892,7 +900,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveSyst * @tc.type FUNC * @tc.level Level3 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveSystemGrantedPer_002, TestSize.Level3) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_RemoveSystemGrantedPer_002, TestSize.Level3) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -920,7 +928,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveSyst * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveSystemGrantedPer_003, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_RemoveSystemGrantedPer_003, TestSize.Level4) { int ret = PermissionKit::RemoveSystemGrantedReqPermissions(BUNDLE_NAME_NOT_EXIST); ASSERT_EQ(RET_SUCCESS, ret); @@ -936,7 +944,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveSyst * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveSystemGrantedPer_004, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_RemoveSystemGrantedPer_004, TestSize.Level4) { int ret = PermissionKit::RemoveSystemGrantedReqPermissions(""); ASSERT_EQ(RET_SUCCESS, ret); @@ -952,7 +960,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveSyst * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveSystemGrantedPer_005, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_RemoveSystemGrantedPer_005, TestSize.Level4) { int ret = PermissionKit::RemoveSystemGrantedReqPermissions(ABNORMAL_BUNDLE_NAME); ASSERT_EQ(RET_SUCCESS, ret); @@ -968,7 +976,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveSyst * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveSystemGrantedPer_006, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_RemoveSystemGrantedPer_006, TestSize.Level4) { int ret = PermissionKit::RemoveSystemGrantedReqPermissions(LONG_BUNDLE_NAME); ASSERT_EQ(RET_SUCCESS, ret); @@ -984,7 +992,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveSyst * @tc.type FUNC * @tc.level Level0 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantUserGrantedPer_001, TestSize.Level0) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_GrantUserGrantedPer_001, TestSize.Level0) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -1008,7 +1016,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantUserG * @tc.type FUNC * @tc.level Level1 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantUserGrantedPer_002, TestSize.Level1) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_GrantUserGrantedPer_002, TestSize.Level1) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -1032,7 +1040,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantUserG * @tc.type FUNC * @tc.level Level3 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantUserGrantedPer_005, TestSize.Level3) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_GrantUserGrantedPer_005, TestSize.Level3) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -1060,7 +1068,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantUserG * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantUserGrantedPer_006, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_GrantUserGrantedPer_006, TestSize.Level4) { int ret = PermissionKit::GrantUserGrantedPermission(TEST_BUNDLE_NAME, TEST_PERMISSION_NAME_ALPHA, TEST_INVALID_USER_ID); ASSERT_EQ(RET_SUCCESS, ret); @@ -1078,7 +1086,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantUserG * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantUserGrantedPer_007, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_GrantUserGrantedPer_007, TestSize.Level4) { int ret = PermissionKit::GrantUserGrantedPermission("", TEST_PERMISSION_NAME_ALPHA, TEST_USER_ID); ASSERT_EQ(RET_SUCCESS, ret); @@ -1094,7 +1102,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantUserG * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantUserGrantedPer_008, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_GrantUserGrantedPer_008, TestSize.Level4) { int ret = PermissionKit::GrantUserGrantedPermission(TEST_BUNDLE_NAME, "", TEST_USER_ID); ASSERT_EQ(RET_SUCCESS, ret); @@ -1110,7 +1118,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantUserG * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantUserGrantedPer_010, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_GrantUserGrantedPer_010, TestSize.Level4) { int ret = PermissionKit::GrantUserGrantedPermission(ABNORMAL_BUNDLE_NAME, TEST_PERMISSION_NAME_ALPHA, TEST_SUB_USER_ID); ASSERT_EQ(RET_SUCCESS, ret); @@ -1126,7 +1134,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantUserG * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantUserGrantedPer_011, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_GrantUserGrantedPer_011, TestSize.Level4) { int ret = PermissionKit::GrantUserGrantedPermission(LONG_BUNDLE_NAME, TEST_PERMISSION_NAME_ALPHA, TEST_SUB_USER_ID); ASSERT_EQ(RET_SUCCESS, ret); @@ -1142,7 +1150,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantUserG * @tc.type FUNC * @tc.level Level3 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantUserGrantedPer_012, TestSize.Level3) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_GrantUserGrantedPer_012, TestSize.Level3) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -1166,7 +1174,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantUserG * @tc.type FUNC * @tc.level Level0 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantSystemGrantedPer_001, TestSize.Level0) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_GrantSystemGrantedPer_001, TestSize.Level0) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -1190,7 +1198,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantSyste * @tc.type FUNC * @tc.level Level3 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantSystemGrantedPer_004, TestSize.Level3) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_GrantSystemGrantedPer_004, TestSize.Level3) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -1216,7 +1224,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantSyste * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantSystemGrantedPer_005, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_GrantSystemGrantedPer_005, TestSize.Level4) { int ret = PermissionKit::GrantSystemGrantedPermission("", TEST_PERMISSION_NAME_BETA); ASSERT_EQ(RET_SUCCESS, ret); @@ -1232,7 +1240,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantSyste * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantSystemGrantedPer_006, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_GrantSystemGrantedPer_006, TestSize.Level4) { int ret = PermissionKit::GrantSystemGrantedPermission(TEST_BUNDLE_NAME, ""); ASSERT_EQ(RET_SUCCESS, ret); @@ -1248,7 +1256,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantSyste * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantSystemGrantedPer_007, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_GrantSystemGrantedPer_007, TestSize.Level4) { int ret = PermissionKit::GrantSystemGrantedPermission(ABNORMAL_BUNDLE_NAME, TEST_PERMISSION_NAME_BETA); ASSERT_EQ(RET_SUCCESS, ret); @@ -1264,7 +1272,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantSyste * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantSystemGrantedPer_008, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_GrantSystemGrantedPer_008, TestSize.Level4) { int ret = PermissionKit::GrantSystemGrantedPermission(LONG_BUNDLE_NAME, TEST_PERMISSION_NAME_BETA); ASSERT_EQ(RET_SUCCESS, ret); @@ -1280,7 +1288,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantSyste * @tc.type FUNC * @tc.level Level0 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeUserGrantedPer_001, TestSize.Level0) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_RevokeUserGrantedPer_001, TestSize.Level0) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -1316,7 +1324,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeUser * @tc.type FUNC * @tc.level Level0 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeUserGrantedPer_002, TestSize.Level0) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_RevokeUserGrantedPer_002, TestSize.Level0) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -1352,7 +1360,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeUser * @tc.type FUNC * @tc.level Level1 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeUserGrantedPer_003, TestSize.Level1) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_RevokeUserGrantedPer_003, TestSize.Level1) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -1380,7 +1388,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeUser * @tc.type FUNC * @tc.level Level3 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeUserGrantedPer_004, TestSize.Level3) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_RevokeUserGrantedPer_004, TestSize.Level3) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -1412,7 +1420,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeUser * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeUserGrantedPer_005, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_RevokeUserGrantedPer_005, TestSize.Level4) { int ret = PermissionKit::RevokeUserGrantedPermission(BUNDLE_NAME_NOT_EXIST, TEST_PERMISSION_NAME_ALPHA, TEST_USER_ID); ASSERT_EQ(RET_SUCCESS, ret); @@ -1428,7 +1436,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeUser * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeUserGrantedPer_006, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_RevokeUserGrantedPer_006, TestSize.Level4) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -1446,7 +1454,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeUser * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeUserGrantedPer_007, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_RevokeUserGrantedPer_007, TestSize.Level4) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -1464,7 +1472,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeUser * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeUserGrantedPer_008, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_RevokeUserGrantedPer_008, TestSize.Level4) { int ret = PermissionKit::RevokeUserGrantedPermission("", TEST_PERMISSION_NAME_ALPHA, TEST_USER_ID); ASSERT_EQ(RET_SUCCESS, ret); @@ -1480,7 +1488,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeUser * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeUserGrantedPer_009, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_RevokeUserGrantedPer_009, TestSize.Level4) { int ret = PermissionKit::RevokeUserGrantedPermission(TEST_BUNDLE_NAME, "", TEST_USER_ID); ASSERT_EQ(RET_SUCCESS, ret); @@ -1496,7 +1504,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeUser * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeUserGrantedPer_011, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_RevokeUserGrantedPer_011, TestSize.Level4) { int ret = PermissionKit::RevokeUserGrantedPermission(ABNORMAL_BUNDLE_NAME, TEST_PERMISSION_NAME_ALPHA, TEST_USER_ID); ASSERT_EQ(RET_SUCCESS, ret); @@ -1512,7 +1520,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeUser * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeUserGrantedPer_012, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_RevokeUserGrantedPer_012, TestSize.Level4) { int ret = PermissionKit::RevokeUserGrantedPermission(LONG_BUNDLE_NAME, TEST_PERMISSION_NAME_ALPHA, TEST_USER_ID); ASSERT_EQ(RET_SUCCESS, ret); @@ -1528,7 +1536,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeUser * @tc.type FUNC * @tc.level Level0 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeSystemGrantedPer_001, TestSize.Level0) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_RevokeSystemGrantedPer_001, TestSize.Level0) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -1556,7 +1564,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeSyst * @tc.type FUNC * @tc.level Level0 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeSystemGrantedPer_002, TestSize.Level0) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_RevokeSystemGrantedPer_002, TestSize.Level0) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -1584,7 +1592,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeSyst * @tc.type FUNC * @tc.level Level0 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeSystemGrantedPer_003, TestSize.Level0) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_RevokeSystemGrantedPer_003, TestSize.Level0) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -1616,7 +1624,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeSyst * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeSystemGrantedPer_004, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_RevokeSystemGrantedPer_004, TestSize.Level4) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -1634,7 +1642,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeSyst * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeSystemGrantedPer_005, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_RevokeSystemGrantedPer_005, TestSize.Level4) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -1652,7 +1660,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeSyst * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeSystemGrantedPer_006, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_RevokeSystemGrantedPer_006, TestSize.Level4) { int ret = PermissionKit::RevokeSystemGrantedPermission("", TEST_PERMISSION_NAME_BETA); ASSERT_EQ(RET_SUCCESS, ret); @@ -1668,7 +1676,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeSyst * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeSystemGrantedPer_007, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_RevokeSystemGrantedPer_007, TestSize.Level4) { int ret = PermissionKit::RevokeSystemGrantedPermission(TEST_BUNDLE_NAME, ""); ASSERT_EQ(RET_SUCCESS, ret); @@ -1684,7 +1692,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeSyst * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeSystemGrantedPer_008, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_RevokeSystemGrantedPer_008, TestSize.Level4) { int ret = PermissionKit::RevokeSystemGrantedPermission(ABNORMAL_BUNDLE_NAME, TEST_PERMISSION_NAME_BETA); ASSERT_EQ(RET_SUCCESS, ret); @@ -1700,7 +1708,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeSyst * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeSystemGrantedPer_009, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_RevokeSystemGrantedPer_009, TestSize.Level4) { int ret = PermissionKit::RevokeSystemGrantedPermission(LONG_BUNDLE_NAME, TEST_PERMISSION_NAME_BETA); ASSERT_EQ(RET_SUCCESS, ret); @@ -1716,7 +1724,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeSyst * @tc.type FUNC * @tc.level Level0 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_CanRequestPer_001, TestSize.Level0) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_CanRequestPer_001, TestSize.Level0) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -1738,7 +1746,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_CanRequest * @tc.type FUNC * @tc.level Level0 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_CanRequestPer_002, TestSize.Level0) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_CanRequestPer_002, TestSize.Level0) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -1760,7 +1768,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_CanRequest * @tc.type FUNC * @tc.level Level0 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_CanRequestPer_003, TestSize.Level0) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_CanRequestPer_003, TestSize.Level0) { int ret = PermissionKit::RemoveDefPermissions(TEST_BUNDLE_NAME); ASSERT_EQ(RET_SUCCESS, ret); @@ -1788,7 +1796,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_CanRequest * @tc.type FUNC * @tc.level Level1 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_CanRequestPer_004, TestSize.Level1) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_CanRequestPer_004, TestSize.Level1) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -1818,7 +1826,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_CanRequest * @tc.type FUNC * @tc.level Level1 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_CanRequestPer_005, TestSize.Level1) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_CanRequestPer_005, TestSize.Level1) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -1850,7 +1858,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_CanRequest * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_CanRequestPer_009, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_CanRequestPer_009, TestSize.Level4) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -1870,7 +1878,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_CanRequest * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_CanRequestPer_008, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_CanRequestPer_008, TestSize.Level4) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -1892,7 +1900,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_CanRequest * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_CanRequestPer_010, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_CanRequestPer_010, TestSize.Level4) { bool isCanRequest = PermissionKit::CanRequestPermission("", TEST_PERMISSION_NAME_BETA, TEST_USER_ID); ASSERT_FALSE(isCanRequest); @@ -1908,7 +1916,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_CanRequest * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_CanRequestPer_011, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_CanRequestPer_011, TestSize.Level4) { bool isCanRequest = PermissionKit::CanRequestPermission(TEST_BUNDLE_NAME, "", TEST_USER_ID); ASSERT_FALSE(isCanRequest); @@ -1924,7 +1932,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_CanRequest * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_CanRequestPer_013, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_CanRequestPer_013, TestSize.Level4) { bool isCanRequest = PermissionKit::CanRequestPermission(ABNORMAL_BUNDLE_NAME, TEST_PERMISSION_NAME_BETA, TEST_USER_ID); ASSERT_FALSE(isCanRequest); @@ -1940,7 +1948,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_CanRequest * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_CanRequestPer_014, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_CanRequestPer_014, TestSize.Level4) { bool isCanRequest = PermissionKit::CanRequestPermission(LONG_BUNDLE_NAME, TEST_PERMISSION_NAME_BETA, TEST_USER_ID); ASSERT_FALSE(isCanRequest); @@ -1956,7 +1964,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_CanRequest * @tc.type FUNC * @tc.level Level0 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_VerifyPer_001, TestSize.Level0) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_VerifyPer_001, TestSize.Level0) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -1982,7 +1990,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_VerifyPer_ * @tc.type FUNC * @tc.level Level1 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_VerifyPer_002, TestSize.Level1) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_VerifyPer_002, TestSize.Level1) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -2010,7 +2018,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_VerifyPer_ * @tc.type FUNC * @tc.level Level1 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_VerifyPer_003, TestSize.Level1) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_VerifyPer_003, TestSize.Level1) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -2038,7 +2046,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_VerifyPer_ * @tc.type FUNC * @tc.level Level1 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_VerifyPer_004, TestSize.Level1) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_VerifyPer_004, TestSize.Level1) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -2070,7 +2078,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_VerifyPer_ * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_VerifyPer_005, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_VerifyPer_005, TestSize.Level4) { int ret = PermissionKit::VerifyPermission(BUNDLE_NAME_NOT_EXIST, TEST_PERMISSION_NAME_ALPHA, TEST_USER_ID); ASSERT_EQ(PERMISSION_NOT_GRANTED, ret); @@ -2086,7 +2094,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_VerifyPer_ * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_VerifyPer_006, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_VerifyPer_006, TestSize.Level4) { int ret = PermissionKit::VerifyPermission(TEST_BUNDLE_NAME, PERMISSION_NAME_NOT_EXIST, TEST_USER_ID); ASSERT_EQ(PERMISSION_NOT_GRANTED, ret); @@ -2102,7 +2110,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_VerifyPer_ * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_VerifyPer_007, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_VerifyPer_007, TestSize.Level4) { int ret = PermissionKit::VerifyPermission(TEST_BUNDLE_NAME, TEST_PERMISSION_NAME_ALPHA, USER_ID_NOT_EXIST); ASSERT_EQ(PERMISSION_NOT_GRANTED, ret); @@ -2118,7 +2126,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_VerifyPer_ * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_VerifyPer_008, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_VerifyPer_008, TestSize.Level4) { int ret = PermissionKit::VerifyPermission("", TEST_PERMISSION_NAME_ALPHA, TEST_USER_ID); ASSERT_EQ(PERMISSION_NOT_GRANTED, ret); @@ -2134,7 +2142,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_VerifyPer_ * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_VerifyPer_009, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_VerifyPer_009, TestSize.Level4) { int ret = PermissionKit::VerifyPermission(TEST_BUNDLE_NAME, "", TEST_USER_ID); ASSERT_EQ(PERMISSION_NOT_GRANTED, ret); @@ -2150,7 +2158,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_VerifyPer_ * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_VerifyPer_011, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_VerifyPer_011, TestSize.Level4) { int ret = PermissionKit::VerifyPermission(ABNORMAL_BUNDLE_NAME, TEST_PERMISSION_NAME_ALPHA, TEST_USER_ID); ASSERT_EQ(PERMISSION_NOT_GRANTED, ret); @@ -2166,7 +2174,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_VerifyPer_ * @tc.type FUNC * @tc.level Level4 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_VerifyPer_012, TestSize.Level4) +HWTEST_F(PermissionKitFunctionTest, Security_AppSecurity_PermissionManager_L2_VerifyPer_012, TestSize.Level4) { int ret = PermissionKit::VerifyPermission(LONG_BUNDLE_NAME, TEST_PERMISSION_NAME_ALPHA, TEST_USER_ID); ASSERT_EQ(PERMISSION_NOT_GRANTED, ret); diff --git a/security/permission/permissionkitcpp/src/PermissionKitPerformanceCPPTest.cpp b/security/permission/permissionkitcpp/src/PermissionKitPerformanceCPPTest.cpp index 22b0d5cceb88a71496791638b27576dc01ed05d7..269a694259dd926550580c03c9f5a974e5591df9 100644 --- a/security/permission/permissionkitcpp/src/PermissionKitPerformanceCPPTest.cpp +++ b/security/permission/permissionkitcpp/src/PermissionKitPerformanceCPPTest.cpp @@ -23,6 +23,7 @@ using namespace testing::ext; using namespace OHOS::Security::Permission; const int TIME_MILLIS = 1000; +const int RUNNING_TIMES = 10000; static vector permDefNormal; static vector permDefAbnormal1; static vector permDefAbnormal2; @@ -32,6 +33,14 @@ PermissionDef permissionDefBeta; PermissionDef permissionDefAbnormal1; PermissionDef permissionDefAbnormal2; +class PermissionKitPerformanceTest : public testing::Test { +public: + static void SetUpTestCase(); + static void TearDownTestCase(); + void SetUp(); + void TearDown(); +}; + void initPermissionDef() { permissionDefAlpha = { @@ -77,7 +86,7 @@ void initPermissionDef() }; } -void PermissionKitTest::SetUpTestCase() +void PermissionKitPerformanceTest::SetUpTestCase() { vector permDefList1; vector permDefList2; @@ -122,7 +131,7 @@ void PermissionKitTest::SetUpTestCase() } } -void PermissionKitTest::TearDownTestCase() +void PermissionKitPerformanceTest::TearDownTestCase() { PermissionKit::RemoveDefPermissions(TEST_BUNDLE_NAME); PermissionKit::RemoveDefPermissions(ABNORMAL_BUNDLE_NAME); @@ -139,7 +148,7 @@ void PermissionKitTest::TearDownTestCase() } } -void PermissionKitTest::SetUp() +void PermissionKitPerformanceTest::SetUp() { PermissionKit::RemoveDefPermissions(TEST_BUNDLE_NAME); PermissionKit::RemoveDefPermissions(ABNORMAL_BUNDLE_NAME); @@ -152,7 +161,7 @@ void PermissionKitTest::SetUp() PermissionKit::RevokeSystemGrantedPermission(TEST_BUNDLE_NAME, TEST_PERMISSION_NAME_BETA); } -void PermissionKitTest::TearDown() +void PermissionKitPerformanceTest::TearDown() { PermissionKit::RemoveDefPermissions(TEST_BUNDLE_NAME); PermissionKit::RemoveDefPermissions(ABNORMAL_BUNDLE_NAME); @@ -182,10 +191,10 @@ long GetCurrentTimeMillis() * @tc.type FUNC * @tc.level Level3 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddDefPer_009, TestSize.Level3) +HWTEST_F(PermissionKitPerformanceTest, Security_AppSecurity_PermissionManager_L2_AddDefPer_009, TestSize.Level3) { long timeAll = 0; - for (int i = 0; i < 10000; i++){ + for (int i = 0; i < RUNNING_TIMES; i++){ long startTime = GetCurrentTimeMillis(); int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -194,8 +203,8 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddDefPer_ ret = PermissionKit::RemoveDefPermissions(TEST_BUNDLE_NAME); ASSERT_EQ(RET_SUCCESS, ret); } - std::cout<<"Performance of AddDefPermissions interface is::"< permList; permList.push_back(TEST_PERMISSION_NAME_ALPHA); long timeAll = 0; - for (int i = 0; i < 10000; i++){ + for (int i = 0; i < RUNNING_TIMES; i++){ long startTime = GetCurrentTimeMillis(); ret = PermissionKit::AddUserGrantedReqPermissions(TEST_BUNDLE_NAME, permList, TEST_USER_ID); ASSERT_EQ(RET_SUCCESS, ret); @@ -275,8 +284,8 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddUserGra ret = PermissionKit::RemoveUserGrantedReqPermissions(TEST_BUNDLE_NAME, TEST_USER_ID); ASSERT_EQ(RET_SUCCESS, ret); } - std::cout<<"Performance of AddUserGrantedReqPermissions interface is::"< permList; permList.push_back(TEST_PERMISSION_NAME_ALPHA); long timeAll = 0; - for (int i = 0; i < 10000; i++){ + for (int i = 0; i < RUNNING_TIMES; i++){ long startTime = GetCurrentTimeMillis(); ret = PermissionKit::AddSystemGrantedReqPermissions(TEST_BUNDLE_NAME, permList); ASSERT_EQ(RET_SUCCESS, ret); @@ -305,8 +314,8 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddSystemG ret = PermissionKit::RemoveSystemGrantedReqPermissions(TEST_BUNDLE_NAME); ASSERT_EQ(RET_SUCCESS, ret); } - std::cout<<"Performance of AddSystemGrantedReqPermissions interface is::"< permList; permList.push_back(TEST_PERMISSION_NAME_ALPHA); long timeAll = 0; - for (int i = 0; i < 10000; i++){ + for (int i = 0; i < RUNNING_TIMES; i++){ ret = PermissionKit::AddUserGrantedReqPermissions(TEST_BUNDLE_NAME, permList, TEST_USER_ID); ASSERT_EQ(RET_SUCCESS, ret); long startTime = GetCurrentTimeMillis(); @@ -335,8 +344,8 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveUser timeAll = timeAll + timeCost; ASSERT_EQ(RET_SUCCESS, ret); } - std::cout<<"Performance of RemoveUserGrantedReqPermissions interface is::"< permList; permList.push_back(TEST_PERMISSION_NAME_BETA); long timeAll = 0; - for (int i = 0; i < 10000; i++){ + for (int i = 0; i < RUNNING_TIMES; i++){ ret = PermissionKit::AddSystemGrantedReqPermissions(TEST_BUNDLE_NAME, permList); ASSERT_EQ(RET_SUCCESS, ret); long startTime = GetCurrentTimeMillis(); @@ -365,8 +374,8 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveSyst long timeCost = GetCurrentTimeMillis() - startTime; timeAll = timeAll + timeCost; } - std::cout<<"Performance of RemoveSystemGrantedReqPermissions interface is::"< permDefNormal; static vector permDefAbnormal1; static vector permDefAbnormal2; -void PermissionKitTest::SetUpTestCase() +class PermissionKitReliabilityTest : public testing::Test { +public: + static void SetUpTestCase(); + static void TearDownTestCase(); + void SetUp(); + void TearDown(); +}; + +void PermissionKitReliabilityTest::SetUpTestCase() { vector permDefList1; vector permDefList2; @@ -80,10 +89,10 @@ void PermissionKitTest::SetUpTestCase() permDefAbnormal2 = permDefList3; } -void PermissionKitTest::TearDownTestCase() +void PermissionKitReliabilityTest::TearDownTestCase() {} -void PermissionKitTest::SetUp() +void PermissionKitReliabilityTest::SetUp() { PermissionKit::RemoveDefPermissions(TEST_BUNDLE_NAME); PermissionKit::RemoveDefPermissions(ABNORMAL_BUNDLE_NAME); @@ -96,7 +105,7 @@ void PermissionKitTest::SetUp() PermissionKit::RevokeSystemGrantedPermission(TEST_BUNDLE_NAME, TEST_PERMISSION_NAME_BETA); } -void PermissionKitTest::TearDown() +void PermissionKitReliabilityTest::TearDown() { PermissionKit::RemoveDefPermissions(TEST_BUNDLE_NAME); PermissionKit::RemoveDefPermissions(ABNORMAL_BUNDLE_NAME); @@ -119,9 +128,9 @@ void PermissionKitTest::TearDown() * @tc.type FUNC * @tc.level Level3 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddDefPer_008, TestSize.Level3) +HWTEST_F(PermissionKitReliabilityTest, Security_AppSecurity_PermissionManager_L2_AddDefPer_008, TestSize.Level3) { - for (int i = 0; i < 5000; i++){ + for (int i = 0; i < RUNNING_TIMES; i++){ int ret = PermissionKit::RemoveDefPermissions(TEST_BUNDLE_NAME); ASSERT_EQ(RET_SUCCESS, ret); ret = PermissionKit::AddDefPermissions(permDefNormal); @@ -139,9 +148,9 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddDefPer_ * @tc.type FUNC * @tc.level Level3 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveDefPer_007, TestSize.Level3) +HWTEST_F(PermissionKitReliabilityTest, Security_AppSecurity_PermissionManager_L2_RemoveDefPer_007, TestSize.Level3) { - for (int i = 0; i < 5000; i++){ + for (int i = 0; i < RUNNING_TIMES; i++){ int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); ret = PermissionKit::RemoveDefPermissions(TEST_BUNDLE_NAME); @@ -159,12 +168,12 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveDefP * @tc.type FUNC * @tc.level Level3 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GetDefPer_005, TestSize.Level3) +HWTEST_F(PermissionKitReliabilityTest, Security_AppSecurity_PermissionManager_L2_GetDefPer_005, TestSize.Level3) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); PermissionDef permissionDefResultAlpha; - for (int i = 0; i < 5000; i++) { + for (int i = 0; i < RUNNING_TIMES; i++) { ret = PermissionKit::GetDefPermission(TEST_PERMISSION_NAME_ALPHA, permissionDefResultAlpha); ASSERT_EQ(RET_SUCCESS, ret); } @@ -180,13 +189,13 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GetDefPer_ * @tc.type FUNC * @tc.level Level3 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddUserGrantedPer_013, TestSize.Level3) +HWTEST_F(PermissionKitReliabilityTest, Security_AppSecurity_PermissionManager_L2_AddUserGrantedPer_013, TestSize.Level3) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); vector permList; permList.push_back(TEST_PERMISSION_NAME_ALPHA); - for (int i = 0; i < 5000; i++){ + for (int i = 0; i < RUNNING_TIMES; i++){ ret = PermissionKit::AddUserGrantedReqPermissions(TEST_BUNDLE_NAME, permList, TEST_USER_ID); ASSERT_EQ(RET_SUCCESS, ret); ret = PermissionKit::RemoveUserGrantedReqPermissions(TEST_BUNDLE_NAME, TEST_USER_ID); @@ -204,13 +213,13 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddUserGra * @tc.type FUNC * @tc.level Level3 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddSystemGrantedPer_010, TestSize.Level3) +HWTEST_F(PermissionKitReliabilityTest, Security_AppSecurity_PermissionManager_L2_AddSystemGrantedPer_010, TestSize.Level3) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); vector permList; permList.push_back(TEST_PERMISSION_NAME_ALPHA); - for (int i = 0; i < 5000; i++){ + for (int i = 0; i < RUNNING_TIMES; i++){ ret = PermissionKit::AddSystemGrantedReqPermissions(TEST_BUNDLE_NAME, permList); ASSERT_EQ(RET_SUCCESS, ret); ret = PermissionKit::RemoveSystemGrantedReqPermissions(TEST_BUNDLE_NAME); @@ -228,13 +237,13 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddSystemG * @tc.type FUNC * @tc.level Level3 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveUserGrantedPer_011, TestSize.Level3) +HWTEST_F(PermissionKitReliabilityTest, Security_AppSecurity_PermissionManager_L2_RemoveUserGrantedPer_011, TestSize.Level3) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); vector permList; permList.push_back(TEST_PERMISSION_NAME_ALPHA); - for (int i = 0; i < 10000; i++){ + for (int i = 0; i < RUNNING_TIMES; i++){ ret = PermissionKit::AddUserGrantedReqPermissions(TEST_BUNDLE_NAME, permList, TEST_USER_ID); ASSERT_EQ(RET_SUCCESS, ret); ret = PermissionKit::RemoveUserGrantedReqPermissions(TEST_BUNDLE_NAME, TEST_USER_ID); @@ -252,13 +261,13 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveUser * @tc.type FUNC * @tc.level Level3 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveSystemGrantedPer_008, TestSize.Level3) +HWTEST_F(PermissionKitReliabilityTest, Security_AppSecurity_PermissionManager_L2_RemoveSystemGrantedPer_008, TestSize.Level3) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); vector permList; permList.push_back(TEST_PERMISSION_NAME_BETA); - for (int i = 0; i < 5000; i++){ + for (int i = 0; i < RUNNING_TIMES; i++){ ret = PermissionKit::AddSystemGrantedReqPermissions(TEST_BUNDLE_NAME, permList); ASSERT_EQ(RET_SUCCESS, ret); ret = PermissionKit::RemoveSystemGrantedReqPermissions(TEST_BUNDLE_NAME); @@ -276,7 +285,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveSyst * @tc.type FUNC * @tc.level Level3 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantUserGrantedPer_013, TestSize.Level3) +HWTEST_F(PermissionKitReliabilityTest, Security_AppSecurity_PermissionManager_L2_GrantUserGrantedPer_013, TestSize.Level3) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -284,7 +293,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantUserG permList.push_back(TEST_PERMISSION_NAME_ALPHA); ret = PermissionKit::AddUserGrantedReqPermissions(TEST_BUNDLE_NAME, permList, TEST_USER_ID); ASSERT_EQ(RET_SUCCESS, ret); - for (int i = 0; i < 5000; i++){ + for (int i = 0; i < RUNNING_TIMES; i++){ ret = PermissionKit::GrantUserGrantedPermission(TEST_BUNDLE_NAME, TEST_PERMISSION_NAME_ALPHA, TEST_USER_ID); ASSERT_EQ(RET_SUCCESS, ret); ret = PermissionKit::VerifyPermission(TEST_BUNDLE_NAME, TEST_PERMISSION_NAME_ALPHA, TEST_USER_ID); @@ -306,7 +315,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantUserG * @tc.type FUNC * @tc.level Level3 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantSystemGrantedPer_010, TestSize.Level3) +HWTEST_F(PermissionKitReliabilityTest, Security_AppSecurity_PermissionManager_L2_GrantSystemGrantedPer_010, TestSize.Level3) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -314,7 +323,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantSyste permList.push_back(TEST_PERMISSION_NAME_BETA); ret = PermissionKit::AddSystemGrantedReqPermissions(TEST_BUNDLE_NAME, permList); ASSERT_EQ(RET_SUCCESS, ret); - for (int i = 0; i < 5000; i++){ + for (int i = 0; i < RUNNING_TIMES; i++){ ret = PermissionKit::GrantSystemGrantedPermission(TEST_BUNDLE_NAME, TEST_PERMISSION_NAME_BETA); ASSERT_EQ(RET_SUCCESS, ret); ret = PermissionKit::VerifyPermission(TEST_BUNDLE_NAME, TEST_PERMISSION_NAME_BETA, TEST_USER_ID); @@ -336,7 +345,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantSyste * @tc.type FUNC * @tc.level Level3 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeUserGrantedPer_014, TestSize.Level3) +HWTEST_F(PermissionKitReliabilityTest, Security_AppSecurity_PermissionManager_L2_RevokeUserGrantedPer_014, TestSize.Level3) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -344,7 +353,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeUser permList.push_back(TEST_PERMISSION_NAME_ALPHA); ret = PermissionKit::AddUserGrantedReqPermissions(TEST_BUNDLE_NAME, permList, TEST_USER_ID); ASSERT_EQ(RET_SUCCESS, ret); - for (int i = 0; i < 10000; i++){ + for (int i = 0; i < RUNNING_TIMES; i++){ ret = PermissionKit::GrantUserGrantedPermission(TEST_BUNDLE_NAME, TEST_PERMISSION_NAME_ALPHA, TEST_USER_ID); ASSERT_EQ(RET_SUCCESS, ret); ret = PermissionKit::VerifyPermission(TEST_BUNDLE_NAME, TEST_PERMISSION_NAME_ALPHA, TEST_USER_ID); @@ -366,7 +375,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeUser * @tc.type FUNC * @tc.level Level3 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeSystemGrantedPer_011, TestSize.Level3) +HWTEST_F(PermissionKitReliabilityTest, Security_AppSecurity_PermissionManager_L2_RevokeSystemGrantedPer_011, TestSize.Level3) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -374,7 +383,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeSyst permList.push_back(TEST_PERMISSION_NAME_BETA); ret = PermissionKit::AddSystemGrantedReqPermissions(TEST_BUNDLE_NAME, permList); ASSERT_EQ(RET_SUCCESS, ret); - for (int i = 0; i < 10000; i++){ + for (int i = 0; i < RUNNING_TIMES; i++){ ret = PermissionKit::GrantSystemGrantedPermission(TEST_BUNDLE_NAME, TEST_PERMISSION_NAME_BETA); ASSERT_EQ(RET_SUCCESS, ret); ret = PermissionKit::VerifyPermission(TEST_BUNDLE_NAME, TEST_PERMISSION_NAME_BETA, TEST_USER_ID); @@ -396,7 +405,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeSyst * @tc.type FUNC * @tc.level Level3 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_CanRequestPer_016, TestSize.Level3) +HWTEST_F(PermissionKitReliabilityTest, Security_AppSecurity_PermissionManager_L2_CanRequestPer_016, TestSize.Level3) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -404,7 +413,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_CanRequest permList.push_back(TEST_PERMISSION_NAME_ALPHA); ret = PermissionKit::AddUserGrantedReqPermissions(TEST_BUNDLE_NAME, permList, TEST_USER_ID); ASSERT_EQ(RET_SUCCESS, ret); - for (int i = 0; i < 5000; i++){ + for (int i = 0; i < RUNNING_TIMES; i++){ bool isCanRequest = PermissionKit::CanRequestPermission(TEST_BUNDLE_NAME, TEST_PERMISSION_NAME_ALPHA, TEST_USER_ID); ASSERT_TRUE(isCanRequest); } @@ -420,7 +429,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_CanRequest * @tc.type FUNC * @tc.level Level3 */ -HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_VerifyPer_014, TestSize.Level3) +HWTEST_F(PermissionKitReliabilityTest, Security_AppSecurity_PermissionManager_L2_VerifyPer_014, TestSize.Level3) { int ret = PermissionKit::AddDefPermissions(permDefNormal); ASSERT_EQ(RET_SUCCESS, ret); @@ -430,7 +439,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_VerifyPer_ ASSERT_EQ(RET_SUCCESS, ret); ret = PermissionKit::GrantSystemGrantedPermission(TEST_BUNDLE_NAME, TEST_PERMISSION_NAME_BETA); ASSERT_EQ(RET_SUCCESS, ret); - for (int i = 0; i < 10000; i++){ + for (int i = 0; i < RUNNING_TIMES; i++){ ret = PermissionKit::VerifyPermission(TEST_BUNDLE_NAME, TEST_PERMISSION_NAME_BETA, TEST_USER_ID); ASSERT_EQ(PERMISSION_GRANTED, ret); }