Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
94ec317a
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看板
提交
94ec317a
编写于
6月 08, 2021
作者:
O
openharmony_ci
提交者:
Gitee
6月 08, 2021
浏览文件
操作
浏览文件
下载
差异文件
!261 capability2200testcasefix
Merge pull request !261 from 胡吉翔/security20210607
上级
859ff480
6bab2edd
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
54 addition
and
2 deletion
+54
-2
security_lite/permission_posix/capability/src/ActsCapabilityTest.cpp
...te/permission_posix/capability/src/ActsCapabilityTest.cpp
+41
-1
security_lite/permission_posix/capability/src/ActsCapabilityTest.h
...lite/permission_posix/capability/src/ActsCapabilityTest.h
+13
-1
未找到文件。
security_lite/permission_posix/capability/src/ActsCapabilityTest.cpp
浏览文件 @
94ec317a
...
...
@@ -1490,7 +1490,7 @@ HWTEST_F(CapabilityTestSuite, CapabilityTest2100, Reliability | MediumTest | Lev
}
#endif
#if defined(LITE_FS_JFFS2)
|| defined(LITE_FS_VFAT)
#if defined(LITE_FS_JFFS2)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_Capability_2200
* @tc.name : Check whether the default configuration of the system process capabilities
...
...
@@ -1530,6 +1530,46 @@ HWTEST_F(CapabilityTestSuite, CapabilityTest2200, Security | MediumTest | Level1
}
#endif
#if defined(LITE_FS_VFAT)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_Capability_2200
* @tc.name : Check whether the default configuration of the system process capabilities
is the same as that described in the design document
* @tc.desc : [C-SECURITY-0100]
*/
HWTEST_F
(
CapabilityTestSuite
,
CapabilityTest2200
,
Security
|
MediumTest
|
Level1
)
{
int
ret
;
// Step 1: Check the capability of process 'init', pid = 1
ret
=
CapgetWithCaps
(
INIT_PID_2
,
INIT_CAP
);
EXPECT_EQ
(
ret
,
0
)
<<
"ErrInfo: Pid = 1, process init has wrong capability"
;
// Step 2: Check the capability of process 'KProcess', pid = 2
ret
=
CapgetWithCaps
(
KPROCESS_PID_2
,
KPROCESS_CAP
);
EXPECT_EQ
(
ret
,
0
)
<<
"ErrInfo: Pid = 2, process KProcess has wrong capability"
;
// Step 3: Check the capability of process 'shell', pid = 8
ret
=
CapgetWithCaps
(
SHELL_PID_2
,
SHELL_CAP
);
EXPECT_EQ
(
ret
,
0
)
<<
"ErrInfo: Pid = 8, process shell has wrong capability"
;
// Step 4: Check the capability of process 'apphilogcat', pid = 10
ret
=
CapgetWithCaps
(
HILOGCAT_PID_2
,
HILOGCAT_CAP
);
EXPECT_EQ
(
ret
,
0
)
<<
"ErrInfo: Pid = 10, process apphilogcat has wrong capability"
;
// Step 5: Check the capability of process 'foundation', pid = 3
ret
=
CapgetWithCaps
(
FOUNDATION_PID_2
,
FOUNDATION_CAP
);
EXPECT_EQ
(
ret
,
0
)
<<
"ErrInfo: Pid = 3, process foundation has wrong capability"
;
// Step 6: Check the capability of process 'bundle_daemon', pid = 4
ret
=
CapgetWithCaps
(
BUNDLE_DAEMON_PID_2
,
BUNDLE_DAEMON_CAP
);
EXPECT_EQ
(
ret
,
0
)
<<
"ErrInfo: Pid = 4, process bundle_daemon has wrong capability"
;
// Step 7: Check the capability of process 'appspawn', pid = 5
ret
=
CapgetWithCaps
(
APPSPAWN_PID_2
,
APPSPAWN_CAP
);
EXPECT_EQ
(
ret
,
0
)
<<
"ErrInfo: Pid = 5, process appspawn has wrong capability"
;
// Step 8: Check the capability of process 'media_server', pid = 6
ret
=
CapgetWithCaps
(
MEDIA_SERVER_PID_2
,
MEDIA_SERVER_CAP
);
EXPECT_EQ
(
ret
,
0
)
<<
"ErrInfo: Pid = 6, process media_server has wrong capability"
;
// Step 9: Check the capability of process 'wms_server' or 'ai_server', pid = 7
ret
=
CapgetWithCaps
(
WMS_SERVER_OR_AI_SERVER_PID_2
,
WMS_SERVER_OR_AI_SERVER_CAP
);
EXPECT_EQ
(
ret
,
0
)
<<
"ErrInfo: Pid = 7, process wms_server or ai_server has wrong capability"
;
}
#endif
#if defined(LITE_FS_JFFS2) || defined(LITE_FS_VFAT)
/*
* @tc.number : SUB_SEC_AppSEC_PermissionMgmt_Capability_2300
...
...
security_lite/permission_posix/capability/src/ActsCapabilityTest.h
浏览文件 @
94ec317a
...
...
@@ -46,6 +46,18 @@ constexpr int MEDIA_SERVER_PID = 8;
constexpr
int
WMS_SERVER_OR_AI_SERVER_PID
=
9
;
constexpr
int
HIVIEW_PID
=
10
;
constexpr
int
OTHER_PID
=
11
;
constexpr
int
INIT_PID_2
=
1
;
constexpr
int
KPROCESS_PID_2
=
2
;
constexpr
int
SHELL_PID_2
=
8
;
constexpr
int
HILOGCAT_PID_2
=
10
;
constexpr
int
FOUNDATION_PID_2
=
3
;
constexpr
int
BUNDLE_DAEMON_PID_2
=
4
;
constexpr
int
APPSPAWN_PID_2
=
5
;
constexpr
int
MEDIA_SERVER_PID_2
=
6
;
constexpr
int
WMS_SERVER_OR_AI_SERVER_PID_2
=
7
;
constexpr
int
HIVIEW_PID_2
=
10
;
constexpr
int
OTHER_PID_2
=
11
;
constexpr
unsigned
int
INIT_CAP
=
0x02e83def
;
constexpr
unsigned
int
KPROCESS_CAP
=
0x02e83def
;
constexpr
unsigned
int
SHELL_CAP
=
0x02e83def
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录