Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
f87d6095
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
f87d6095
编写于
11月 25, 2021
作者:
O
openharmony_ci
提交者:
Gitee
11月 25, 2021
浏览文件
操作
浏览文件
下载
差异文件
!1176 修改一个导致不能执行用例的问题
Merge pull request !1176 from 伞木希美/myfeature
上级
aebc5fd1
ae3997c2
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
239 addition
and
195 deletion
+239
-195
security/BUILD.gn
security/BUILD.gn
+1
-3
security/permission/permissionkitcpp/BUILD.gn
security/permission/permissionkitcpp/BUILD.gn
+22
-0
security/permission/permissionkitcpp/Test.json
security/permission/permissionkitcpp/Test.json
+1
-3
security/permission/permissionkitcpp/src/PermissionKitFunctionCPPTest.cpp
...ion/permissionkitcpp/src/PermissionKitFunctionCPPTest.cpp
+111
-103
security/permission/permissionkitcpp/src/PermissionKitPerformanceCPPTest.cpp
.../permissionkitcpp/src/PermissionKitPerformanceCPPTest.cpp
+65
-56
security/permission/permissionkitcpp/src/PermissionKitReliabilityCPPTest.cpp
.../permissionkitcpp/src/PermissionKitReliabilityCPPTest.cpp
+39
-30
未找到文件。
security/BUILD.gn
浏览文件 @
f87d6095
...
...
@@ -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 =
...
...
security/permission/permissionkitcpp/BUILD.gn
浏览文件 @
f87d6095
...
...
@@ -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",
]
}
security/permission/permissionkitcpp/Test.json
浏览文件 @
f87d6095
...
...
@@ -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"
:
[
...
...
security/permission/permissionkitcpp/src/PermissionKitFunctionCPPTest.cpp
浏览文件 @
f87d6095
...
...
@@ -24,7 +24,15 @@ static vector<PermissionDef> permDefNormal;
static
vector
<
PermissionDef
>
permDefAbnormal1
;
static
vector
<
PermissionDef
>
permDefAbnormal2
;
void
PermissionKitTest
::
SetUpTestCase
()
class
PermissionKitFunctionTest
:
public
testing
::
Test
{
public:
static
void
SetUpTestCase
();
static
void
TearDownTestCase
();
void
SetUp
();
void
TearDown
();
};
void
PermissionKitFunctionTest
::
SetUpTestCase
()
{
vector
<
PermissionDef
>
permDefList1
;
vector
<
PermissionDef
>
permDefList2
;
...
...
@@ -80,10 +88,10 @@ void PermissionKitTest::SetUpTestCase()
permDefAbnormal2
=
permDefList3
;
}
void
PermissionKitTest
::
TearDownTestCase
()
void
PermissionKit
Function
Test
::
TearDownTestCase
()
{}
void
PermissionKitTest
::
SetUp
()
void
PermissionKit
Function
Test
::
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
PermissionKit
Function
Test
::
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
Security_AppSecurity_PermissionManager_L2_AddUserGrantedPer_006
,
TestSize
.
Level4
)
{
vector
<
string
>
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
(
PermissionKit
Function
Test
,
Security_AppSecurity_PermissionManager_L2_AddUserGrantedPer_007
,
TestSize
.
Level4
)
{
vector
<
string
>
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
(
PermissionKit
Function
Test
,
Security_AppSecurity_PermissionManager_L2_AddUserGrantedPer_008
,
TestSize
.
Level4
)
{
vector
<
string
>
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
(
PermissionKit
Function
Test
,
Security_AppSecurity_PermissionManager_L2_AddUserGrantedPer_010
,
TestSize
.
Level4
)
{
vector
<
string
>
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
(
PermissionKit
Function
Test
,
Security_AppSecurity_PermissionManager_L2_AddUserGrantedPer_011
,
TestSize
.
Level4
)
{
vector
<
string
>
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
Security_AppSecurity_PermissionManager_L2_AddSystemGrantedPer_005
,
TestSize
.
Level4
)
{
vector
<
string
>
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
(
PermissionKit
Function
Test
,
Security_AppSecurity_PermissionManager_L2_AddSystemGrantedPer_006
,
TestSize
.
Level4
)
{
vector
<
string
>
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
(
PermissionKit
Function
Test
,
Security_AppSecurity_PermissionManager_L2_AddSystemGrantedPer_007
,
TestSize
.
Level4
)
{
vector
<
string
>
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
(
PermissionKit
Function
Test
,
Security_AppSecurity_PermissionManager_L2_AddSystemGrantedPer_008
,
TestSize
.
Level4
)
{
vector
<
string
>
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
(
PermissionKit
Function
Test
,
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
);
...
...
security/permission/permissionkitcpp/src/PermissionKitPerformanceCPPTest.cpp
浏览文件 @
f87d6095
...
...
@@ -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
<
PermissionDef
>
permDefNormal
;
static
vector
<
PermissionDef
>
permDefAbnormal1
;
static
vector
<
PermissionDef
>
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
PermissionKit
Performance
Test
::
SetUpTestCase
()
{
vector
<
PermissionDef
>
permDefList1
;
vector
<
PermissionDef
>
permDefList2
;
...
...
@@ -122,7 +131,7 @@ void PermissionKitTest::SetUpTestCase()
}
}
void
PermissionKitTest
::
TearDownTestCase
()
void
PermissionKit
Performance
Test
::
TearDownTestCase
()
{
PermissionKit
::
RemoveDefPermissions
(
TEST_BUNDLE_NAME
);
PermissionKit
::
RemoveDefPermissions
(
ABNORMAL_BUNDLE_NAME
);
...
...
@@ -139,7 +148,7 @@ void PermissionKitTest::TearDownTestCase()
}
}
void
PermissionKitTest
::
SetUp
()
void
PermissionKit
Performance
Test
::
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
PermissionKit
Performance
Test
::
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
(
PermissionKit
Performance
Test
,
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::"
<<
timeAll
/
10000
<<
"ms"
<<
std
::
endl
;
ASSERT_LT
(
timeAll
/
10000
,
5
);
std
::
cout
<<
"Performance of AddDefPermissions interface is::"
<<
timeAll
/
RUNNING_TIMES
<<
"ms"
<<
std
::
endl
;
ASSERT_LT
(
timeAll
/
RUNNING_TIMES
,
5
);
}
/**
...
...
@@ -208,10 +217,10 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddDefPer_
* @tc.type FUNC
* @tc.level Level3
*/
HWTEST_F
(
PermissionKitTest
,
Security_AppSecurity_PermissionManager_L2_RemoveDefPer_008
,
TestSize
.
Level3
)
HWTEST_F
(
PermissionKit
Performance
Test
,
Security_AppSecurity_PermissionManager_L2_RemoveDefPer_008
,
TestSize
.
Level3
)
{
long
timeAll
=
0
;
for
(
int
i
=
0
;
i
<
10000
;
i
++
){
for
(
int
i
=
0
;
i
<
RUNNING_TIMES
;
i
++
){
int
ret
=
PermissionKit
::
AddDefPermissions
(
permDefNormal
);
ASSERT_EQ
(
RET_SUCCESS
,
ret
);
long
startTime
=
GetCurrentTimeMillis
();
...
...
@@ -220,8 +229,8 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveDefP
long
timeCost
=
GetCurrentTimeMillis
()
-
startTime
;
timeAll
=
timeAll
+
timeCost
;
}
std
::
cout
<<
"Performance of RemoveDefPermissions interface is::"
<<
timeAll
/
10000
<<
"ms"
<<
std
::
endl
;
ASSERT_LT
(
timeAll
/
10000
,
5
);
std
::
cout
<<
"Performance of RemoveDefPermissions interface is::"
<<
timeAll
/
RUNNING_TIMES
<<
"ms"
<<
std
::
endl
;
ASSERT_LT
(
timeAll
/
RUNNING_TIMES
,
5
);
}
/**
...
...
@@ -234,19 +243,19 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveDefP
* @tc.type FUNC
* @tc.level Level3
*/
HWTEST_F
(
PermissionKitTest
,
Security_AppSecurity_PermissionManager_L2_GetDefPer_006
,
TestSize
.
Level3
)
HWTEST_F
(
PermissionKit
Performance
Test
,
Security_AppSecurity_PermissionManager_L2_GetDefPer_006
,
TestSize
.
Level3
)
{
int
ret
=
PermissionKit
::
AddDefPermissions
(
permDefNormal
);
ASSERT_EQ
(
RET_SUCCESS
,
ret
);
PermissionDef
permissionDefResultAlpha
;
long
startTime
=
GetCurrentTimeMillis
();
for
(
int
i
=
0
;
i
<
10000
;
i
++
)
{
for
(
int
i
=
0
;
i
<
RUNNING_TIMES
;
i
++
)
{
ret
=
PermissionKit
::
GetDefPermission
(
TEST_PERMISSION_NAME_ALPHA
,
permissionDefResultAlpha
);
ASSERT_EQ
(
RET_SUCCESS
,
ret
);
}
long
timeAll
=
GetCurrentTimeMillis
()
-
startTime
;
std
::
cout
<<
"Performance of GetDefPermission interface is::"
<<
timeAll
/
10000
<<
"ms"
<<
std
::
endl
;
ASSERT_LT
(
timeAll
/
10000
,
5
);
std
::
cout
<<
"Performance of GetDefPermission interface is::"
<<
timeAll
/
RUNNING_TIMES
<<
"ms"
<<
std
::
endl
;
ASSERT_LT
(
timeAll
/
RUNNING_TIMES
,
5
);
}
/**
...
...
@@ -259,14 +268,14 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GetDefPer_
* @tc.type FUNC
* @tc.level Level3
*/
HWTEST_F
(
PermissionKitTest
,
Security_AppSecurity_PermissionManager_L2_AddUserGrantedPer_014
,
TestSize
.
Level3
)
HWTEST_F
(
PermissionKit
Performance
Test
,
Security_AppSecurity_PermissionManager_L2_AddUserGrantedPer_014
,
TestSize
.
Level3
)
{
int
ret
=
PermissionKit
::
AddDefPermissions
(
permDefNormal
);
ASSERT_EQ
(
RET_SUCCESS
,
ret
);
vector
<
string
>
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::"
<<
timeAll
/
10000
<<
"ms"
<<
std
::
endl
;
ASSERT_LT
(
timeAll
/
10000
,
5
);
std
::
cout
<<
"Performance of AddUserGrantedReqPermissions interface is::"
<<
timeAll
/
RUNNING_TIMES
<<
"ms"
<<
std
::
endl
;
ASSERT_LT
(
timeAll
/
RUNNING_TIMES
,
5
);
}
/**
...
...
@@ -289,14 +298,14 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddUserGra
* @tc.type FUNC
* @tc.level Level3
*/
HWTEST_F
(
PermissionKitTest
,
Security_AppSecurity_PermissionManager_L2_AddSystemGrantedPer_011
,
TestSize
.
Level3
)
HWTEST_F
(
PermissionKit
Performance
Test
,
Security_AppSecurity_PermissionManager_L2_AddSystemGrantedPer_011
,
TestSize
.
Level3
)
{
int
ret
=
PermissionKit
::
AddDefPermissions
(
permDefNormal
);
ASSERT_EQ
(
RET_SUCCESS
,
ret
);
vector
<
string
>
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::"
<<
timeAll
/
10000
<<
"ms"
<<
std
::
endl
;
ASSERT_LT
(
timeAll
/
10000
,
5
);
std
::
cout
<<
"Performance of AddSystemGrantedReqPermissions interface is::"
<<
timeAll
/
RUNNING_TIMES
<<
"ms"
<<
std
::
endl
;
ASSERT_LT
(
timeAll
/
RUNNING_TIMES
,
5
);
}
/**
...
...
@@ -319,14 +328,14 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_AddSystemG
* @tc.type FUNC
* @tc.level Level3
*/
HWTEST_F
(
PermissionKitTest
,
Security_AppSecurity_PermissionManager_L2_RemoveUserGrantedPer_012
,
TestSize
.
Level3
)
HWTEST_F
(
PermissionKit
Performance
Test
,
Security_AppSecurity_PermissionManager_L2_RemoveUserGrantedPer_012
,
TestSize
.
Level3
)
{
int
ret
=
PermissionKit
::
AddDefPermissions
(
permDefNormal
);
ASSERT_EQ
(
RET_SUCCESS
,
ret
);
vector
<
string
>
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::"
<<
timeAll
/
10000
<<
"ms"
<<
std
::
endl
;
ASSERT_LT
(
timeAll
/
10000
,
5
);
std
::
cout
<<
"Performance of RemoveUserGrantedReqPermissions interface is::"
<<
timeAll
/
RUNNING_TIMES
<<
"ms"
<<
std
::
endl
;
ASSERT_LT
(
timeAll
/
RUNNING_TIMES
,
5
);
}
/**
...
...
@@ -349,14 +358,14 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveUser
* @tc.type FUNC
* @tc.level Level3
*/
HWTEST_F
(
PermissionKitTest
,
Security_AppSecurity_PermissionManager_L2_RemoveSystemGrantedPer_009
,
TestSize
.
Level3
)
HWTEST_F
(
PermissionKit
Performance
Test
,
Security_AppSecurity_PermissionManager_L2_RemoveSystemGrantedPer_009
,
TestSize
.
Level3
)
{
int
ret
=
PermissionKit
::
AddDefPermissions
(
permDefNormal
);
ASSERT_EQ
(
RET_SUCCESS
,
ret
);
vector
<
string
>
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::"
<<
timeAll
/
10000
<<
"ms"
<<
std
::
endl
;
ASSERT_LT
(
timeAll
/
10000
,
5
);
std
::
cout
<<
"Performance of RemoveSystemGrantedReqPermissions interface is::"
<<
timeAll
/
RUNNING_TIMES
<<
"ms"
<<
std
::
endl
;
ASSERT_LT
(
timeAll
/
RUNNING_TIMES
,
5
);
}
/**
...
...
@@ -379,7 +388,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RemoveSyst
* @tc.type FUNC
* @tc.level Level3
*/
HWTEST_F
(
PermissionKitTest
,
Security_AppSecurity_PermissionManager_L2_GrantUserGrantedPer_014
,
TestSize
.
Level3
)
HWTEST_F
(
PermissionKit
Performance
Test
,
Security_AppSecurity_PermissionManager_L2_GrantUserGrantedPer_014
,
TestSize
.
Level3
)
{
int
ret
=
PermissionKit
::
AddDefPermissions
(
permDefNormal
);
ASSERT_EQ
(
RET_SUCCESS
,
ret
);
...
...
@@ -388,7 +397,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantUserG
ret
=
PermissionKit
::
AddUserGrantedReqPermissions
(
TEST_BUNDLE_NAME
,
permList
,
TEST_USER_ID
);
ASSERT_EQ
(
RET_SUCCESS
,
ret
);
long
timeAll
=
0
;
for
(
int
i
=
0
;
i
<
10000
;
i
++
){
for
(
int
i
=
0
;
i
<
RUNNING_TIMES
;
i
++
){
long
startTime
=
GetCurrentTimeMillis
();
ret
=
PermissionKit
::
GrantUserGrantedPermission
(
TEST_BUNDLE_NAME
,
TEST_PERMISSION_NAME_ALPHA
,
TEST_USER_ID
);
ASSERT_EQ
(
RET_SUCCESS
,
ret
);
...
...
@@ -397,8 +406,8 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantUserG
ret
=
PermissionKit
::
RevokeUserGrantedPermission
(
TEST_BUNDLE_NAME
,
TEST_PERMISSION_NAME_ALPHA
,
TEST_USER_ID
);
ASSERT_EQ
(
RET_SUCCESS
,
ret
);
}
std
::
cout
<<
"Performance of GrantUserGrantedPermission interface is::"
<<
timeAll
/
10000
<<
"ms"
<<
std
::
endl
;
ASSERT_LT
(
timeAll
/
10000
,
5
);
std
::
cout
<<
"Performance of GrantUserGrantedPermission interface is::"
<<
timeAll
/
RUNNING_TIMES
<<
"ms"
<<
std
::
endl
;
ASSERT_LT
(
timeAll
/
RUNNING_TIMES
,
5
);
}
/**
...
...
@@ -411,7 +420,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantUserG
* @tc.type FUNC
* @tc.level Level3
*/
HWTEST_F
(
PermissionKitTest
,
Security_AppSecurity_PermissionManager_L2_GrantSystemGrantedPer_011
,
TestSize
.
Level3
)
HWTEST_F
(
PermissionKit
Performance
Test
,
Security_AppSecurity_PermissionManager_L2_GrantSystemGrantedPer_011
,
TestSize
.
Level3
)
{
int
ret
=
PermissionKit
::
AddDefPermissions
(
permDefNormal
);
ASSERT_EQ
(
RET_SUCCESS
,
ret
);
...
...
@@ -420,7 +429,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantSyste
ret
=
PermissionKit
::
AddSystemGrantedReqPermissions
(
TEST_BUNDLE_NAME
,
permList
);
ASSERT_EQ
(
RET_SUCCESS
,
ret
);
long
timeAll
=
0
;
for
(
int
i
=
0
;
i
<
10000
;
i
++
){
for
(
int
i
=
0
;
i
<
RUNNING_TIMES
;
i
++
){
long
startTime
=
GetCurrentTimeMillis
();
ret
=
PermissionKit
::
GrantSystemGrantedPermission
(
TEST_BUNDLE_NAME
,
TEST_PERMISSION_NAME_BETA
);
ASSERT_EQ
(
RET_SUCCESS
,
ret
);
...
...
@@ -429,8 +438,8 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantSyste
ret
=
PermissionKit
::
RevokeSystemGrantedPermission
(
TEST_BUNDLE_NAME
,
TEST_PERMISSION_NAME_BETA
);
ASSERT_EQ
(
RET_SUCCESS
,
ret
);
}
std
::
cout
<<
"Performance of GrantSystemGrantedPermission interface is::"
<<
timeAll
/
10000
<<
"ms"
<<
std
::
endl
;
ASSERT_LT
(
timeAll
/
10000
,
5
);
std
::
cout
<<
"Performance of GrantSystemGrantedPermission interface is::"
<<
timeAll
/
RUNNING_TIMES
<<
"ms"
<<
std
::
endl
;
ASSERT_LT
(
timeAll
/
RUNNING_TIMES
,
5
);
}
/**
...
...
@@ -443,7 +452,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_GrantSyste
* @tc.type FUNC
* @tc.level Level3
*/
HWTEST_F
(
PermissionKitTest
,
Security_AppSecurity_PermissionManager_L2_RevokeUserGrantedPer_015
,
TestSize
.
Level3
)
HWTEST_F
(
PermissionKit
Performance
Test
,
Security_AppSecurity_PermissionManager_L2_RevokeUserGrantedPer_015
,
TestSize
.
Level3
)
{
int
ret
=
PermissionKit
::
AddDefPermissions
(
permDefNormal
);
ASSERT_EQ
(
RET_SUCCESS
,
ret
);
...
...
@@ -452,7 +461,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeUser
ret
=
PermissionKit
::
AddUserGrantedReqPermissions
(
TEST_BUNDLE_NAME
,
permList
,
TEST_USER_ID
);
ASSERT_EQ
(
RET_SUCCESS
,
ret
);
long
timeAll
=
0
;
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
);
long
startTime
=
GetCurrentTimeMillis
();
...
...
@@ -461,8 +470,8 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeUser
long
timeCost
=
GetCurrentTimeMillis
()
-
startTime
;
timeAll
=
timeAll
+
timeCost
;
}
std
::
cout
<<
"Performance of GrantUserGrantedPermission interface is::"
<<
timeAll
/
10000
<<
"ms"
<<
std
::
endl
;
ASSERT_LT
(
timeAll
/
10000
,
5
);
std
::
cout
<<
"Performance of GrantUserGrantedPermission interface is::"
<<
timeAll
/
RUNNING_TIMES
<<
"ms"
<<
std
::
endl
;
ASSERT_LT
(
timeAll
/
RUNNING_TIMES
,
5
);
}
/**
...
...
@@ -475,7 +484,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeUser
* @tc.type FUNC
* @tc.level Level3
*/
HWTEST_F
(
PermissionKitTest
,
Security_AppSecurity_PermissionManager_L2_RevokeSystemGrantedPer_012
,
TestSize
.
Level3
)
HWTEST_F
(
PermissionKit
Performance
Test
,
Security_AppSecurity_PermissionManager_L2_RevokeSystemGrantedPer_012
,
TestSize
.
Level3
)
{
int
ret
=
PermissionKit
::
AddDefPermissions
(
permDefNormal
);
ASSERT_EQ
(
RET_SUCCESS
,
ret
);
...
...
@@ -484,7 +493,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeSyst
ret
=
PermissionKit
::
AddSystemGrantedReqPermissions
(
TEST_BUNDLE_NAME
,
permList
);
ASSERT_EQ
(
RET_SUCCESS
,
ret
);
long
timeAll
=
0
;
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
);
long
startTime
=
GetCurrentTimeMillis
();
...
...
@@ -493,8 +502,8 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeSyst
long
timeCost
=
GetCurrentTimeMillis
()
-
startTime
;
timeAll
=
timeAll
+
timeCost
;
}
std
::
cout
<<
"Performance of RevokeSystemGrantedPermission interface is::"
<<
timeAll
/
10000
<<
"ms"
<<
std
::
endl
;
ASSERT_LT
(
timeAll
/
10000
,
5
);
std
::
cout
<<
"Performance of RevokeSystemGrantedPermission interface is::"
<<
timeAll
/
RUNNING_TIMES
<<
"ms"
<<
std
::
endl
;
ASSERT_LT
(
timeAll
/
RUNNING_TIMES
,
5
);
}
/**
...
...
@@ -507,7 +516,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_RevokeSyst
* @tc.type FUNC
* @tc.level Level3
*/
HWTEST_F
(
PermissionKitTest
,
Security_AppSecurity_PermissionManager_L2_CanRequestPer_017
,
TestSize
.
Level3
)
HWTEST_F
(
PermissionKit
Performance
Test
,
Security_AppSecurity_PermissionManager_L2_CanRequestPer_017
,
TestSize
.
Level3
)
{
int
ret
=
PermissionKit
::
AddDefPermissions
(
permDefNormal
);
ASSERT_EQ
(
RET_SUCCESS
,
ret
);
...
...
@@ -516,13 +525,13 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_CanRequest
ret
=
PermissionKit
::
AddUserGrantedReqPermissions
(
TEST_BUNDLE_NAME
,
permList
,
TEST_USER_ID
);
ASSERT_EQ
(
RET_SUCCESS
,
ret
);
long
startTime
=
GetCurrentTimeMillis
();
for
(
int
i
=
0
;
i
<
10000
;
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
);
}
long
timeAll
=
GetCurrentTimeMillis
()
-
startTime
;
std
::
cout
<<
"Performance of CanRequestPermission interface is::"
<<
timeAll
/
10000
<<
"ms"
<<
std
::
endl
;
ASSERT_LT
(
timeAll
/
10000
,
5
);
std
::
cout
<<
"Performance of CanRequestPermission interface is::"
<<
timeAll
/
RUNNING_TIMES
<<
"ms"
<<
std
::
endl
;
ASSERT_LT
(
timeAll
/
RUNNING_TIMES
,
5
);
}
/**
...
...
@@ -535,7 +544,7 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_CanRequest
* @tc.type FUNC
* @tc.level Level3
*/
HWTEST_F
(
PermissionKitTest
,
Security_AppSecurity_PermissionManager_L2_VerifyPer_015
,
TestSize
.
Level3
)
HWTEST_F
(
PermissionKit
Performance
Test
,
Security_AppSecurity_PermissionManager_L2_VerifyPer_015
,
TestSize
.
Level3
)
{
int
ret
=
PermissionKit
::
AddDefPermissions
(
permDefNormal
);
ASSERT_EQ
(
RET_SUCCESS
,
ret
);
...
...
@@ -546,11 +555,11 @@ HWTEST_F(PermissionKitTest, Security_AppSecurity_PermissionManager_L2_VerifyPer_
ret
=
PermissionKit
::
GrantSystemGrantedPermission
(
TEST_BUNDLE_NAME
,
TEST_PERMISSION_NAME_BETA
);
ASSERT_EQ
(
RET_SUCCESS
,
ret
);
long
startTime
=
GetCurrentTimeMillis
();
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
);
}
long
timeAll
=
GetCurrentTimeMillis
()
-
startTime
;
std
::
cout
<<
"Performance of VerifyPermission interface is::"
<<
timeAll
/
10000
<<
"ms"
<<
std
::
endl
;
ASSERT_LT
(
timeAll
/
10000
,
5
);
std
::
cout
<<
"Performance of VerifyPermission interface is::"
<<
timeAll
/
RUNNING_TIMES
<<
"ms"
<<
std
::
endl
;
ASSERT_LT
(
timeAll
/
RUNNING_TIMES
,
5
);
}
security/permission/permissionkitcpp/src/PermissionKitReliabilityCPPTest.cpp
浏览文件 @
f87d6095
...
...
@@ -20,11 +20,20 @@
using
namespace
testing
::
ext
;
using
namespace
OHOS
::
Security
::
Permission
;
const
int
RUNNING_TIMES
=
5000
;
static
vector
<
PermissionDef
>
permDefNormal
;
static
vector
<
PermissionDef
>
permDefAbnormal1
;
static
vector
<
PermissionDef
>
permDefAbnormal2
;
void
PermissionKitTest
::
SetUpTestCase
()
class
PermissionKitReliabilityTest
:
public
testing
::
Test
{
public:
static
void
SetUpTestCase
();
static
void
TearDownTestCase
();
void
SetUp
();
void
TearDown
();
};
void
PermissionKitReliabilityTest
::
SetUpTestCase
()
{
vector
<
PermissionDef
>
permDefList1
;
vector
<
PermissionDef
>
permDefList2
;
...
...
@@ -80,10 +89,10 @@ void PermissionKitTest::SetUpTestCase()
permDefAbnormal2
=
permDefList3
;
}
void
PermissionKitTest
::
TearDownTestCase
()
void
PermissionKit
Reliability
Test
::
TearDownTestCase
()
{}
void
PermissionKitTest
::
SetUp
()
void
PermissionKit
Reliability
Test
::
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
PermissionKit
Reliability
Test
::
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
(
PermissionKit
Reliability
Test
,
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
(
PermissionKit
Reliability
Test
,
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
(
PermissionKit
Reliability
Test
,
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
(
PermissionKit
Reliability
Test
,
Security_AppSecurity_PermissionManager_L2_AddUserGrantedPer_013
,
TestSize
.
Level3
)
{
int
ret
=
PermissionKit
::
AddDefPermissions
(
permDefNormal
);
ASSERT_EQ
(
RET_SUCCESS
,
ret
);
vector
<
string
>
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
(
PermissionKit
Reliability
Test
,
Security_AppSecurity_PermissionManager_L2_AddSystemGrantedPer_010
,
TestSize
.
Level3
)
{
int
ret
=
PermissionKit
::
AddDefPermissions
(
permDefNormal
);
ASSERT_EQ
(
RET_SUCCESS
,
ret
);
vector
<
string
>
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
(
PermissionKit
Reliability
Test
,
Security_AppSecurity_PermissionManager_L2_RemoveUserGrantedPer_011
,
TestSize
.
Level3
)
{
int
ret
=
PermissionKit
::
AddDefPermissions
(
permDefNormal
);
ASSERT_EQ
(
RET_SUCCESS
,
ret
);
vector
<
string
>
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
(
PermissionKit
Reliability
Test
,
Security_AppSecurity_PermissionManager_L2_RemoveSystemGrantedPer_008
,
TestSize
.
Level3
)
{
int
ret
=
PermissionKit
::
AddDefPermissions
(
permDefNormal
);
ASSERT_EQ
(
RET_SUCCESS
,
ret
);
vector
<
string
>
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
(
PermissionKit
Reliability
Test
,
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
(
PermissionKit
Reliability
Test
,
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
(
PermissionKit
Reliability
Test
,
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
(
PermissionKit
Reliability
Test
,
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
(
PermissionKit
Reliability
Test
,
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
(
PermissionKit
Reliability
Test
,
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
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录