Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
c7e374ea
S
Startup Init Lite
项目概览
OpenHarmony
/
Startup Init Lite
接近 2 年 前同步成功
通知
3
Star
37
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Startup Init Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
c7e374ea
编写于
12月 27, 2021
作者:
X
xionglei6
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
init: fix bugs
Signed-off-by:
N
xionglei6
<
xionglei6@huawei.com
>
上级
d51f8e68
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
1 addition
and
174 deletion
+1
-174
interfaces/innerkits/BUILD.gn
interfaces/innerkits/BUILD.gn
+1
-1
test/fuzztest/BUILD.gn
test/fuzztest/BUILD.gn
+0
-42
test/fuzztest/StartDynamicProcess_fuzzer/StartDynamicProcess_fuzzer.cpp
...StartDynamicProcess_fuzzer/StartDynamicProcess_fuzzer.cpp
+0
-36
test/fuzztest/StartDynamicProcess_fuzzer/StartDynamicProcess_fuzzer.h
...t/StartDynamicProcess_fuzzer/StartDynamicProcess_fuzzer.h
+0
-19
test/fuzztest/StopDynamicProcess_fuzzer/StopDynamicProcess_fuzzer.cpp
...t/StopDynamicProcess_fuzzer/StopDynamicProcess_fuzzer.cpp
+0
-36
test/fuzztest/StopDynamicProcess_fuzzer/StopDynamicProcess_fuzzer.h
...est/StopDynamicProcess_fuzzer/StopDynamicProcess_fuzzer.h
+0
-19
test/unittest/BUILD.gn
test/unittest/BUILD.gn
+0
-1
test/unittest/innerkits/innerkits_unittest.cpp
test/unittest/innerkits/innerkits_unittest.cpp
+0
-20
未找到文件。
interfaces/innerkits/BUILD.gn
浏览文件 @
c7e374ea
...
@@ -27,10 +27,10 @@ fs_manager_sources = [
...
@@ -27,10 +27,10 @@ fs_manager_sources = [
ohos_shared_library("libbegetutil") {
ohos_shared_library("libbegetutil") {
sources = [
sources = [
"begetctl_utils/begetctl_utils.c",
"file/init_file.c",
"file/init_file.c",
"reboot/init_reboot_innerkits.c",
"reboot/init_reboot_innerkits.c",
"socket/init_socket.c",
"socket/init_socket.c",
"begetctl_utils/begetctl_utils.c",
]
]
sources += fs_manager_sources
sources += fs_manager_sources
...
...
test/fuzztest/BUILD.gn
浏览文件 @
c7e374ea
...
@@ -147,48 +147,6 @@ ohos_fuzztest("ReadFileInDirFuzzTest") {
...
@@ -147,48 +147,6 @@ ohos_fuzztest("ReadFileInDirFuzzTest") {
defines = [ "STARTUP_INIT_TEST" ]
defines = [ "STARTUP_INIT_TEST" ]
}
}
ohos_fuzztest("StartDynamicProcessFuzzTest") {
module_out_path = module_output_path
include_dirs = [ "//base/startup/init_lite/interfaces/innerkits/include" ]
deps = [
"//base/startup/init_lite/interfaces/innerkits:libbegetutil",
"//base/startup/syspara_lite/interfaces/innerkits/native/syspara:syspara",
]
external_deps = [ "hiviewdfx_hilog_native:libhilog" ]
cflags = [
"-g",
"-O0",
"-Wno-unused-variable",
"-fno-omit-frame-pointer",
]
sources = [ "StartDynamicProcess_fuzzer/StartDynamicProcess_fuzzer.cpp" ]
defines = [ "STARTUP_INIT_TEST" ]
}
ohos_fuzztest("StopDynamicProcessFuzzTest") {
module_out_path = module_output_path
include_dirs = [ "//base/startup/init_lite/interfaces/innerkits/include" ]
deps = [
"//base/startup/init_lite/interfaces/innerkits:libbegetutil",
"//base/startup/syspara_lite/interfaces/innerkits/native/syspara:syspara",
]
external_deps = [ "hiviewdfx_hilog_native:libhilog" ]
cflags = [
"-g",
"-O0",
"-Wno-unused-variable",
"-fno-omit-frame-pointer",
]
sources = [ "StopDynamicProcess_fuzzer/StopDynamicProcess_fuzzer.cpp" ]
defines = [ "STARTUP_INIT_TEST" ]
}
ohos_fuzztest("SystemDumpParametersFuzzTest") {
ohos_fuzztest("SystemDumpParametersFuzzTest") {
module_out_path = module_output_path
module_out_path = module_output_path
...
...
test/fuzztest/StartDynamicProcess_fuzzer/StartDynamicProcess_fuzzer.cpp
已删除
100644 → 0
浏览文件 @
d51f8e68
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "StartDynamicProcess_fuzzer.h"
#include "dynamic_service.h"
namespace
OHOS
{
bool
FuzzStartDynamicProcess
(
const
uint8_t
*
data
,
size_t
size
)
{
bool
result
=
false
;
if
(
!
StartDynamicProcess
(
reinterpret_cast
<
const
char
*>
(
data
)))
{
result
=
true
;
}
return
result
;
}
}
/* Fuzzer entry point */
extern
"C"
int
LLVMFuzzerTestOneInput
(
const
uint8_t
*
data
,
size_t
size
)
{
/* Run your code on data */
OHOS
::
FuzzStartDynamicProcess
(
data
,
size
);
return
0
;
}
test/fuzztest/StartDynamicProcess_fuzzer/StartDynamicProcess_fuzzer.h
已删除
100644 → 0
浏览文件 @
d51f8e68
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef TEST_FUZZTEST_STARTDYNAMICPROCESS_FUZZER_H
#define TEST_FUZZTEST_STARTDYNAMICPROCESS_FUZZER_H
#define FUZZ_PROJECT_NAME "StartDynamicProcess_fuzzer"
#endif
test/fuzztest/StopDynamicProcess_fuzzer/StopDynamicProcess_fuzzer.cpp
已删除
100644 → 0
浏览文件 @
d51f8e68
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "StopDynamicProcess_fuzzer.h"
#include "dynamic_service.h"
namespace
OHOS
{
bool
FuzzStopDynamicProcess
(
const
uint8_t
*
data
,
size_t
size
)
{
bool
result
=
false
;
if
(
!
StopDynamicProcess
(
reinterpret_cast
<
const
char
*>
(
data
)))
{
result
=
true
;
}
return
result
;
}
}
/* Fuzzer entry point */
extern
"C"
int
LLVMFuzzerTestOneInput
(
const
uint8_t
*
data
,
size_t
size
)
{
/* Run your code on data */
OHOS
::
FuzzStopDynamicProcess
(
data
,
size
);
return
0
;
}
test/fuzztest/StopDynamicProcess_fuzzer/StopDynamicProcess_fuzzer.h
已删除
100644 → 0
浏览文件 @
d51f8e68
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef TEST_FUZZTEST_STOPDYNAMICPROCESS_FUZZER_H
#define TEST_FUZZTEST_STOPDYNAMICPROCESS_FUZZER_H
#define FUZZ_PROJECT_NAME "StopDynamicProcess_fuzzer"
#endif
test/unittest/BUILD.gn
浏览文件 @
c7e374ea
...
@@ -33,7 +33,6 @@ config("utest_config") {
...
@@ -33,7 +33,6 @@ config("utest_config") {
ohos_unittest("init_ut") {
ohos_unittest("init_ut") {
module_out_path = "startup/init"
module_out_path = "startup/init"
sources = [
sources = [
"//base/startup/init_lite/interfaces/innerkits/dynamic_service/dynamic_service.c",
"//base/startup/init_lite/interfaces/innerkits/file/init_file.c",
"//base/startup/init_lite/interfaces/innerkits/file/init_file.c",
"//base/startup/init_lite/interfaces/innerkits/fs_manager/fs_manager_log.c",
"//base/startup/init_lite/interfaces/innerkits/fs_manager/fs_manager_log.c",
"//base/startup/init_lite/interfaces/innerkits/fs_manager/fstab.c",
"//base/startup/init_lite/interfaces/innerkits/fs_manager/fstab.c",
...
...
test/unittest/innerkits/innerkits_unittest.cpp
浏览文件 @
c7e374ea
...
@@ -15,7 +15,6 @@
...
@@ -15,7 +15,6 @@
#include <cinttypes>
#include <cinttypes>
#include <sys/mount.h>
#include <sys/mount.h>
#include "dynamic_service.h"
#include "fs_manager/fs_manager.h"
#include "fs_manager/fs_manager.h"
#include "fs_manager/fs_manager_log.h"
#include "fs_manager/fs_manager_log.h"
#include "init_log.h"
#include "init_log.h"
...
@@ -34,25 +33,6 @@ public:
...
@@ -34,25 +33,6 @@ public:
void
TearDown
()
{};
void
TearDown
()
{};
};
};
HWTEST_F
(
InnerkitsUnitTest
,
TestDynamicService
,
TestSize
.
Level1
)
{
const
char
*
name
=
"updater_sa"
;
int32_t
ret
=
StopDynamicProcess
(
name
);
EXPECT_EQ
(
ret
,
0
);
ret
=
StartDynamicProcess
(
name
);
EXPECT_EQ
(
ret
,
0
);
name
=
"111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"
;
ret
=
StopDynamicProcess
(
name
);
EXPECT_EQ
(
ret
,
-
1
);
ret
=
StartDynamicProcess
(
name
);
EXPECT_EQ
(
ret
,
-
1
);
name
=
nullptr
;
ret
=
StopDynamicProcess
(
name
);
EXPECT_EQ
(
ret
,
-
1
);
ret
=
StartDynamicProcess
(
name
);
EXPECT_EQ
(
ret
,
-
1
);
}
HWTEST_F
(
InnerkitsUnitTest
,
ReadFstabFromFile_unitest
,
TestSize
.
Level1
)
HWTEST_F
(
InnerkitsUnitTest
,
ReadFstabFromFile_unitest
,
TestSize
.
Level1
)
{
{
Fstab
*
fstab
=
nullptr
;
Fstab
*
fstab
=
nullptr
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录