Compare commits

...

67 Commits

Author SHA1 Message Date
openharmony_ci 0d1635757f
!1242 fs_epoll竞争漏洞修复
Merge pull request !1242 from 石子怡/master
2024-10-15 14:09:01 +00:00
石子怡 c099376d69
update fs/vfs/epoll/fs_epoll.c.
Signed-off-by: 石子怡 <z15319797139@163.com>
2024-10-15 08:15:43 +00:00
石子怡 63f261d239
update fs/vfs/epoll/fs_epoll.c.
Signed-off-by: 石子怡 <z15319797139@163.com>
2024-10-15 07:53:37 +00:00
石子怡 02abd34ad2
update fs/vfs/epoll/fs_epoll.c.
Signed-off-by: 石子怡 <z15319797139@163.com>
2024-10-15 07:47:13 +00:00
openharmony_ci 20c42a9de5
!1238 shm pid 入参漏洞修复
Merge pull request !1238 from hw_llm/master
2024-10-12 12:07:26 +00:00
hw_llm 14c79fc921 Description: shm pid入参 漏洞修复
IssueNo: https://gitee.com/openharmony/kernel_liteos_a/issues/IAWM6R
Feature Or Bugfix: Bugfix
Binary Source: No
Signed-off-by: hw_llm <liu.limin@huawei.com>
2024-10-12 18:29:50 +08:00
openharmony_ci 51428fb84a
!1235 hidumper 漏洞修复
Merge pull request !1235 from hw_llm/master
2024-09-29 14:20:21 +00:00
hw_llm 31da79ec80 Description: hidumper 漏洞修复
IssueNo: https://gitee.com/openharmony/kernel_liteos_a/issues/IAUKD9
Feature Or Bugfix: Bugfix
Binary Source: No
Signed-off-by: hw_llm <liu.limin@huawei.com>
2024-09-29 17:41:35 +08:00
openharmony_ci 88cfb3de9d
!1232 mem 漏洞修复
Merge pull request !1232 from hw_llm/master
2024-09-29 09:12:37 +00:00
hw_llm 4bb465f9af Description: mem 漏洞修复
IssueNo: https://gitee.com/openharmony/kernel_liteos_a/issues/IAUJDR
Feature Or Bugfix: Bugfix
Binary Source: No
Signed-off-by: hw_llm <liu.limin@huawei.com>
2024-09-29 16:09:45 +08:00
openharmony_ci ef7610470c
!1229 liteipc 解决 释放后使用问题
Merge pull request !1229 from hw_llm/master
2024-09-24 01:11:34 +00:00
hw_llm 8b57198526 Description: liteipc 解决 释放后使用问题
IssueNo: https://gitee.com/openharmony/kernel_liteos_a/issues/IAT2X3
Feature Or Bugfix: Bugfix
Binary Source: No
Signed-off-by: hw_llm <liu.limin@huawei.com>
2024-09-23 20:01:13 +08:00
openharmony_ci 09bcabfaf6
!1225 VM Map 添加LITEIPC保护
Merge pull request !1225 from hw_llm/master
2024-09-20 09:53:50 +00:00
hw_llm 75af9e28d9 Description: VM Map 添加LiteIPC 保护
IssueNo: https://gitee.com/openharmony/kernel_liteos_a/issues/IASJFR
Feature Or Bugfix: Bugfix
Binary Source: No
Signed-off-by: hw_llm <liu.limin@huawei.com>
2024-09-20 16:42:19 +08:00
openharmony_ci 42f79f133b
!1224 OsFlushDirtyPage 函数内变量类型调整
Merge pull request !1224 from hw_llm/master
2024-09-06 12:20:09 +00:00
hw_llm 4abaa42830 Description: OsFlushDirtyPage 函数内变量类型调整
IssueNo: https://gitee.com/openharmony/kernel_liteos_a/issues/IA87P4
Feature Or Bugfix: Bugfix
Binary Source: No
Signed-off-by: hw_llm <liu.limin@huawei.com>
2024-09-06 14:41:43 +08:00
openharmony_ci 5d1caa2cfe
!1198 【轻量级 PR】:修复OsMemPoolDeInit函数名错误
Merge pull request !1198 from brucezhao/N/A
2024-08-28 08:58:35 +00:00
openharmony_ci 437c6530da
!1221 OsShellCmdTskInfoGet 内存泄露漏洞修复
Merge pull request !1221 from hw_llm/master
2024-08-26 01:29:37 +00:00
hw_llm b58c6d41f3 Description: OsShellCmdTskInfoGet 内存泄露漏洞修复
IssueNo: https://gitee.com/openharmony/kernel_liteos_a/issues/IAM34B?from=project-issue
Feature Or Bugfix: Bugfix
Binary Source: No
Signed-off-by: hw_llm <liu.limin@huawei.com>
2024-08-23 17:33:57 +08:00
openharmony_ci cab654a3fe
!1218 SysEpollWait 系统调用使用正确长度。
Merge pull request !1218 from hw_llm/master
2024-08-23 09:27:21 +00:00
hw_llm 5e3a8f11b4 Description: syscall SysEpollWait 执行漏洞修复
IssueNo: https://gitee.com/openharmony/kernel_liteos_a/issues/IALYB5?from=project-issue
Feature Or Bugfix: Bugfix
Binary Source: No
Signed-off-by: hw_llm <liu.limin@huawei.com>
2024-08-23 16:28:32 +08:00
openharmony_ci 2e642e6d9a
!1212 console read 漏洞修复
Merge pull request !1212 from hw_llm/master
2024-08-22 07:06:10 +00:00
hw_llm b22a7c266e Description: console read 漏洞修复
IssueNo: https://gitee.com/openharmony/kernel_liteos_a/issues/IALLNX?from=project-issue
Feature Or Bugfix: Feature
Binary Source: No
Signed-off-by: hw_llm <liu.limin@huawei.com>
2024-08-21 20:57:40 +08:00
openharmony_ci ef1b6f9cde
!1209 liteos_a 内核shell 漏洞修复
Merge pull request !1209 from hw_llm/master
2024-08-20 13:58:56 +00:00
hw_llm 2ac53f2c00 Description: shell lk 漏洞修复
IssueNo: https://gitee.com/openharmony/kernel_liteos_a/issues/IAKVF0
Feature Or Bugfix: Feature
Binary Source: No
Signed-off-by: hw_llm <liu.limin@huawei.com>
2024-08-19 11:04:32 +08:00
openharmony_ci 37162aafb6
!1202 容器测试编译报错问题
Merge pull request !1202 from hw_llm/master
2024-08-15 13:30:11 +00:00
hw_llm d958a8537c Description: 解决容器编译报错问题
IssueNo: https://gitee.com/openharmony/kernel_liteos_a/issues/I9TEYD
Feature Or Bugfix: Bugfix
Binary Source: No
Signed-off-by: hw_llm <liu.limin@huawei.com>
2024-08-15 19:10:19 +08:00
openharmony_ci aaf352f7f2
!1201 内核代码适配
Merge pull request !1201 from yaowenrui/master
2024-08-15 02:45:09 +00:00
yaowenrui 3f8b270180 5.10内核仓代码适配
Signed-off-by: yaowenrui <yaowenrui2@huawei.com>
2024-08-14 15:54:54 +08:00
openharmony_ci cc34b8f00e
!1197 整数溢出漏洞修复
Merge pull request !1197 from hw_llm/master
2024-07-15 13:45:01 +00:00
brucezhao 28159170be
修复OsMemPoolDeInit函数名错误
函数定义为`OsMemPoolDeinit`,而函数调用处使用的是`OsMemPoolDeInit`,前后不一致,对函数定义进行修复

Signed-off-by: brucezhao <zhaocl1994@qq.com>
2024-07-15 02:09:36 +00:00
hw_llm da45d3f539 Description: fix CVE-817641412102197248
IssueNo: https://gitee.com/openharmony/kernel_liteos_a/issues/IACJLK
Feature Or Bugfix: Bugfix
Binary Source: No
Signed-off-by: hw_llm <liu.limin@huawei.com>
2024-07-12 15:03:23 +08:00
openharmony_ci 49ad79f55e
!1194 解决UAF问题
Merge pull request !1194 from hw_llm/master
2024-07-11 13:32:59 +00:00
hw_llm 78db02de2c Description: fix CVE-810023952561737728
IssueNo: https://gitee.com/openharmony/kernel_liteos_a/issues/IAAZWU
Feature Or Bugfix: Bugfix
Binary Source: No
Signed-off-by: hw_llm <liu.limin@huawei.com>
2024-07-11 16:50:49 +08:00
openharmony_ci 7fcec6797c
!1192 【修复】OAT告警
Merge pull request !1192 from 石子怡/master
2024-05-27 11:37:41 +00:00
石子怡 dff8682d4d
修复OAT告警
Signed-off-by: 石子怡 <z15319797139@163.com>
2024-05-25 02:30:55 +00:00
石子怡 b0520a56f4
修复OAT告警
Signed-off-by: 石子怡 <z15319797139@163.com>
2024-05-25 01:33:58 +00:00
openharmony_ci 180bf8e5cd
!1189 内核mqueue 竞争漏洞修复
Merge pull request !1189 from hw_llm/master
2024-05-11 03:01:05 +00:00
hw_llm dbbb96c427 Description: liteos_a 内核竞争漏洞修复
IssueNo: https://gitee.com/openharmony/kernel_liteos_a/issues/I9OACM
Feature Or Bugfix: Bugfix
Binary Source: No
Signed-off-by: hw_llm <liu.limin@huawei.com>
2024-05-10 20:05:39 +08:00
openharmony_ci e3eaae1b1c
!1184 【轻量级 PR】:修改 SortQueueIndexArray 函数笔误
Merge pull request !1184 from brucezhao/N/A
2024-03-26 07:19:04 +00:00
openharmony_ci 9b5892e0a6
!1187 LTS 5.10 补丁升级适配
Merge pull request !1187 from Wanxiaoqing/master
2024-03-14 07:52:29 +00:00
wanxiaoqing 6a4d0be681 LTS 5.10 补丁升级适配
Signed-off-by: wanxiaoqing <wanxiaoqing@huawei.com>
2024-03-13 09:38:42 +08:00
openharmony_ci 8fe4080d08
!1185 删除bundle.json中的syscap信息,确保与架构信息平台设计信息一致
Merge pull request !1185 from hw_llm/master
2024-02-05 07:22:47 +00:00
hw_llm cfa0209c14 Description: 删除bundle.json中syscap信息
IssueNo: https://gitee.com/openharmony/kernel_liteos_a/issues/I90PKD
Feature Or Bugfix: Feature
Binary Source: No
Signed-off-by: hw_llm <liu.limin@huawei.com>
2024-02-02 15:41:59 +08:00
brucezhao a235c4c106
修改 SortQueueIndexArray 函数笔误
修改 SortQueueIndexArray 函数 queueSortParam.ipcDebugCBCnt = LOSCFG_BASE_IPC_SEM_LIMIT; 的笔误为 LOSCFG_BASE_IPC_QUEUE_LIMIT

Signed-off-by: brucezhao <bruce.e.zhao@gmail.com>
2023-11-24 07:57:04 +00:00
openharmony_ci c2cb0435b2
!1182 LTS 5.10 补丁升级适配
Merge pull request !1182 from Ywenrui44091/master
2023-11-20 04:43:43 +00:00
yaowenrui 4fbb41b7d5 LTS 5.10 补丁升级适配
Signed-off-by: yaowenrui <yaowenrui2@huawei.com>
2023-11-16 10:46:44 +08:00
openharmony_ci 04f971084b
!1178 fix: /dev/mem 及 /proc/fs_cache 权限漏洞修复
Merge pull request !1178 from yinjiaming/fix
2023-10-16 09:38:00 +00:00
yinjiaming 6daecc8d26 fix: /dev/mem 及 /proc/fs_cache 权限漏洞修复
/dev/mem 和 /proc/fs_cache 存在多余的读写权限,
有被低权限者利用进行攻击的风险,现予以修复。

Signed-off-by: yinjiaming <yinjiaming@huawei.com>
Change-Id: Ie6b537e8cb1de7353dfc357411eba4920a539b4f
2023-10-12 09:52:18 +08:00
openharmony_ci 173cdeb077
!1166 fix: 修复告警
Merge pull request !1166 from Zhaotianyu/20230526fix_codecheck
2023-09-05 13:36:55 +00:00
openharmony_ci e28271d650
!1174 fix:SysMqNotify系统调用安全增强
Merge pull request !1174 from zhangdengyu/mq_0904
2023-09-04 13:19:17 +00:00
zhangdengyu 27eb4e2334 fix:SysMqNotify系统调用安全增强
Close: #I7YG58

Signed-off-by: zhangdengyu <zhangdengyu2@huawei.com>
Change-Id: Iee5a6c24cd2226e9cab0c4fd37e76194ad068862
2023-09-04 20:43:40 +08:00
openharmony_ci bd57ef7e2c
!1161 添加unittest用例测试工具
Merge pull request !1161 from zhushengle/unittest_tools
2023-09-04 09:12:43 +00:00
zhushengle 342a3eb5c1 feat: 添加unittest用例测试工具
Close #I73IZ3

Signed-off-by: zhushengle <zhushengle@huawei.com>
Change-Id: I899978a8d8d2edeb30f0ba4d896f6f5abc8a6939
2023-09-04 11:57:15 +08:00
openharmony_ci 63885154d2
!1173 test:调整测试用例
Merge pull request !1173 from zhangdengyu/test_0831
2023-08-31 03:47:11 +00:00
zhangdengyu 95d1eb890a test: 调整测试用例
Close: #I7XBLH

Signed-off-by: zhangdengyu <zhangdengyu2@huawei.com>
Change-Id: Ie58907ea40c062fd1604035945810c53dc7f0bf2
2023-08-31 09:04:51 +08:00
openharmony_ci 0bc453c2cd
!1169 修复swtmr遍历不全导致的用例问题
Merge pull request !1169 from wangchen/0726_a
2023-07-26 02:39:24 +00:00
wangchen 73bcf0ec9a Fix: 修复swtmr只在当前核遍历链表的问题
Close #I7NZDT
Signed-off-by: wangchen <wangchen240@huawei.com>
2023-07-26 09:35:58 +08:00
openharmony_ci 49bfc90a63
!1167 容器代码container目录位置变更
Merge pull request !1167 from zwx1232718/master
2023-06-09 09:21:56 +00:00
zwx1232718 b0708886fa container dir change
Signed-off-by: zwx1232718 <zhenghui23@huawei.com>
2023-06-09 16:29:23 +08:00
openharmony_ci a388a3f565
!1148 修复一些typo错误
Merge pull request !1148 from 景涛/master
2023-06-06 13:36:01 +00:00
arvinzzz 145ff76ab6 refactor: fix codecheck
Signed-off-by: arvinzzz <zhaotianyu9@huawei.com>
Change-Id: Ib35ca40dc837d78a4c9dc03e44d117088865a5a6
2023-05-26 15:44:47 +08:00
openharmony_ci 280769ae42
!1163 GN脚本规范化
Merge pull request !1163 from zhushengle/GN
2023-05-23 08:43:40 +00:00
zhushengle 1f3a6c8143 feat: GN脚本规范化
Signed-off-by: zhushengle <zhushengle@huawei.com>
Change-Id: I80b055091a0ff333a859cd35447a851296a67103
2023-05-23 15:56:45 +08:00
openharmony_ci 6c0b0dde23
!1157 test:调整TDD测试用例
Merge pull request !1157 from zhangdengyu/fixTest0424
2023-05-18 12:14:47 +00:00
zhangdengyu 76228c3617 test: TDD用例调整
方案描述:
1、门禁流水线跑单个测试用例.bin文件有时间限制,将用时过长的bin按类型拆分;
2、缩短EDF测试用例的时间;
3、dynload用例改变当前工作路径未恢复导致执行结果的xml文件未生成,在用例结束退出之前恢复当前工作路径。

Close:#I6YIX6

Signed-off-by: zhangdengyu <zhangdengyu2@huawei.com>
Change-Id: I8c6118f9589e8801000ccb0cae9b81e0925696f4
2023-05-18 15:46:12 +08:00
”景涛“ 24aa6858ee fix some typo errors
Signed-off-by: ”景涛“ <jingtao3@hust.edu.cn>
2023-04-15 22:16:32 +08:00
130 changed files with 1830 additions and 596 deletions

View File

@ -299,7 +299,7 @@ config("public") {
configs += [
"$HDFTOPDIR:public",
"//drivers/liteos:public",
"$DRIVERS_LITEOS_DIR:public",
]
if (HAVE_DEVICE_SDK) {
@ -324,8 +324,8 @@ group("modules") {
]
deps += [
"//drivers/liteos",
HDFTOPDIR,
"$DRIVERS_LITEOS_DIR",
"$HDFTOPDIR",
]
if (HAVE_DEVICE_SDK) {
@ -351,7 +351,7 @@ group("liteos_a") {
deps += [
":apps",
":tests",
"//third_party/musl/scripts/build_lite:strip",
"$THIRDPARTY_MUSL_DIR/scripts/build_lite:strip",
]
if (liteos_skip_make == false) {
deps += [ ":make" ]

View File

@ -65,6 +65,8 @@
<!--filteritem type="filepath" name="projectroot/[a-zA-Z0-9]{20,}.sh" desc="Temp files"/-->
</filefilter>
<filefilter name="binaryFileTypePolicyFilter" desc="Filters for binary file policies">
<filteritem type="filepath" name="figures/architecture-of-the-openharmony-liteos-cortex-a-kernel.png" desc="architecture-of-the-openharmony-liteos-cortex-a-kernel"/>
<filteritem type="filepath" name="figures/OpenHarmony-LiteOS-A内核架构图.png" desc="LiteOS-A内核架构图"/>
<!--filteritem type="filename" name="*.uvwxyz" desc="Describe the reason for filtering scan results"/-->
<!--filteritem type="filepath" name="abcdefg/.*.uvwxyz" desc="Describe the reason for filtering scan results"/-->
<!--filteritem type="filepath" name="projectroot/[a-zA-Z0-9]{20,}.sh" desc="Temp files"/-->

View File

@ -87,6 +87,8 @@ OpenHarmony LiteOS-A内核支持[Hi3516DV300](https://gitee.com/openharmony/docs
编译可以参考:[编译指导](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-pkg-3516-build.md)
测试参考:[单元测试](testsuites/unittest/tools/README.md)
## 贡献<a name="section1371123476304"></a>
[如何贡献](https://gitee.com/openharmony/docs/blob/HEAD/zh-cn/contribute/%E5%8F%82%E4%B8%8E%E8%B4%A1%E7%8C%AE.md)

View File

@ -29,7 +29,7 @@
import("//build/lite/config/component/lite_component.gni")
import("//kernel/liteos_a/liteos.gni")
import("//third_party/mksh/mksh.gni")
import("$THIRDPARTY_MKSH_DIR/mksh.gni")
group("mksh") {
deps = [ ":build_mksh" ]
@ -42,7 +42,7 @@ copy("copy_mksh_src") {
build_ext_component("build_mksh") {
deps = [ ":copy_mksh_src" ]
deps += [ "//third_party/musl:sysroot_lite" ]
deps += [ "$THIRDPARTY_MUSL_DIR:sysroot_lite" ]
exec_path = rebase_path("$target_out_dir/mksh_build")
cflags = [

View File

@ -29,7 +29,7 @@
import("//build/lite/config/component/lite_component.gni")
import("//kernel/liteos_a/liteos.gni")
import("//third_party/toybox/toybox.gni")
import("$THIRDPARTY_TOYBOX_DIR/toybox.gni")
group("toybox") {
deps = [ ":build_toybox" ]
@ -51,7 +51,7 @@ build_ext_component("build_toybox") {
":copy_toybox_config",
":copy_toybox_src",
]
deps += [ "//third_party/musl:sysroot_lite" ]
deps += [ "$THIRDPARTY_MUSL_DIR:sysroot_lite" ]
exec_path = rebase_path("$target_out_dir/toybox_build")
cflags = [

View File

@ -27,9 +27,6 @@
"component": {
"name": "liteos_a",
"subsystem": "kernel",
"syscap": [
"SystemCapability.Kernel.Liteos-A"
],
"features": [],
"adapted_system_type": [
"small"

View File

@ -270,6 +270,7 @@ STATIC INT32 DoMqueueClose(struct mqpersonal *privateMqPersonal)
{
struct mqarray *mqueueCB = NULL;
struct mqpersonal *tmp = NULL;
INT32 ret;
mqueueCB = privateMqPersonal->mq_posixdes;
if (mqueueCB == NULL || mqueueCB->mq_personal == NULL) {
@ -277,6 +278,12 @@ STATIC INT32 DoMqueueClose(struct mqpersonal *privateMqPersonal)
return LOS_NOK;
}
if ((mqueueCB->unlinkflag == TRUE) && (privateMqPersonal->mq_next == NULL)) {
ret = DoMqueueDelete(mqueueCB);
if (ret < 0) {
return ret;
}
}
/* find the personal and remove */
if (mqueueCB->mq_personal == privateMqPersonal) {
mqueueCB->mq_personal = privateMqPersonal->mq_next;
@ -298,9 +305,6 @@ STATIC INT32 DoMqueueClose(struct mqpersonal *privateMqPersonal)
/* free the personal */
(VOID)LOS_MemFree(OS_SYS_MEM_ADDR, privateMqPersonal);
if ((mqueueCB->unlinkflag == TRUE) && (mqueueCB->mq_personal == NULL)) {
return DoMqueueDelete(mqueueCB);
}
return LOS_OK;
}
@ -604,17 +608,19 @@ int OsMqGetAttr(mqd_t personal, struct mq_attr *mqAttr)
struct mqarray *mqueueCB = NULL;
struct mqpersonal *privateMqPersonal = NULL;
(VOID)pthread_mutex_lock(&IPC_QUEUE_MUTEX);
privateMqPersonal = MqGetPrivDataBuff(personal);
if (privateMqPersonal == NULL) {
(VOID)pthread_mutex_unlock(&IPC_QUEUE_MUTEX);
return -1;
}
if (mqAttr == NULL) {
errno = EINVAL;
(VOID)pthread_mutex_unlock(&IPC_QUEUE_MUTEX);
return -1;
}
(VOID)pthread_mutex_lock(&IPC_QUEUE_MUTEX);
if (privateMqPersonal->mq_status != MQ_USE_MAGIC) {
errno = EBADF;
(VOID)pthread_mutex_unlock(&IPC_QUEUE_MUTEX);
@ -634,17 +640,19 @@ int OsMqSetAttr(mqd_t personal, const struct mq_attr *mqSetAttr, struct mq_attr
{
struct mqpersonal *privateMqPersonal = NULL;
(VOID)pthread_mutex_lock(&IPC_QUEUE_MUTEX);
privateMqPersonal = MqGetPrivDataBuff(personal);
if (privateMqPersonal == NULL) {
(VOID)pthread_mutex_unlock(&IPC_QUEUE_MUTEX);
return -1;
}
if (mqSetAttr == NULL) {
errno = EINVAL;
(VOID)pthread_mutex_unlock(&IPC_QUEUE_MUTEX);
return -1;
}
(VOID)pthread_mutex_lock(&IPC_QUEUE_MUTEX);
if (privateMqPersonal->mq_status != MQ_USE_MAGIC) {
errno = EBADF;
(VOID)pthread_mutex_unlock(&IPC_QUEUE_MUTEX);

View File

@ -28,7 +28,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//kernel/liteos_a/liteos.gni")
import("//third_party/NuttX/NuttX.gni")
import("$THIRDPARTY_NUTTX_DIR/NuttX.gni")
module_switch = defined(LOSCFG_FS_VFS_BLOCK_DEVICE)
module_name = get_path_info(rebase_path("."), "name")

View File

@ -61,7 +61,7 @@ static ssize_t MemMap(struct file *filep, LosVmMapRegion *region)
VADDR_T vaddr = region->range.base;
LosVmSpace *space = LOS_SpaceGet(vaddr);
if ((paddr >= SYS_MEM_BASE) && (paddr < SYS_MEM_END)) {
if (((paddr + size) >= SYS_MEM_BASE) && (paddr < SYS_MEM_END)) {
return -EINVAL;
}
@ -97,5 +97,5 @@ static const struct file_operations_vfs g_memDevOps = {
int DevMemRegister(void)
{
return register_driver("/dev/mem", &g_memDevOps, 0666, 0); /* 0666: file mode */
return register_driver("/dev/mem", &g_memDevOps, 0644, 0); /* 0644: file mode */
}

View File

@ -28,7 +28,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//kernel/liteos_a/liteos.gni")
import("//third_party/NuttX/NuttX.gni")
import("$THIRDPARTY_NUTTX_DIR/NuttX.gni")
module_switch = defined(LOSCFG_DRIVERS_VIDEO)
module_name = get_path_info(rebase_path("."), "name")

View File

@ -28,7 +28,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//kernel/liteos_a/liteos.gni")
import("//third_party/FatFs/FatFs.gni")
import("$THIRDPARTY_FATFS_DIR/FatFs.gni")
module_switch = defined(LOSCFG_FS_FAT)
module_name = get_path_info(rebase_path("."), "name")

View File

@ -31,7 +31,7 @@ import("//kernel/liteos_a/liteos.gni")
module_switch = defined(LOSCFG_FS_JFFS)
module_name = get_path_info(rebase_path("."), "name")
linux_path = rebase_path("//kernel/linux/linux-5.10")
linux_path = rebase_path("$KERNEL_LINUX_DIR")
out_path = rebase_path(target_out_dir)
kernel_module(module_name) {

View File

@ -2311,7 +2311,7 @@ diff -Nupr old/fs/jffs2/erase.c new/fs/jffs2/erase.c
diff -Nupr old/fs/jffs2/file.c new/fs/jffs2/file.c
--- old/fs/jffs2/file.c 2022-05-09 17:22:53.000000000 +0800
+++ new/fs/jffs2/file.c 2022-05-10 09:43:14.250000000 +0800
@@ -9,335 +9,30 @@
@@ -9,334 +9,31 @@
* For licensing information, see the file 'LICENCE' in this directory.
*
*/
@ -2348,7 +2348,7 @@ diff -Nupr old/fs/jffs2/file.c new/fs/jffs2/file.c
- struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb);
+ /* FIXME: This works only with one file system mounted at a time */
int ret;
-
- ret = file_write_and_wait_range(filp, start, end);
+ ret = jffs2_read_inode_range(c, f, gc_buffer,
+ offset & ~(PAGE_SIZE-1), PAGE_SIZE);
@ -2361,8 +2361,10 @@ diff -Nupr old/fs/jffs2/file.c new/fs/jffs2/file.c
- inode_unlock(inode);
-
- return 0;
-}
-
+ return ERR_PTR(ret);
+ return gc_buffer;
}
-const struct file_operations jffs2_file_operations =
-{
- .llseek = generic_file_llseek,
@ -2387,7 +2389,10 @@ diff -Nupr old/fs/jffs2/file.c new/fs/jffs2/file.c
-};
-
-const struct address_space_operations jffs2_file_address_operations =
-{
+void jffs2_gc_release_page(struct jffs2_sb_info *c,
+ unsigned char *ptr,
+ unsigned long *priv)
{
- .readpage = jffs2_readpage,
- .write_begin = jffs2_write_begin,
- .write_end = jffs2_write_end,
@ -2443,35 +2448,29 @@ diff -Nupr old/fs/jffs2/file.c new/fs/jffs2/file.c
- ret = jffs2_do_readpage_unlock(pg->mapping->host, pg);
- mutex_unlock(&f->sem);
- return ret;
+ return ERR_PTR(ret);
+ return gc_buffer;
}
-}
-
-static int jffs2_write_begin(struct file *filp, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
- struct page **pagep, void **fsdata)
+void jffs2_gc_release_page(struct jffs2_sb_info *c,
+ unsigned char *ptr,
+ unsigned long *priv)
{
-{
- struct page *pg;
- struct inode *inode = mapping->host;
- struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode);
- struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb);
- pgoff_t index = pos >> PAGE_SHIFT;
- uint32_t pageofs = index << PAGE_SHIFT;
- int ret = 0;
-
- jffs2_dbg(1, "%s()\n", __func__);
-
- if (pageofs > inode->i_size) {
- /* Make new hole frag from old EOF to new page */
- if (pos > inode->i_size) {
- /* Make new hole frag from old EOF to new position */
- struct jffs2_raw_inode ri;
- struct jffs2_full_dnode *fn;
- uint32_t alloc_len;
-
- jffs2_dbg(1, "Writing new hole frag 0x%x-0x%x between current EOF and new page\n",
- (unsigned int)inode->i_size, pageofs);
- jffs2_dbg(1, "Writing new hole frag 0x%x-0x%x between current EOF and new position\n",
- (unsigned int)inode->i_size, (uint32_t)pos);
-
- ret = jffs2_reserve_space(c, sizeof(ri), &alloc_len,
- ALLOC_NORMAL, JFFS2_SUMMARY_INODE_SIZE);
@ -2491,10 +2490,10 @@ diff -Nupr old/fs/jffs2/file.c new/fs/jffs2/file.c
- ri.mode = cpu_to_jemode(inode->i_mode);
- ri.uid = cpu_to_je16(i_uid_read(inode));
- ri.gid = cpu_to_je16(i_gid_read(inode));
- ri.isize = cpu_to_je32(max((uint32_t)inode->i_size, pageofs));
- ri.isize = cpu_to_je32((uint32_t)pos);
- ri.atime = ri.ctime = ri.mtime = cpu_to_je32(JFFS2_NOW());
- ri.offset = cpu_to_je32(inode->i_size);
- ri.dsize = cpu_to_je32(pageofs - inode->i_size);
- ri.dsize = cpu_to_je32((uint32_t)pos - inode->i_size);
- ri.csize = cpu_to_je32(0);
- ri.compr = JFFS2_COMPR_ZERO;
- ri.node_crc = cpu_to_je32(crc32(0, &ri, sizeof(ri)-8));
@ -2524,7 +2523,7 @@ diff -Nupr old/fs/jffs2/file.c new/fs/jffs2/file.c
- goto out_err;
- }
- jffs2_complete_reservation(c);
- inode->i_size = pageofs;
- inode->i_size = pos;
- mutex_unlock(&f->sem);
- }
-
@ -6341,7 +6340,7 @@ diff -Nupr old/fs/jffs2/summary.h new/fs/jffs2/summary.h
diff -Nupr old/fs/jffs2/super.c new/fs/jffs2/super.c
--- old/fs/jffs2/super.c 2022-05-09 17:22:53.000000000 +0800
+++ new/fs/jffs2/super.c 2022-05-09 20:09:32.170000000 +0800
@@ -9,433 +9,188 @@
@@ -9,434 +9,188 @@
*
*/
@ -6419,6 +6418,7 @@ diff -Nupr old/fs/jffs2/super.c new/fs/jffs2/super.c
+ c->cleanmarker_size = sizeof(struct jffs2_unknown_node);
- mutex_init(&f->sem);
- f->target = NULL;
- inode_init_once(&f->vfs_inode);
-}
+ ret = jffs2_do_mount_fs(c);
@ -8668,7 +8668,7 @@ diff -Nupr old/fs/jffs2/writev.c new/fs/jffs2/writev.c
diff -Nupr old/fs/jffs2/xattr.c new/fs/jffs2/xattr.c
--- old/fs/jffs2/xattr.c 2022-05-09 17:15:24.360000000 +0800
+++ new/fs/jffs2/xattr.c 1970-01-01 08:00:00.000000000 +0800
@@ -1,1347 +0,0 @@
@@ -1,1352 +0,0 @@
-/*
- * JFFS2 -- Journalling Flash File System, Version 2.
- *
@ -9443,10 +9443,10 @@ diff -Nupr old/fs/jffs2/xattr.c new/fs/jffs2/xattr.c
-}
-
-#define XREF_TMPHASH_SIZE (128)
-void jffs2_build_xattr_subsystem(struct jffs2_sb_info *c)
-int jffs2_build_xattr_subsystem(struct jffs2_sb_info *c)
-{
- struct jffs2_xattr_ref *ref, *_ref;
- struct jffs2_xattr_ref *xref_tmphash[XREF_TMPHASH_SIZE];
- struct jffs2_xattr_ref **xref_tmphash;
- struct jffs2_xattr_datum *xd, *_xd;
- struct jffs2_inode_cache *ic;
- struct jffs2_raw_node_ref *raw;
@ -9455,9 +9455,12 @@ diff -Nupr old/fs/jffs2/xattr.c new/fs/jffs2/xattr.c
-
- BUG_ON(!(c->flags & JFFS2_SB_FLAG_BUILDING));
-
- xref_tmphash = kcalloc(XREF_TMPHASH_SIZE,
- sizeof(struct jffs2_xattr_ref *), GFP_KERNEL);
- if (!xref_tmphash)
- return -ENOMEM;
-
- /* Phase.1 : Merge same xref */
- for (i=0; i < XREF_TMPHASH_SIZE; i++)
- xref_tmphash[i] = NULL;
- for (ref=c->xref_temp; ref; ref=_ref) {
- struct jffs2_xattr_ref *tmp;
-
@ -9555,6 +9558,8 @@ diff -Nupr old/fs/jffs2/xattr.c new/fs/jffs2/xattr.c
- "%u of xref (%u dead, %u orphan) found.\n",
- xdatum_count, xdatum_unchecked_count, xdatum_orphan_count,
- xref_count, xref_dead_count, xref_orphan_count);
- kfree(xref_tmphash);
- return 0;
-}
-
-struct jffs2_xattr_datum *jffs2_setup_xattr_datum(struct jffs2_sb_info *c,

View File

@ -490,14 +490,14 @@ off_t VfsJffs2Seek(struct file *filep, off_t offset, int whence)
filePos = filep->f_pos;
switch (whence) {
case SEEK_SET:
filePos = offset;
break;
case SEEK_CUR:
filePos += offset;
break;
case SEEK_SET:
filePos = offset;
break;
case SEEK_END:
filePos = node->i_size + offset;
break;

View File

@ -28,7 +28,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//kernel/liteos_a/liteos.gni")
import("//third_party/NuttX/NuttX.gni")
import("$THIRDPARTY_NUTTX_DIR/NuttX.gni")
module_switch = defined(LOSCFG_FS_NFS)
module_name = get_path_info(rebase_path("."), "name")

View File

@ -207,7 +207,7 @@ static const struct ProcFileOperations FS_CACHE_PROC_FOPS = {
void ProcFsCacheInit(void)
{
struct ProcDirEntry *pde = CreateProcEntry("fs_cache", 0, NULL);
struct ProcDirEntry *pde = CreateProcEntry("fs_cache", 0400, NULL);
if (pde == NULL) {
PRINT_ERR("create fs_cache error!\n");
return;

View File

@ -28,7 +28,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//kernel/liteos_a/liteos.gni")
import("//third_party/NuttX/NuttX.gni")
import("$THIRDPARTY_NUTTX_DIR/NuttX.gni")
module_switch = defined(LOSCFG_FS_RAMFS)
module_name = get_path_info(rebase_path("."), "name")

View File

@ -28,7 +28,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//kernel/liteos_a/liteos.gni")
import("//third_party/NuttX/NuttX.gni")
import("$THIRDPARTY_NUTTX_DIR/NuttX.gni")
module_switch = defined(LOSCFG_FS_ROMFS)
module_name = get_path_info(rebase_path("."), "name")

View File

@ -28,7 +28,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//kernel/liteos_a/liteos.gni")
import("//third_party/NuttX/NuttX.gni")
import("$THIRDPARTY_NUTTX_DIR/NuttX.gni")
module_switch = defined(LOSCFG_FS_VFS)
module_name = get_path_info(rebase_path("."), "name")

View File

@ -220,14 +220,18 @@ int epoll_close(int epfd)
{
struct epoll_head *epHead = NULL;
(VOID)pthread_mutex_lock(&g_epollMutex);
epHead = EpollGetDataBuff(epfd);
if (epHead == NULL) {
(VOID)pthread_mutex_unlock(&g_epollMutex);
set_errno(EBADF);
return -1;
}
DoEpollClose(epHead);
return EpollFreeSysFd(epfd);
int ret = EpollFreeSysFd(epfd);
(VOID)pthread_mutex_unlock(&g_epollMutex);
return ret;
}
int epoll_ctl(int epfd, int op, int fd, struct epoll_event *ev)
@ -236,15 +240,16 @@ int epoll_ctl(int epfd, int op, int fd, struct epoll_event *ev)
int i;
int ret = -1;
(VOID)pthread_mutex_lock(&g_epollMutex);
epHead = EpollGetDataBuff(epfd);
if (epHead == NULL) {
set_errno(EBADF);
return ret;
goto OUT_RELEASE;
}
if (ev == NULL) {
set_errno(EINVAL);
return -1;
goto OUT_RELEASE;
}
switch (op) {
@ -252,18 +257,19 @@ int epoll_ctl(int epfd, int op, int fd, struct epoll_event *ev)
ret = CheckFdExist(epHead, fd);
if (ret == -1) {
set_errno(EEXIST);
return -1;
goto OUT_RELEASE;
}
if (epHead->nodeCount == EPOLL_DEFAULT_SIZE) {
set_errno(ENOMEM);
return -1;
goto OUT_RELEASE;
}
epHead->evs[epHead->nodeCount].events = ev->events | POLLERR | POLLHUP;
epHead->evs[epHead->nodeCount].data.fd = fd;
epHead->nodeCount++;
return 0;
ret = 0;
break;
case EPOLL_CTL_DEL:
for (i = 0; i < epHead->nodeCount; i++) {
if (epHead->evs[i].data.fd != fd) {
@ -275,23 +281,29 @@ int epoll_ctl(int epfd, int op, int fd, struct epoll_event *ev)
epHead->nodeCount - i);
}
epHead->nodeCount--;
return 0;
ret = 0;
goto OUT_RELEASE;
}
set_errno(ENOENT);
return -1;
break;
case EPOLL_CTL_MOD:
for (i = 0; i < epHead->nodeCount; i++) {
if (epHead->evs[i].data.fd == fd) {
epHead->evs[i].events = ev->events | POLLERR | POLLHUP;
return 0;
ret = 0;
goto OUT_RELEASE;
}
}
set_errno(ENOENT);
return -1;
break;
default:
set_errno(EINVAL);
return -1;
break;
}
OUT_RELEASE:
(VOID)pthread_mutex_unlock(&g_epollMutex);
return ret;
}
int epoll_wait(int epfd, FAR struct epoll_event *evs, int maxevents, int timeout)
@ -326,7 +338,7 @@ int epoll_wait(int epfd, FAR struct epoll_event *evs, int maxevents, int timeout
return -1;
}
for (i = 0; i < epHead->nodeCount; i++) {
for (i = 0; i < pollSize; i++) {
pFd[i].fd = epHead->evs[i].data.fd;
pFd[i].events = (short)epHead->evs[i].events;
}

View File

@ -67,51 +67,6 @@ config PAGE_TABLE_FINE_LOCK
help
This option will enable fine lock for page table.
######################### config options of container ####################
config KERNEL_CONTAINER
bool "Enable container Feature"
default n
depends on KERNEL_VM
config PID_CONTAINER
bool "Enable pid container Feature"
default n
depends on KERNEL_CONTAINER
config UTS_CONTAINER
bool "Enable uts container Feature"
default n
depends on KERNEL_CONTAINER
config MNT_CONTAINER
bool "Enable mnt container Feature"
default n
depends on KERNEL_CONTAINER
config CHROOT
bool "Enable chroot"
default n
depends on MNT_CONTAINER
config IPC_CONTAINER
bool "Enable ipc container Feature"
default n
depends on KERNEL_CONTAINER
config TIME_CONTAINER
bool "Enable time container"
default n
depends on KERNEL_CONTAINER
config USER_CONTAINER
bool "Enable user container"
default n
depends on KERNEL_CONTAINER
config NET_CONTAINER
bool "Enable net container"
default n
depends on KERNEL_CONTAINER
######################### config options of extended #####################
source "kernel/extended/Kconfig"

View File

@ -32,15 +32,6 @@ import("//kernel/liteos_a/liteos.gni")
module_name = get_path_info(rebase_path("."), "name")
kernel_module(module_name) {
sources = [
"container/los_container.c",
"container/los_credentials.c",
"container/los_ipc_container.c",
"container/los_mnt_container.c",
"container/los_net_container.c",
"container/los_pid_container.c",
"container/los_time_container.c",
"container/los_user_container.c",
"container/los_uts_container.c",
"core/los_bitmap.c",
"core/los_info.c",
"core/los_process.c",

View File

@ -39,7 +39,6 @@ LOCAL_SRCS := $(wildcard ipc/*.c) $(wildcard core/*.c) $(wildcard mem/membox/*.
$(wildcard mp/*.c) \
$(wildcard sched/*.c) \
$(wildcard vm/*.c) \
$(wildcard container/*.c)
LOCAL_FLAGS := $(LITEOS_CFLAGS_INTERWORK) -Wno-frame-address

View File

@ -583,7 +583,7 @@ STATIC INLINE BOOL SwtmrRunqueueFind(SortLinkAttribute *swtmrSortLink, SCHED_TL_
STATIC BOOL SwtmrTimeListFind(SCHED_TL_FIND_FUNC checkFunc, UINTPTR arg)
{
for (UINT16 cpuid = 0; cpuid < LOSCFG_KERNEL_CORE_NUM; cpuid++) {
SortLinkAttribute *swtmrSortLink = &g_swtmrRunqueue[ArchCurrCpuid()].swtmrSortLink;
SortLinkAttribute *swtmrSortLink = &g_swtmrRunqueue[cpuid].swtmrSortLink;
if (SwtmrRunqueueFind(swtmrSortLink, checkFunc, arg)) {
return TRUE;
}

View File

@ -157,7 +157,8 @@ typedef struct VmSpace {
#define VM_MAP_REGION_FLAG_SHM (1<<16)
#define VM_MAP_REGION_FLAG_FIXED (1<<17)
#define VM_MAP_REGION_FLAG_FIXED_NOREPLACE (1<<18)
#define VM_MAP_REGION_FLAG_INVALID (1<<19) /* indicates that flags are not specified */
#define VM_MAP_REGION_FLAG_LITEIPC (1<<19)
#define VM_MAP_REGION_FLAG_INVALID (1<<20) /* indicates that flags are not specified */
STATIC INLINE UINT32 OsCvtProtFlagsToRegionFlags(unsigned long prot, unsigned long flags)
{

View File

@ -103,7 +103,7 @@ STATIC VOID SortQueueIndexArray(UINT32 *indexArray, UINT32 count)
IpcSortParam queueSortParam;
queueSortParam.buf = (CHAR *)g_queueDebugArray;
queueSortParam.ipcDebugCBSize = sizeof(QueueDebugCB);
queueSortParam.ipcDebugCBCnt = LOSCFG_BASE_IPC_SEM_LIMIT;
queueSortParam.ipcDebugCBCnt = LOSCFG_BASE_IPC_QUEUE_LIMIT;
queueSortParam.sortElemOff = LOS_OFF_SET_OF(QueueDebugCB, lastAccessTime);
if (count > 0) {

View File

@ -887,7 +887,7 @@ STATIC UINT32 OsMemPoolInit(VOID *pool, UINT32 size)
}
#ifdef LOSCFG_MEM_MUL_POOL
STATIC VOID OsMemPoolDeinit(const VOID *pool, UINT32 size)
STATIC VOID OsMemPoolDeInit(const VOID *pool, UINT32 size)
{
#ifdef LOSCFG_KERNEL_LMS
if (g_lms != NULL) {

View File

@ -379,6 +379,7 @@ LITE_OS_SEC_TEXT_MINOR UINT32 OsShellCmdTskInfoGet(UINT32 processID, VOID *seqBu
(VOID)memset_s(threadInfo, sizeof(ProcessThreadInfo), 0, sizeof(ProcessThreadInfo));
if (OsGetProcessThreadInfo(processID, threadInfo) != LOS_OK) {
(VOID)LOS_MemFree(m_aucSysMem1, threadInfo);
return LOS_NOK;
}

View File

@ -76,6 +76,8 @@ const CHAR *OsGetRegionNameOrFilePath(LosVmMapRegion *region)
return "MMAP";
} else if (region->regionFlags & VM_MAP_REGION_FLAG_SHM) {
return "SHM";
} else if (region->regionFlags & VM_MAP_REGION_FLAG_LITEIPC) {
return "LITEIPC";
} else {
return "";
}

View File

@ -261,7 +261,7 @@ STATIC UINT32 GetDirtySize(LosFilePage *fpage, struct Vnode *vnode)
STATIC INT32 OsFlushDirtyPage(LosFilePage *fpage)
{
UINT32 ret;
ssize_t ret;
size_t len;
char *buff = NULL;
struct Vnode *vnode = fpage->mapping->host;

View File

@ -273,6 +273,8 @@ STATIC UINT32 OsInheritOldRegionName(UINT32 oldRegionFlags)
vmFlags |= VM_MAP_REGION_FLAG_MMAP;
} else if (oldRegionFlags & VM_MAP_REGION_FLAG_SHM) {
vmFlags |= VM_MAP_REGION_FLAG_SHM;
} else if (oldRegionFlags & VM_MAP_REGION_FLAG_LITEIPC) {
vmFlags |= VM_MAP_REGION_FLAG_LITEIPC;
}
return vmFlags;
@ -298,7 +300,9 @@ INT32 LOS_DoMprotect(VADDR_T vaddr, size_t len, unsigned long prot)
goto OUT_MPROTECT;
}
if ((region->regionFlags & VM_MAP_REGION_FLAG_VDSO) || (region->regionFlags & VM_MAP_REGION_FLAG_HEAP)) {
if ((region->regionFlags & VM_MAP_REGION_FLAG_VDSO) ||
(region->regionFlags & VM_MAP_REGION_FLAG_HEAP) ||
(region->regionFlags & VM_MAP_REGION_FLAG_LITEIPC)) {
ret = -EPERM;
goto OUT_MPROTECT;
}

View File

@ -689,6 +689,9 @@ INT32 ShmCtl(INT32 shmid, INT32 cmd, struct shmid_ds *buf)
(shm_perm.mode & ACCESSPERMS);
seg->ds.shm_ctime = time(NULL);
#ifdef LOSCFG_SHELL
if (OsProcessIDUserCheckInvalid(shm_perm.uid)) {
break;
}
(VOID)memcpy_s(seg->ownerName, OS_PCB_NAME_LEN, OS_PCB_FROM_PID(shm_perm.uid)->processName,
OS_PCB_NAME_LEN);
#endif

View File

@ -687,7 +687,7 @@ STATIC ssize_t ConsoleRead(struct file *filep, CHAR *buffer, size_t bufLen)
}
if (userBuf) {
if (LOS_ArchCopyToUser(buffer, sbuffer, bufLen) != 0) {
if (LOS_ArchCopyToUser(buffer, sbuffer, ret) != 0) {
ret = -EFAULT;
goto ERROUT;
}

View File

@ -32,6 +32,7 @@ import("//kernel/liteos_a/liteos.gni")
group("extended") {
deps = [
"blackbox",
"container",
"cppsupport",
"cpup",
"dynload",
@ -52,6 +53,7 @@ group("extended") {
config("public") {
configs = [
"blackbox:public",
"container:public",
"cpup:public",
"dynload:public",
"hidumper:public",

View File

@ -113,6 +113,54 @@ config KERNEL_HOOK
default n
depends on KERNEL_EXTKERNEL && DEBUG_VERSION
######################### config options of container ####################
config KERNEL_CONTAINER
bool "Enable container Feature"
default n
depends on KERNEL_VM
config PID_CONTAINER
bool "Enable pid container Feature"
default n
depends on KERNEL_CONTAINER
config UTS_CONTAINER
bool "Enable uts container Feature"
default n
depends on KERNEL_CONTAINER
config MNT_CONTAINER
bool "Enable mnt container Feature"
default n
depends on KERNEL_CONTAINER
config CHROOT
bool "Enable chroot"
default n
depends on MNT_CONTAINER
config IPC_CONTAINER
bool "Enable ipc container Feature"
default n
depends on KERNEL_CONTAINER
config TIME_CONTAINER
bool "Enable time container"
default n
depends on KERNEL_CONTAINER
config USER_CONTAINER
bool "Enable user container"
default n
depends on KERNEL_CONTAINER
config NET_CONTAINER
bool "Enable net container"
default n
depends on KERNEL_CONTAINER
######################### config options of trace #########################
source "kernel/extended/trace/Kconfig"

View File

@ -0,0 +1,65 @@
# Copyright (c) 2023-2023 Huawei Device Co., Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of
# conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
# of conditions and the following disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be used
# to endorse or promote products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//kernel/liteos_a/liteos.gni")
module_switch = defined(LOSCFG_KERNEL_CONTAINER)
module_name = get_path_info(rebase_path("."), "name")
kernel_module(module_name) {
sources = [ "los_container.c" ]
if (defined(LOSCFG_IPC_CONTAINER)) {
sources += [ "los_ipc_container.c" ]
}
if (defined(LOSCFG_MNT_CONTAINER)) {
sources += [ "los_mnt_container.c" ]
}
if (defined(LOSCFG_NET_CONTAINER)) {
sources += [ "los_net_container.c" ]
}
if (defined(LOSCFG_PID_CONTAINER)) {
sources += [ "los_pid_container.c" ]
}
if (defined(LOSCFG_TIME_CONTAINER)) {
sources += [ "los_time_container.c" ]
}
if (defined(LOSCFG_USER_CONTAINER)) {
sources += [
"los_credentials.c",
"los_user_container.c",
]
}
if (defined(LOSCFG_UTS_CONTAINER)) {
sources += [ "los_uts_container.c" ]
}
public_configs = [ ":public" ]
}
config("public") {
include_dirs = [ "." ]
}

View File

@ -0,0 +1,63 @@
# Copyright (c) 2023-2023 Huawei Device Co., Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of
# conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
# of conditions and the following disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be used
# to endorse or promote products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
include $(LITEOSTOPDIR)/config.mk
MODULE_NAME := $(notdir $(shell pwd))
LOCAL_SRCS := $(wildcard *.c)
ifneq ($(LOSCFG_IPC_CONTAINER), y)
LOCAL_SRCS += $(filter-out los_ipc_container.c, $(LOCAL_SRCS))
endif
ifneq ($(LOSCFG_MNT_CONTAINER), y)
LOCAL_SRCS += $(filter-out los_mnt_container.c, $(LOCAL_SRCS))
endif
ifneq ($(LOSCFG_NET_CONTAINER), y)
LOCAL_SRCS += $(filter-out los_net_container.c, $(LOCAL_SRCS))
endif
ifneq ($(LOSCFG_PID_CONTAINER), y)
LOCAL_SRCS += $(filter-out los_pid_container.c, $(LOCAL_SRCS))
endif
ifneq ($(LOSCFG_TIME_CONTAINER), y)
LOCAL_SRCS += $(filter-out los_time_container.c, $(LOCAL_SRCS))
endif
ifneq ($(LOSCFG_USER_CONTAINER), y)
LOCAL_SRCS += $(filter-out los_credentials.c los_user_container.c, $(LOCAL_SRCS))
endif
ifneq ($(LOSCFG_UTS_CONTAINER), y)
LOCAL_SRCS += $(filter-out los_uts_container.c, $(LOCAL_SRCS))
endif
include $(MODULE)

View File

@ -278,7 +278,6 @@ static void DumpFaultLog(void)
static void DumpMemData(struct MemDumpParam *param)
{
PRINTK("\nDumpType: %d\n", param->type);
PRINTK("Unsupported now!\n");
}

View File

@ -33,7 +33,7 @@ module_switch = defined(LOSCFG_BASE_CORE_HILOG)
module_name = get_path_info(rebase_path("."), "name")
kernel_module(module_name) {
sources = [
"//base/hiviewdfx/hilog_lite/frameworks/featured/hiview_log.c",
"$HIVIEWDFX_HILOG_LITE_DIR/frameworks/featured/hiview_log.c",
"los_hilog.c",
]
@ -42,8 +42,8 @@ kernel_module(module_name) {
config("public") {
include_dirs = [
"//base/hiviewdfx/hilog_lite/interfaces/native/kits",
"//base/hiviewdfx/hilog_lite/interfaces/native/kits/hilog",
"$HIVIEWDFX_HILOG_LITE_DIR/interfaces/native/kits",
"$HIVIEWDFX_HILOG_LITE_DIR/interfaces/native/kits/hilog",
".",
]
}

View File

@ -239,6 +239,7 @@ LITE_OS_SEC_TEXT STATIC int LiteIpcMmap(struct file *filep, LosVmMapRegion *regi
goto ERROR_MAP_OUT;
}
ipcInfo->pool.poolSize = region->range.size;
region->regionFlags |= VM_MAP_REGION_FLAG_LITEIPC;
return 0;
ERROR_MAP_OUT:
LOS_VFree(ipcInfo->pool.kvaddr);
@ -757,7 +758,10 @@ LITE_OS_SEC_TEXT STATIC UINT32 HandlePtr(LosProcessCB *pcb, SpecialObj *obj, BOO
obj->content.ptr.buff = (VOID *)GetIpcUserAddr(pcb, (INTPTR)buf);
EnableIpcNodeFreeByUser(pcb, (VOID *)buf);
} else {
(VOID)LiteIpcNodeFree(pcb, (VOID *)GetIpcKernelAddr(pcb, (INTPTR)obj->content.ptr.buff));
buf = (VOID *)GetIpcKernelAddr(pcb, (INTPTR)obj->content.ptr.buff);
if (IsIpcNode(pcb, buf) == TRUE) {
(VOID)LiteIpcNodeFree(pcb, buf);
}
}
return LOS_OK;
}

View File

@ -28,7 +28,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//kernel/liteos_a/liteos.gni")
import("//third_party/NuttX/NuttX.gni")
import("$THIRDPARTY_NUTTX_DIR/NuttX.gni")
module_switch = defined(LOSCFG_KERNEL_PIPE)
module_name = get_path_info(rebase_path("."), "name")

View File

@ -485,29 +485,35 @@ UINT32 OsDevLimitWriteDeny(ProcLimitSet *plimit, const CHAR *buf, UINT32 size)
return DevLimitUpdateAccess(plimit, buf, DEVLIMIT_DENY);
}
STATIC VOID DevLimitItemSetAccess(CHAR *acc, INT16 access)
STATIC VOID DevLimitItemSetAccess(CHAR *accArray, INT16 access)
{
INT32 index = 0;
(VOID)memset_s(acc, ACCLEN, 0, ACCLEN);
(VOID)memset_s(accArray, ACCLEN, 0, ACCLEN);
if (access & DEVLIMIT_ACC_READ) {
acc[index++] = 'r';
accArray[index] = 'r';
index++;
}
if (access & DEVLIMIT_ACC_WRITE) {
acc[index++] = 'w';
accArray[index] = 'w';
index++;
}
if (access & DEVLIMIT_ACC_MKNOD) {
acc[index++] = 'm';
accArray[index] = 'm';
index++;
}
}
STATIC CHAR DevLimitItemTypeToChar(INT16 type)
{
if (type == DEVLIMIT_DEV_ALL) {
return 'a';
} else if (type == DEVLIMIT_DEV_CHAR) {
return 'c';
} else if (type == DEVLIMIT_DEV_BLOCK) {
return 'b';
switch (type) {
case DEVLIMIT_DEV_ALL:
return 'a';
case DEVLIMIT_DEV_CHAR:
return 'c';
case DEVLIMIT_DEV_BLOCK:
return 'b';
default:
break;
}
return 'X';
}

View File

@ -28,11 +28,8 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//kernel/liteos_a/liteos.gni")
MUSLDIR = "$LITEOSTHIRDPARTY/musl"
import("//third_party/optimized-routines/optimized-routines.gni")
import("$MUSLDIR/porting/liteos_a/kernel/musl.gni")
import("$THIRDPARTY_MUSL_DIR/porting/liteos_a/kernel/musl.gni")
import("$THIRDPARTY_OPTIMIZED_ROUTINES_DIR/optimized-routines.gni")
module_switch = defined(LOSCFG_LIBC_MUSL)
module_name = get_path_info(rebase_path("."), "name")

View File

@ -27,7 +27,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//kernel/liteos_a/liteos.gni")
import("//third_party/musl/porting/liteos_a_newlib/kernel/newlib.gni")
import("$THIRDPARTY_MUSL_DIR/porting/liteos_a_newlib/kernel/newlib.gni")
module_switch = defined(LOSCFG_LIBC_NEWLIB)
module_name = get_path_info(rebase_path("."), "name")

View File

@ -28,7 +28,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//kernel/liteos_a/liteos.gni")
import("//third_party/FreeBSD/FreeBSD.gni")
import("$THIRDPARTY_FREEBSD_DIR/FreeBSD.gni")
module_name = get_path_info(rebase_path("."), "name")
kernel_module(module_name) {

View File

@ -28,7 +28,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//kernel/liteos_a/liteos.gni")
import("//third_party/bounds_checking_function/libsec_src.gni")
import("$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR/libsec_src.gni")
module_switch = defined(LOSCFG_LIB_LIBC)
module_name = get_path_info(rebase_path("."), "name")

View File

@ -32,6 +32,19 @@ import("$root_out_dir/config.gni")
LITEOSTOPDIR = "//kernel/liteos_a"
LITEOSTHIRDPARTY = "//third_party"
HDFTOPDIR = "//drivers/hdf_core/adapter/khdf/liteos"
HIVIEWDFX_HILOG_LITE_DIR = "//base/hiviewdfx/hilog_lite"
DRIVERS_LITEOS_DIR = "//drivers/liteos"
THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR =
"//third_party/bounds_checking_function"
THIRDPARTY_FATFS_DIR = "//third_party/FatFs"
THIRDPARTY_NUTTX_DIR = "//third_party/NuttX"
THIRDPARTY_MUSL_DIR = "//third_party/musl"
THIRDPARTY_TOYBOX_DIR = "//third_party/toybox"
THIRDPARTY_MKSH_DIR = "//third_party/mksh"
THIRDPARTY_FREEBSD_DIR = "//third_party/FreeBSD"
THIRDPARTY_OPTIMIZED_ROUTINES_DIR = "//third_party/optimized-routines"
THIRDPARTY_GOOGLETEST_DIR = "//third_party/googletest"
KERNEL_LINUX_DIR = "//kernel/linux/linux-5.10"
ARCH = ""
if (defined(LOSCFG_ARCH_ARM_AARCH32)) {
@ -135,8 +148,8 @@ set_defaults("kernel_module") {
"$LITEOSTOPDIR:los_config",
]
visibility = [
"$LITEOSTOPDIR:*",
":*",
"$LITEOSTOPDIR:*",
"..:*",
"../..:*",
]

View File

@ -154,7 +154,6 @@ INT32 CmdLog(INT32 argc, const CHAR **argv)
PRINTK("not support yet\n");
}
} else if (!strncmp(argv[0], "path", strlen(argv[0]) + 1)) {
OsLkLogFileSet(argv[1]);
PRINTK("not support yet\n");
} else {
PRINTK("Usage: log level <num>\n");

View File

@ -94,9 +94,15 @@ int SysMqClose(mqd_t personal)
int SysMqNotify(mqd_t personal, const struct sigevent *sigev)
{
int ret;
struct sigevent ksigev;
ret = LOS_ArchCopyFromUser(&ksigev, sigev, sizeof(struct sigevent));
if (ret != 0) {
return -EFAULT;
}
MQUEUE_FD_U2K(personal);
ret = OsMqNotify(personal, sigev);
ret = OsMqNotify(personal, &ksigev);
if (ret < 0) {
return -get_errno();
}

View File

@ -401,7 +401,7 @@ ssize_t SysSendMsg(int s, const struct msghdr *message, int flags)
CHECK_ASPACE(message, sizeof(struct msghdr));
CPY_FROM_CONST_USER(struct msghdr, message);
if (message && message->msg_iovlen > IOV_MAX) {
if (message && (size_t)message->msg_iovlen > IOV_MAX) {
set_errno(EMSGSIZE);
return -get_errno();
}
@ -449,7 +449,7 @@ ssize_t SysRecvMsg(int s, struct msghdr *message, int flags)
CHECK_ASPACE(message, sizeof(struct msghdr));
CPY_FROM_NONCONST_USER(message);
if (message && message->msg_iovlen > IOV_MAX) {
if (message && (size_t)message->msg_iovlen > IOV_MAX) {
set_errno(EMSGSIZE);
return -get_errno();
}

View File

@ -45,8 +45,8 @@ config("liteos_kernel_test_public") {
"$LITEOSTOPDIR/arch/arm/arm/include",
"$LITEOSTOPDIR/arch/arm/include",
"$LITEOSTOPDIR/extended/include",
"//third_party/musl/porting/liteos_a/kernel/include",
"//third_party/bounds_checking_function/include/",
"$THIRDPARTY_MUSL_DIR/porting/liteos_a/kernel/include",
"$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR/include/",
"$LITEOSTOPDIR/lib/libscrew/include",
"$LITEOSTOPDIR/fs/vfs",
"$LITEOSTOPDIR/fs/proc/include",

View File

@ -67,6 +67,8 @@ config("public_config_for_pressure") {
group("unittest") {
deps = []
if (ohos_build_type == "debug") {
deps += [ "tools:liteos_unittest_run" ]
# basic test
if (LOSCFG_USER_TEST_BASIC == true) {
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
@ -113,10 +115,24 @@ group("unittest") {
# libc test
if (LOSCFG_USER_TEST_LIBC == true) {
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
deps += [ "libc:liteos_a_libc_unittest_door" ]
deps += [
"libc/io:liteos_a_libc_io_unittest_door",
"libc/misc:liteos_a_libc_misc_unittest_door",
"libc/posix:liteos_a_libc_posix_unittest_door",
"libc/sys:liteos_a_libc_sys_unittest_door",
"libc/time:liteos_a_libc_time_unittest_door",
"libc/util:liteos_a_libc_util_unittest_door",
]
}
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) {
deps += [ "libc:liteos_a_libc_unittest" ]
deps += [
"libc/io:liteos_a_libc_io_unittest",
"libc/misc:liteos_a_libc_misc_unittest",
"libc/posix:liteos_a_libc_posix_unittest",
"libc/sys:liteos_a_libc_sys_unittest",
"libc/time:liteos_a_libc_time_unittest",
"libc/util:liteos_a_libc_util_unittest",
]
}
}
@ -133,8 +149,11 @@ group("unittest") {
# process test
if (LOSCFG_USER_TEST_PROCESS_THREAD == true) {
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
deps += [ "process/basic:liteos_a_process_basic_unittest_door" ]
deps += [ "process/lock:liteos_a_process_lock_unittest_door" ]
deps += [
"process/basic/process:liteos_a_process_basic_process_unittest_door",
"process/basic/pthread:liteos_a_process_basic_pthread_unittest_door",
"process/lock:liteos_a_process_lock_unittest_door",
]
if (LOSCFG_USER_TEST_PROCESS_FS == true) {
deps += [ "process/fs:liteos_a_process_fs_unittest_door" ]
}
@ -143,8 +162,11 @@ group("unittest") {
}
}
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) {
deps += [ "process/basic:liteos_a_process_basic_unittest" ]
deps += [ "process/lock:liteos_a_process_lock_unittest" ]
deps += [
"process/basic/process:liteos_a_process_basic_process_unittest",
"process/basic/pthread:liteos_a_process_basic_pthread_unittest",
"process/lock:liteos_a_process_lock_unittest",
]
if (LOSCFG_USER_TEST_PROCESS_FS == true) {
deps += [ "process/fs:liteos_a_process_fs_unittest" ]
}

View File

@ -26,8 +26,6 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
import("./config.gni")
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
@ -40,7 +38,7 @@ if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
sources_full = []
sources += sources_full
configs = [ "..:public_config_for_door" ]
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
deps = [ "$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR:libsec_shared" ]
}
}
@ -53,6 +51,6 @@ if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) {
sources += sources_smoke
sources += sources_full
configs = [ "..:public_config_for_all" ]
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
deps = [ "$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR:libsec_shared" ]
}
}

View File

@ -27,10 +27,11 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/liteos.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
common_include_dirs = [
"//third_party/googletest/googletest/include",
"$THIRDPARTY_GOOGLETEST_DIR/googletest/include",
"../common/include",
]

View File

@ -1,6 +1,6 @@
/*
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
@ -42,40 +42,52 @@ static int Testcase(void)
char *workingPath = "/usr/bin";
void *handle = nullptr;
int (*func)(int);
char curPath[1024] = { 0 }; /* 1024, buffer size */
handle = getcwd(curPath, sizeof(curPath));
ICUNIT_ASSERT_NOT_EQUAL(handle, NULL, handle);
ret = chdir(workingPath);
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
handle = dlopen(NULL, RTLD_NOW | RTLD_LOCAL);
ICUNIT_ASSERT_NOT_EQUAL(handle, NULL, handle);
ICUNIT_GOTO_NOT_EQUAL(handle, NULL, 1, EXIT1); /* 1, return value */
ret = dlclose(handle);
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
handle = dlopen(LIBCSO_REAL_PATH, RTLD_NOW);
ICUNIT_ASSERT_NOT_EQUAL(handle, NULL, handle);
ICUNIT_GOTO_NOT_EQUAL(handle, NULL, 1, EXIT1); /* 1, return value */
func = reinterpret_cast<int (*)(int)>(dlsym(handle, SYMBOL_TO_FIND));
ICUNIT_GOTO_NOT_EQUAL(func, NULL, func, EXIT);
ICUNIT_GOTO_EQUAL(func, SYMBOL_TO_MATCH, func, EXIT);
ret = dlclose(handle);
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
handle = dlopen(LIBCSO_RELATIVE_PATH, RTLD_NOW);
ICUNIT_ASSERT_NOT_EQUAL(handle, NULL, handle);
ICUNIT_GOTO_NOT_EQUAL(handle, NULL, 1, EXIT1); /* 1, return value */
func = reinterpret_cast<int (*)(int)>(dlsym(handle, SYMBOL_TO_FIND));
ICUNIT_GOTO_NOT_EQUAL(func, NULL, func, EXIT);
ret = dlclose(handle);
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
ret = chdir(curPath);
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1);
return 0;
EXIT:
dlclose(handle);
return 0;
EXIT1:
ret = chdir(curPath);
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
return 1; /* 1, return value */
}
void ItTestDynload002(void)

View File

@ -1,5 +1,5 @@
# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
# Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
@ -64,11 +64,11 @@ LOSCFG_USER_TEST_MEM_VM = true
LOSCFG_USER_TEST_PROCESS_THREAD = true
# Module list
LOSCFG_USER_TEST_MUTEX = true
LOSCFG_USER_TEST_PROCESS = true
LOSCFG_USER_TEST_PTHREAD = true
LOSCFG_USER_TEST_RWLOCK = true
LOSCFG_USER_TEST_SPINLOCK = true
LOSCFG_USER_TEST_PROCESS_BASIC_PROCESS = true
LOSCFG_USER_TEST_PROCESS_BASIC_PTHREAD = true
LOSCFG_USER_TEST_PROCESS_LOCK_MUTEX = true
LOSCFG_USER_TEST_PROCESS_LOCK_RWLOCK = true
LOSCFG_USER_TEST_PROCESS_LOCK_SPINLOCK = true
########## extended test ##########
# Control switch for extended function test
@ -102,15 +102,15 @@ LOSCFG_USER_TEST_FS_VFAT = false
LOSCFG_USER_TEST_LIBC = true
# Module list
LOSCFG_USER_TEST_IO = true
LOSCFG_USER_TEST_MISC = true
LOSCFG_USER_TEST_POSIX_MEM = true
LOSCFG_USER_TEST_POSIX_MQUEUE = true
LOSCFG_USER_TEST_POSIX_PTHREAD = false
LOSCFG_USER_TEST_SYS = true
LOSCFG_USER_TEST_TIME_CLOCK = true
LOSCFG_USER_TEST_TIME_TIMER = true
LOSCFG_USER_TEST_UTIL = true
LOSCFG_USER_TEST_LIBC_IO = true
LOSCFG_USER_TEST_LIBC_MISC = true
LOSCFG_USER_TEST_LIBC_POSIX_MEM = true
LOSCFG_USER_TEST_LIBC_POSIX_MQUEUE = true
LOSCFG_USER_TEST_LIBC_POSIX_PTHREAD = false
LOSCFG_USER_TEST_LIBC_SYS = true
LOSCFG_USER_TEST_LIBC_TIME_CLOCK = true
LOSCFG_USER_TEST_LIBC_TIME_TIMER = true
LOSCFG_USER_TEST_LIBC_UTIL = true
########## net test ##########
# Control switch for network function test

View File

@ -26,8 +26,6 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
import("./config.gni")
config("container_config") {
@ -69,7 +67,7 @@ if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
"..:public_config_for_door",
":container_config",
]
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
deps = [ "$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR:libsec_shared" ]
}
}
@ -85,6 +83,6 @@ if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) {
"..:public_config_for_all",
":container_config",
]
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
deps = [ "$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR:libsec_shared" ]
}
}

View File

@ -26,10 +26,12 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/liteos.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
common_include_dirs = [
"//third_party/googletest/googletest/include",
"$THIRDPARTY_GOOGLETEST_DIR/googletest/include",
"../common/include",
"$TEST_UNITTEST_DIR/container",
]

View File

@ -26,8 +26,6 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
import("./config.gni")
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
@ -40,7 +38,7 @@ if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
sources_full = []
sources += sources_full
configs = [ "..:public_config_for_door" ]
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
deps = [ "$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR:libsec_shared" ]
}
}
@ -53,6 +51,6 @@ if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) {
sources += sources_smoke
sources += sources_full
configs = [ "..:public_config_for_all" ]
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
deps = [ "$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR:libsec_shared" ]
}
}

View File

@ -27,10 +27,11 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/liteos.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
common_include_dirs = [
"//third_party/googletest/googletest/include",
"$THIRDPARTY_GOOGLETEST_DIR/googletest/include",
"../common/include",
]

View File

@ -26,8 +26,6 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
import("./config.gni")
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
@ -40,7 +38,7 @@ if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
sources_full = []
sources += sources_full
configs = [ "..:public_config_for_door" ]
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
deps = [ "$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR:libsec_shared" ]
}
}
@ -53,6 +51,6 @@ if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) {
sources += sources_smoke
sources += sources_full
configs = [ "..:public_config_for_all" ]
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
deps = [ "$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR:libsec_shared" ]
}
}

View File

@ -27,10 +27,11 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/liteos.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
common_include_dirs = [
"//third_party/googletest/googletest/include",
"$THIRDPARTY_GOOGLETEST_DIR/googletest/include",
"../common/include",
]

View File

@ -53,7 +53,7 @@ static UINT32 Testcase(VOID)
ret = write(pipeFd[1], "hello world", 12); // 12, "hello world" length and '\0'
printf("write first status: %d\n", ret);
if (ret != 12) { // 12, "hello world" length and '\0'
exit(11); // 11, the value of son process unexpect exit, convenient to debug
exit(11); // 11, the value of son process unexpected exit, convenient to debug
}
*sharedflag = 1;
close(pipeFd[1]);

View File

@ -55,7 +55,7 @@ static UINT32 Testcase(VOID)
ret = write(pipeFd[1], "Hello world", TAR_STR_LEN);
printf("write first status: %d\n", ret);
if (ret != TAR_STR_LEN) {
exit(11); // 11, the value of son process unexpect exit, convenient to debug
exit(11); // 11, the value of son process unexpected exit, convenient to debug
}
*sharedflag = 1;
close(pipeFd[1]);

View File

@ -69,7 +69,7 @@ static UINT32 Testcase(VOID)
ret = sigaction(SIGCHLD, &oldact, NULL);
if (ret == -1) {
exit(6); // 6, the value of son process unexpect exit, convenient to debug
exit(6); // 6, the value of son process unexpected exit, convenient to debug
}
sleep(1);
printf("---son--cnt check----%d--------\n", g_actionCnt1);

View File

@ -90,31 +90,31 @@ static int TestCase(void)
printf("errline = %d\n", __LINE__);
exit(-1);
}
ret = kill(10, 31); // 10, kill process pid; 31, sigal.
ret = kill(10, 31); // 10, kill process pid; 31, signal.
if (retValue != -1 || errno != EINVAL) {
printf("errline = %d\n", __LINE__);
exit(-1);
}
ret = kill(10, 32); // 10, kill process pid; 32, sigal.
ret = kill(10, 32); // 10, kill process pid; 32, signal.
if (retValue != -1 || errno != EINVAL) {
printf("errline = %d\n", __LINE__);
exit(-1);
}
ret = kill(2, 32); // 2, kill process pid; 32, sigal.
ret = kill(2, 32); // 2, kill process pid; 32, signal.
if (retValue != -1 || errno != EINVAL) {
printf("errline = %d\n", __LINE__);
exit(-1);
}
printf("test EPERM begin\n");
ret = kill(2, 5); // 2, kill process pid; 5, sigal.
ret = kill(2, 5); // 2, kill process pid; 5, signal.
if (retValue != -1 || errno != EPERM) {
printf("errline = %d\n", __LINE__);
exit(-1);
}
ret = kill(3, 5); // 3, kill process pid; 5, sigal.
ret = kill(3, 5); // 3, kill process pid; 5, signal.
if (retValue != -1 || errno != EPERM) {
printf("errline = %d\n", __LINE__);
exit(-1);
@ -126,7 +126,7 @@ static int TestCase(void)
exit(-1);
}
ret = kill(1, 5); // 5, kill sigal num .
ret = kill(1, 5); // 5, kill signal num .
if (retValue != -1 || errno != EPERM) {
printf("errline = %d\n", __LINE__);
exit(-1);

View File

@ -40,7 +40,7 @@ static void SigChildResponse(int signo)
wait(nullptr);
}
/* Register SIGCHLD, through signal to restore the child memery */
/* Register SIGCHLD, through signal to restore the child memory */
static int TestSigKillResp()
{
void (*ret)(int) = nullptr;

View File

@ -38,7 +38,7 @@ void SigChildResponse(int signo)
wait(nullptr);
}
/* Register SIGCHLD, through signal to restore the child memery */
/* Register SIGCHLD, through signal to restore the child memory */
static int TestSigKillWaitFromSigChild()
{
void (*ret)(int);

View File

@ -88,7 +88,7 @@ static int TestBlock()
printf("\n\n");
printf("Signal Pause(2)\n");
printf("To test whether pause can relese the signal\n");
printf("To test whether pause can release the signal\n");
alarm(clock);
retValue = sighold(sig);
if (retValue != 0) {

View File

@ -67,7 +67,7 @@ static UINT32 TestCase()
sigemptyset(&set);
sigprocmask(SIG_SETMASK, &set, NULL);
printf("check invlid sigset ...\n");
printf("check invalid sigset ...\n");
int rt = sigaddset(&set, 0);
ICUNIT_ASSERT_EQUAL(rt, -1, rt);
ICUNIT_ASSERT_EQUAL(errno, EINVAL, errno);
@ -79,19 +79,19 @@ static UINT32 TestCase()
siginfo_t si;
time1.tv_sec = -1;
printf("check invlid timespec: tv_sec=-1 ...\n");
printf("check invalid timespec: tv_sec=-1 ...\n");
ret = SigtimedwaitFailTest(&set, &si, &time1, EINVAL);
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
time1.tv_sec = 1;
time1.tv_nsec = -1;
printf("check invlid timespec: tv_nsec=-1 ...\n");
printf("check invalid timespec: tv_nsec=-1 ...\n");
ret = SigtimedwaitFailTest(&set, &si, &time1, EINVAL);
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
time1.tv_sec = 1;
time1.tv_nsec = 1000 * 1000 * 1000 + 1; // 1000, set the nsec of time.
printf("check invlid timespec: tv_nsec overflow ...\n");
printf("check invalid timespec: tv_nsec overflow ...\n");
ret = SigtimedwaitFailTest(&set, &si, &time1, EINVAL);
ICUNIT_ASSERT_EQUAL(ret, 0, ret);

View File

@ -27,8 +27,6 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
import("./config.gni")
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
@ -43,7 +41,7 @@ if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
sources_pressure = []
sources += sources_pressure
configs = [ "..:public_config_for_door" ]
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
deps = [ "$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR:libsec_shared" ]
}
}
@ -58,7 +56,7 @@ if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) {
sources_pressure = []
sources += sources_pressure
configs = [ "..:public_config_for_all" ]
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
deps = [ "$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR:libsec_shared" ]
}
}
@ -74,6 +72,6 @@ if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_HIGH) {
sources += sources_full
sources += sources_pressure
configs = [ "..:public_config_for_pressure" ]
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
deps = [ "$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR:libsec_shared" ]
}
}

View File

@ -27,10 +27,11 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/liteos.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
common_include_dirs = [
"//third_party/googletest/googletest/include",
"$THIRDPARTY_GOOGLETEST_DIR/googletest/include",
"../common/include",
]

View File

@ -1,121 +0,0 @@
# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of
# conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
# of conditions and the following disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be used
# to endorse or promote products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
common_include_dirs = [
"//third_party/googletest/googletest/include",
"../common/include",
]
sources_entry = [ "../common/osTest.cpp" ]
sources_smoke = []
sources_full = []
# io module
if (LOSCFG_USER_TEST_IO == true) {
import("./io/config.gni")
common_include_dirs += io_include_dirs
sources_entry += io_sources_entry
sources_smoke += io_sources_smoke
sources_full += io_sources_full
}
# misc module
if (LOSCFG_USER_TEST_MISC == true) {
import("./misc/config.gni")
common_include_dirs += misc_include_dirs
sources_entry += misc_sources_entry
sources_smoke += misc_sources_smoke
sources_full += misc_sources_full
}
# posix mem module
if (LOSCFG_USER_TEST_POSIX_MEM == true) {
import("./posix/mem/config.gni")
common_include_dirs += posix_mem_include_dirs
sources_entry += posix_mem_sources_entry
sources_smoke += posix_mem_sources_smoke
sources_full += posix_mem_sources_full
}
# posix mqueue module
if (LOSCFG_USER_TEST_POSIX_MQUEUE == true) {
import("./posix/mqueue/config.gni")
common_include_dirs += posix_mqueue_include_dirs
sources_entry += posix_mqueue_sources_entry
sources_smoke += posix_mqueue_sources_smoke
sources_full += posix_mqueue_sources_full
}
# posix pthread module
if (LOSCFG_USER_TEST_POSIX_PTHREAD == true) {
import("./posix/pthread/config.gni")
common_include_dirs += posix_pthread_include_dirs
sources_entry += posix_pthread_sources_entry
sources_smoke += posix_pthread_sources_smoke
sources_full += posix_pthread_sources_full
}
# sys module
if (LOSCFG_USER_TEST_SYS == true) {
import("./sys/config.gni")
common_include_dirs += sys_include_dirs
sources_entry += sys_sources_entry
sources_smoke += sys_sources_smoke
sources_full += sys_sources_full
}
# time module
if (LOSCFG_USER_TEST_TIME_CLOCK == true) {
import("./time/clock/config.gni")
common_include_dirs += time_clock_include_dirs
sources_entry += time_clock_sources_entry
sources_smoke += time_clock_sources_smoke
sources_full += time_clock_sources_full
}
if (LOSCFG_USER_TEST_TIME_TIMER == true) {
import("./time/timer/config.gni")
common_include_dirs += time_timer_include_dirs
sources_entry += time_timer_sources_entry
sources_smoke += time_timer_sources_smoke
sources_full += time_timer_sources_full
}
# util module
if (LOSCFG_USER_TEST_UTIL == true) {
import("./util/config.gni")
common_include_dirs += util_include_dirs
sources_entry += util_sources_entry
sources_smoke += util_sources_smoke
sources_full += util_sources_full
}

View File

@ -1,4 +1,4 @@
# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved.
# Copyright (c) 2022-2023 Huawei Device Co., Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
@ -26,20 +26,18 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
import("./config.gni")
config("libc_config") {
if (LOSCFG_USER_TEST_POSIX_MQUEUE == true ||
LOSCFG_USER_TEST_POSIX_PTHREAD == true) {
if (LOSCFG_USER_TEST_LIBC_POSIX_MQUEUE == true ||
LOSCFG_USER_TEST_LIBC_POSIX_PTHREAD == true) {
cflags = [ "-O1" ]
cflags_cc = cflags
}
}
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
unittest("liteos_a_libc_unittest_door") {
unittest("liteos_a_libc_io_unittest_door") {
output_extension = "bin"
output_dir = "$root_out_dir/test/unittest/kernel"
include_dirs = common_include_dirs
@ -47,22 +45,22 @@ if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
sources += sources_smoke
sources_full = []
sources += sources_full
configs = [ "..:public_config_for_door" ]
configs = [ "../..:public_config_for_door" ]
configs += [ ":libc_config" ]
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
deps = [ "$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR:libsec_shared" ]
}
}
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) {
unittest("liteos_a_libc_unittest") {
unittest("liteos_a_libc_io_unittest") {
output_extension = "bin"
output_dir = "$root_out_dir/test/unittest/kernel"
include_dirs = common_include_dirs
sources = sources_entry
sources += sources_smoke
sources += sources_full
configs = [ "..:public_config_for_all" ]
configs = [ "../..:public_config_for_all" ]
configs += [ ":libc_config" ]
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
deps = [ "$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR:libsec_shared" ]
}
}

View File

@ -1,4 +1,4 @@
# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved.
# Copyright (c) 2022-2023 Huawei Device Co., Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
@ -26,20 +26,33 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/liteos.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
io_include_dirs = [ "$TEST_UNITTEST_DIR/libc/io" ]
common_include_dirs = [
"$THIRDPARTY_GOOGLETEST_DIR/googletest/include",
"../../common/include",
]
io_sources_entry = [ "$TEST_UNITTEST_DIR/libc/io/io_test.cpp" ]
sources_entry = [ "../../common/osTest.cpp" ]
io_sources_smoke = [
sources_smoke = []
sources_full = []
libc_io_include_dirs = [ "$TEST_UNITTEST_DIR/libc/io" ]
libc_io_sources_entry = [ "$TEST_UNITTEST_DIR/libc/io/io_test.cpp" ]
libc_io_sources_smoke = [
"$TEST_UNITTEST_DIR/libc/io/smoke/IO_test_005.cpp",
"$TEST_UNITTEST_DIR/libc/io/smoke/IO_test_008.cpp",
"$TEST_UNITTEST_DIR/libc/io/smoke/IO_test_010.cpp",
"$TEST_UNITTEST_DIR/libc/io/smoke/IO_test_013.cpp",
]
io_sources_full = [
libc_io_sources_full = [
"$TEST_UNITTEST_DIR/libc/io/full/IO_test_confstr_001.cpp",
"$TEST_UNITTEST_DIR/libc/io/full/IO_test_dcgettext_001.cpp",
"$TEST_UNITTEST_DIR/libc/io/full/IO_test_dcgettext_002.cpp",
@ -82,3 +95,11 @@ io_sources_full = [
"$TEST_UNITTEST_DIR/libc/io/full/IO_test_epoll_001.cpp",
"$TEST_UNITTEST_DIR/libc/io/full/IO_test_epoll_002.cpp",
]
# libc io module
if (LOSCFG_USER_TEST_LIBC_IO == true) {
common_include_dirs += libc_io_include_dirs
sources_entry += libc_io_sources_entry
sources_smoke += libc_io_sources_smoke
sources_full += libc_io_sources_full
}

View File

@ -0,0 +1,66 @@
# Copyright (c) 2023 Huawei Device Co., Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of
# conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
# of conditions and the following disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be used
# to endorse or promote products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("./config.gni")
config("libc_config") {
if (LOSCFG_USER_TEST_LIBC_POSIX_MQUEUE == true ||
LOSCFG_USER_TEST_LIBC_POSIX_PTHREAD == true) {
cflags = [ "-O1" ]
cflags_cc = cflags
}
}
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
unittest("liteos_a_libc_misc_unittest_door") {
output_extension = "bin"
output_dir = "$root_out_dir/test/unittest/kernel"
include_dirs = common_include_dirs
sources = sources_entry
sources += sources_smoke
sources_full = []
sources += sources_full
configs = [ "../..:public_config_for_door" ]
configs += [ ":libc_config" ]
deps = [ "$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR:libsec_shared" ]
}
}
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) {
unittest("liteos_a_libc_misc_unittest") {
output_extension = "bin"
output_dir = "$root_out_dir/test/unittest/kernel"
include_dirs = common_include_dirs
sources = sources_entry
sources += sources_smoke
sources += sources_full
configs = [ "../..:public_config_for_all" ]
configs += [ ":libc_config" ]
deps = [ "$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR:libsec_shared" ]
}
}

View File

@ -1,4 +1,4 @@
# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved.
# Copyright (c) 2022-2023 Huawei Device Co., Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
@ -26,13 +26,26 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/liteos.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
misc_include_dirs = [ "$TEST_UNITTEST_DIR/libc/misc" ]
common_include_dirs = [
"$THIRDPARTY_GOOGLETEST_DIR/googletest/include",
"../../common/include",
]
misc_sources_entry = [ "$TEST_UNITTEST_DIR/libc/misc/misc_test.cpp" ]
sources_entry = [ "../../common/osTest.cpp" ]
misc_sources_smoke = [
sources_smoke = []
sources_full = []
libc_misc_include_dirs = [ "$TEST_UNITTEST_DIR/libc/misc" ]
libc_misc_sources_entry = [ "$TEST_UNITTEST_DIR/libc/misc/misc_test.cpp" ]
libc_misc_sources_smoke = [
"$TEST_UNITTEST_DIR/libc/misc/smoke/misc_test_001.cpp",
"$TEST_UNITTEST_DIR/libc/misc/smoke/misc_test_002.cpp",
"$TEST_UNITTEST_DIR/libc/misc/smoke/misc_test_003.cpp",
@ -41,7 +54,7 @@ misc_sources_smoke = [
"$TEST_UNITTEST_DIR/libc/misc/smoke/misc_test_014.cpp",
]
misc_sources_full = [
libc_misc_sources_full = [
"$TEST_UNITTEST_DIR/libc/misc/full/misc_test_006.cpp",
"$TEST_UNITTEST_DIR/libc/misc/full/misc_test_007.cpp",
"$TEST_UNITTEST_DIR/libc/misc/full/misc_test_008.cpp",
@ -51,3 +64,11 @@ misc_sources_full = [
"$TEST_UNITTEST_DIR/libc/misc/full/misc_test_012.cpp",
"$TEST_UNITTEST_DIR/libc/misc/full/misc_test_013.cpp",
]
# libc misc module
if (LOSCFG_USER_TEST_LIBC_MISC == true) {
common_include_dirs += libc_misc_include_dirs
sources_entry += libc_misc_sources_entry
sources_smoke += libc_misc_sources_smoke
sources_full += libc_misc_sources_full
}

View File

@ -0,0 +1,66 @@
# Copyright (c) 2023 Huawei Device Co., Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of
# conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
# of conditions and the following disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be used
# to endorse or promote products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("./config.gni")
config("libc_config") {
if (LOSCFG_USER_TEST_LIBC_POSIX_MQUEUE == true ||
LOSCFG_USER_TEST_LIBC_POSIX_PTHREAD == true) {
cflags = [ "-O1" ]
cflags_cc = cflags
}
}
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
unittest("liteos_a_libc_posix_unittest_door") {
output_extension = "bin"
output_dir = "$root_out_dir/test/unittest/kernel"
include_dirs = common_include_dirs
sources = sources_entry
sources += sources_smoke
sources_full = []
sources += sources_full
configs = [ "../..:public_config_for_door" ]
configs += [ ":libc_config" ]
deps = [ "$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR:libsec_shared" ]
}
}
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) {
unittest("liteos_a_libc_posix_unittest") {
output_extension = "bin"
output_dir = "$root_out_dir/test/unittest/kernel"
include_dirs = common_include_dirs
sources = sources_entry
sources += sources_smoke
sources += sources_full
configs = [ "../..:public_config_for_all" ]
configs += [ ":libc_config" ]
deps = [ "$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR:libsec_shared" ]
}
}

View File

@ -0,0 +1,69 @@
# Copyright (c) 2023 Huawei Device Co., Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of
# conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
# of conditions and the following disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be used
# to endorse or promote products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/liteos.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
common_include_dirs = [
"$THIRDPARTY_GOOGLETEST_DIR/googletest/include",
"../../common/include",
]
sources_entry = [ "../../common/osTest.cpp" ]
sources_smoke = []
sources_full = []
# libc posix mem module
if (LOSCFG_USER_TEST_LIBC_POSIX_MEM == true) {
import("./mem/config.gni")
common_include_dirs += libc_posix_mem_include_dirs
sources_entry += libc_posix_mem_sources_entry
sources_smoke += libc_posix_mem_sources_smoke
sources_full += libc_posix_mem_sources_full
}
# libc posix mqueue module
if (LOSCFG_USER_TEST_LIBC_POSIX_MQUEUE == true) {
import("./mqueue/config.gni")
common_include_dirs += libc_posix_mqueue_include_dirs
sources_entry += libc_posix_mqueue_sources_entry
sources_smoke += libc_posix_mqueue_sources_smoke
sources_full += libc_posix_mqueue_sources_full
}
# libc posix pthread module
if (LOSCFG_USER_TEST_LIBC_POSIX_PTHREAD == true) {
import("./pthread/config.gni")
common_include_dirs += libc_posix_pthread_include_dirs
sources_entry += libc_posix_pthread_sources_entry
sources_smoke += libc_posix_pthread_sources_smoke
sources_full += libc_posix_pthread_sources_full
}

View File

@ -1,4 +1,4 @@
# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved.
# Copyright (c) 2022-2023 Huawei Device Co., Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
@ -26,16 +26,17 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
posix_mem_include_dirs = [ "$TEST_UNITTEST_DIR/libc/posix/mem" ]
libc_posix_mem_include_dirs = [ "$TEST_UNITTEST_DIR/libc/posix/mem" ]
posix_mem_sources_entry =
libc_posix_mem_sources_entry =
[ "$TEST_UNITTEST_DIR/libc/posix/mem/posix_mem_test.cpp" ]
posix_mem_sources_smoke = [
libc_posix_mem_sources_smoke = [
"$TEST_UNITTEST_DIR/libc/posix/mem/smoke/It_posix_mem_001.cpp",
"$TEST_UNITTEST_DIR/libc/posix/mem/smoke/It_posix_mem_003.cpp",
]
posix_mem_sources_full = []
libc_posix_mem_sources_full = []

View File

@ -1,4 +1,4 @@
# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved.
# Copyright (c) 2022-2023 Huawei Device Co., Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
@ -26,14 +26,15 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
posix_mqueue_include_dirs = [ "$TEST_UNITTEST_DIR/libc/posix/mqueue" ]
libc_posix_mqueue_include_dirs = [ "$TEST_UNITTEST_DIR/libc/posix/mqueue" ]
posix_mqueue_sources_entry =
libc_posix_mqueue_sources_entry =
[ "$TEST_UNITTEST_DIR/libc/posix/mqueue/posix_mqueue_test.cpp" ]
posix_mqueue_sources_smoke = [
libc_posix_mqueue_sources_smoke = [
"$TEST_UNITTEST_DIR/libc/posix/mqueue/smoke/It_posix_queue_001.cpp",
"$TEST_UNITTEST_DIR/libc/posix/mqueue/smoke/It_posix_queue_003.cpp",
"$TEST_UNITTEST_DIR/libc/posix/mqueue/smoke/It_posix_queue_028.cpp",
@ -41,7 +42,7 @@ posix_mqueue_sources_smoke = [
"$TEST_UNITTEST_DIR/libc/posix/mqueue/smoke/It_posix_queue_062.cpp",
]
posix_mqueue_sources_full = [
libc_posix_mqueue_sources_full = [
"$TEST_UNITTEST_DIR/libc/posix/mqueue/full/It_posix_queue_002.cpp",
"$TEST_UNITTEST_DIR/libc/posix/mqueue/full/It_posix_queue_005.cpp",
"$TEST_UNITTEST_DIR/libc/posix/mqueue/full/It_posix_queue_008.cpp",

View File

@ -1,4 +1,4 @@
# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved.
# Copyright (c) 2022-2023 Huawei Device Co., Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
@ -26,14 +26,15 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
posix_pthread_include_dirs = [ "$TEST_UNITTEST_DIR/libc/posix/pthread" ]
libc_posix_pthread_include_dirs = [ "$TEST_UNITTEST_DIR/libc/posix/pthread" ]
posix_pthread_sources_entry =
libc_posix_pthread_sources_entry =
[ "$TEST_UNITTEST_DIR/libc/posix/pthread/posix_pthread_test.cpp" ]
posix_pthread_sources_smoke = [
libc_posix_pthread_sources_smoke = [
"$TEST_UNITTEST_DIR/libc/posix/pthread/smoke/It_posix_pthread_003.cpp",
"$TEST_UNITTEST_DIR/libc/posix/pthread/smoke/It_posix_pthread_004.cpp",
"$TEST_UNITTEST_DIR/libc/posix/pthread/smoke/It_posix_pthread_005.cpp",
@ -45,7 +46,7 @@ posix_pthread_sources_smoke = [
"$TEST_UNITTEST_DIR/libc/posix/pthread/smoke/It_posix_pthread_022.cpp",
]
posix_pthread_sources_full = [
libc_posix_pthread_sources_full = [
"$TEST_UNITTEST_DIR/libc/posix/pthread/full/It_posix_pthread_001.cpp",
"$TEST_UNITTEST_DIR/libc/posix/pthread/full/It_posix_pthread_002.cpp",
"$TEST_UNITTEST_DIR/libc/posix/pthread/full/It_posix_pthread_007.cpp",

View File

@ -0,0 +1,66 @@
# Copyright (c) 2023 Huawei Device Co., Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of
# conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
# of conditions and the following disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be used
# to endorse or promote products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("./config.gni")
config("libc_config") {
if (LOSCFG_USER_TEST_LIBC_POSIX_MQUEUE == true ||
LOSCFG_USER_TEST_LIBC_POSIX_PTHREAD == true) {
cflags = [ "-O1" ]
cflags_cc = cflags
}
}
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
unittest("liteos_a_libc_sys_unittest_door") {
output_extension = "bin"
output_dir = "$root_out_dir/test/unittest/kernel"
include_dirs = common_include_dirs
sources = sources_entry
sources += sources_smoke
sources_full = []
sources += sources_full
configs = [ "../..:public_config_for_door" ]
configs += [ ":libc_config" ]
deps = [ "$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR:libsec_shared" ]
}
}
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) {
unittest("liteos_a_libc_sys_unittest") {
output_extension = "bin"
output_dir = "$root_out_dir/test/unittest/kernel"
include_dirs = common_include_dirs
sources = sources_entry
sources += sources_smoke
sources += sources_full
configs = [ "../..:public_config_for_all" ]
configs += [ ":libc_config" ]
deps = [ "$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR:libsec_shared" ]
}
}

View File

@ -1,4 +1,4 @@
# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved.
# Copyright (c) 2022-2023 Huawei Device Co., Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
@ -26,13 +26,26 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/liteos.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
sys_include_dirs = [ "$TEST_UNITTEST_DIR/libc/sys" ]
common_include_dirs = [
"$THIRDPARTY_GOOGLETEST_DIR/googletest/include",
"../../common/include",
]
sys_sources_entry = [ "$TEST_UNITTEST_DIR/libc/sys/sys_unit_test.cpp" ]
sources_entry = [ "../../common/osTest.cpp" ]
sys_sources_smoke = [
sources_smoke = []
sources_full = []
libc_sys_include_dirs = [ "$TEST_UNITTEST_DIR/libc/sys" ]
libc_sys_sources_entry = [ "$TEST_UNITTEST_DIR/libc/sys/sys_unit_test.cpp" ]
libc_sys_sources_smoke = [
"$TEST_UNITTEST_DIR/libc/sys/smoke/sys_test_004.cpp",
"$TEST_UNITTEST_DIR/libc/sys/smoke/sys_test_005.cpp",
"$TEST_UNITTEST_DIR/libc/sys/smoke/sys_test_006.cpp",
@ -51,7 +64,7 @@ sys_sources_smoke = [
"$TEST_UNITTEST_DIR/libc/sys/smoke/sys_test_031.cpp",
]
sys_sources_full = [
libc_sys_sources_full = [
"$TEST_UNITTEST_DIR/libc/sys/full/sys_test_001.cpp",
"$TEST_UNITTEST_DIR/libc/sys/full/sys_test_018.cpp",
"$TEST_UNITTEST_DIR/libc/sys/full/sys_test_019.cpp",
@ -65,3 +78,11 @@ sys_sources_full = [
"$TEST_UNITTEST_DIR/libc/sys/full/sys_test_027.cpp",
"$TEST_UNITTEST_DIR/libc/sys/full/sys_test_028.cpp",
]
# libc sys module
if (LOSCFG_USER_TEST_LIBC_SYS == true) {
common_include_dirs += libc_sys_include_dirs
sources_entry += libc_sys_sources_entry
sources_smoke += libc_sys_sources_smoke
sources_full += libc_sys_sources_full
}

View File

@ -0,0 +1,66 @@
# Copyright (c) 2023 Huawei Device Co., Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of
# conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
# of conditions and the following disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be used
# to endorse or promote products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("./config.gni")
config("libc_config") {
if (LOSCFG_USER_TEST_LIBC_POSIX_MQUEUE == true ||
LOSCFG_USER_TEST_LIBC_POSIX_PTHREAD == true) {
cflags = [ "-O1" ]
cflags_cc = cflags
}
}
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
unittest("liteos_a_libc_time_unittest_door") {
output_extension = "bin"
output_dir = "$root_out_dir/test/unittest/kernel"
include_dirs = common_include_dirs
sources = sources_entry
sources += sources_smoke
sources_full = []
sources += sources_full
configs = [ "../..:public_config_for_door" ]
configs += [ ":libc_config" ]
deps = [ "$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR:libsec_shared" ]
}
}
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) {
unittest("liteos_a_libc_time_unittest") {
output_extension = "bin"
output_dir = "$root_out_dir/test/unittest/kernel"
include_dirs = common_include_dirs
sources = sources_entry
sources += sources_smoke
sources += sources_full
configs = [ "../..:public_config_for_all" ]
configs += [ ":libc_config" ]
deps = [ "$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR:libsec_shared" ]
}
}

View File

@ -1,4 +1,4 @@
# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved.
# Copyright (c) 2022-2023 Huawei Device Co., Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
@ -26,17 +26,18 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
time_clock_include_dirs = [ "$TEST_UNITTEST_DIR/libc/time/clock" ]
libc_time_clock_include_dirs = [ "$TEST_UNITTEST_DIR/libc/time/clock" ]
time_clock_sources_entry =
libc_time_clock_sources_entry =
[ "$TEST_UNITTEST_DIR/libc/time/clock/time_clock_test.cpp" ]
time_clock_sources_smoke =
libc_time_clock_sources_smoke =
[ "$TEST_UNITTEST_DIR/libc/time/clock/smoke/clock_test_smoke.cpp" ]
time_clock_sources_full = [
libc_time_clock_sources_full = [
"$TEST_UNITTEST_DIR/libc/time/clock/full/clock_test_001.cpp",
"$TEST_UNITTEST_DIR/libc/time/clock/full/clock_test_002.cpp",
"$TEST_UNITTEST_DIR/libc/time/clock/full/clock_test_003.cpp",

View File

@ -1,4 +1,4 @@
# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved.
# Copyright (c) 2023 Huawei Device Co., Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
@ -27,10 +27,11 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/liteos.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
common_include_dirs = [
"//third_party/googletest/googletest/include",
"$THIRDPARTY_GOOGLETEST_DIR/googletest/include",
"../../common/include",
]
@ -40,19 +41,20 @@ sources_smoke = []
sources_full = []
# basic module
if (LOSCFG_USER_TEST_PROCESS == true) {
import("./process/config.gni")
common_include_dirs += process_include_dirs
sources_entry += process_sources_entry
sources_smoke += process_sources_smoke
sources_full += process_sources_full
# libc time clock module
if (LOSCFG_USER_TEST_LIBC_TIME_CLOCK == true) {
import("./clock/config.gni")
common_include_dirs += libc_time_clock_include_dirs
sources_entry += libc_time_clock_sources_entry
sources_smoke += libc_time_clock_sources_smoke
sources_full += libc_time_clock_sources_full
}
if (LOSCFG_USER_TEST_PTHREAD == true) {
import("./pthread/config.gni")
common_include_dirs += pthread_include_dirs
sources_entry += pthread_sources_entry
sources_smoke += pthread_sources_smoke
sources_full += pthread_sources_full
# libc time timer module
if (LOSCFG_USER_TEST_LIBC_TIME_TIMER == true) {
import("./timer/config.gni")
common_include_dirs += libc_time_timer_include_dirs
sources_entry += libc_time_timer_sources_entry
sources_smoke += libc_time_timer_sources_smoke
sources_full += libc_time_timer_sources_full
}

View File

@ -1,4 +1,4 @@
# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved.
# Copyright (c) 2022-2023 Huawei Device Co., Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
@ -26,14 +26,15 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
time_timer_include_dirs = [ "$TEST_UNITTEST_DIR/libc/time/timer" ]
libc_time_timer_include_dirs = [ "$TEST_UNITTEST_DIR/libc/time/timer" ]
time_timer_sources_entry =
libc_time_timer_sources_entry =
[ "$TEST_UNITTEST_DIR/libc/time/timer/time_timer_test.cpp" ]
time_timer_sources_smoke = [
libc_time_timer_sources_smoke = [
"$TEST_UNITTEST_DIR/libc/time/timer/smoke/timer_test_001.cpp",
"$TEST_UNITTEST_DIR/libc/time/timer/smoke/timer_test_002.cpp",
"$TEST_UNITTEST_DIR/libc/time/timer/smoke/timer_test_003.cpp",
@ -43,4 +44,4 @@ time_timer_sources_smoke = [
"$TEST_UNITTEST_DIR/libc/time/timer/smoke/timer_test_tzset_002.cpp",
]
time_timer_sources_full = []
libc_time_timer_sources_full = []

View File

@ -53,26 +53,6 @@ HWTEST_F(TimeTimerTest, TimerTest001, TestSize.Level0)
TimerTest001();
}
/* *
* @tc.name: TimerTest002
* @tc.desc: function for TimeTimerTest
* @tc.type: FUNC
*/
HWTEST_F(TimeTimerTest, TimerTest002, TestSize.Level0)
{
TimerTest002();
}
/* *
* @tc.name: TimerTest003
* @tc.desc: function for TimeTimerTest
* @tc.type: FUNC
*/
HWTEST_F(TimeTimerTest, TimerTest003, TestSize.Level0)
{
TimerTest003();
}
/* *
* @tc.name: TimerTest005
* @tc.desc: function for timer_create SIGEV_THREAD.

View File

@ -0,0 +1,66 @@
# Copyright (c) 2023 Huawei Device Co., Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of
# conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
# of conditions and the following disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be used
# to endorse or promote products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("./config.gni")
config("libc_config") {
if (LOSCFG_USER_TEST_LIBC_POSIX_MQUEUE == true ||
LOSCFG_USER_TEST_LIBC_POSIX_PTHREAD == true) {
cflags = [ "-O1" ]
cflags_cc = cflags
}
}
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
unittest("liteos_a_libc_util_unittest_door") {
output_extension = "bin"
output_dir = "$root_out_dir/test/unittest/kernel"
include_dirs = common_include_dirs
sources = sources_entry
sources += sources_smoke
sources_full = []
sources += sources_full
configs = [ "../..:public_config_for_door" ]
configs += [ ":libc_config" ]
deps = [ "$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR:libsec_shared" ]
}
}
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) {
unittest("liteos_a_libc_util_unittest") {
output_extension = "bin"
output_dir = "$root_out_dir/test/unittest/kernel"
include_dirs = common_include_dirs
sources = sources_entry
sources += sources_smoke
sources += sources_full
configs = [ "../..:public_config_for_all" ]
configs += [ ":libc_config" ]
deps = [ "$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR:libsec_shared" ]
}
}

View File

@ -1,4 +1,4 @@
# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved.
# Copyright (c) 2022-2023 Huawei Device Co., Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
@ -26,16 +26,29 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/liteos.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
util_include_dirs = [
common_include_dirs = [
"$THIRDPARTY_GOOGLETEST_DIR/googletest/include",
"../../common/include",
]
sources_entry = [ "../../common/osTest.cpp" ]
sources_smoke = []
sources_full = []
libc_util_include_dirs = [
"$TEST_UNITTEST_DIR/libc/util",
"$TEST_UNITTEST_DIR/libc/misc",
]
util_sources_entry = [ "$TEST_UNITTEST_DIR/libc/util/util_test.cpp" ]
libc_util_sources_entry = [ "$TEST_UNITTEST_DIR/libc/util/util_test.cpp" ]
util_sources_smoke = [
libc_util_sources_smoke = [
"$TEST_UNITTEST_DIR/libc/util/smoke/it_test_util_100.cpp",
"$TEST_UNITTEST_DIR/libc/util/smoke/it_test_util_101.cpp",
"$TEST_UNITTEST_DIR/libc/util/smoke/util_test_001.cpp",
@ -47,4 +60,12 @@ util_sources_smoke = [
"$TEST_UNITTEST_DIR/libc/util/smoke/util_test_007.cpp",
]
util_sources_full = []
libc_util_sources_full = []
# libc util module
if (LOSCFG_USER_TEST_LIBC_UTIL == true) {
common_include_dirs += libc_util_include_dirs
sources_entry += libc_util_sources_entry
sources_smoke += libc_util_sources_smoke
sources_full += libc_util_sources_full
}

Some files were not shown because too many files have changed in this diff Show More