Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
65613eb6
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
65613eb6
编写于
3月 24, 2021
作者:
R
root
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add startup interface testcase
Change-Id: I6e1914c3e737ceccb4c84c7b23a9f98fbd1f292e
上级
29ed6bd5
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
521 addition
and
0 deletion
+521
-0
build_lite/BUILD.gn
build_lite/BUILD.gn
+1
-0
startup_lite/bootstrap_hal/BUILD.gn
startup_lite/bootstrap_hal/BUILD.gn
+27
-0
startup_lite/bootstrap_hal/Test.tmpl
startup_lite/bootstrap_hal/Test.tmpl
+19
-0
startup_lite/bootstrap_hal/src/samgr_api_test.c
startup_lite/bootstrap_hal/src/samgr_api_test.c
+427
-0
startup_lite/bootstrap_hal/src/samgr_api_test.h
startup_lite/bootstrap_hal/src/samgr_api_test.h
+47
-0
未找到文件。
build_lite/BUILD.gn
浏览文件 @
65613eb6
...
...
@@ -43,6 +43,7 @@ lite_component("acts_component") {
"//test/xts/acts/distributed_schedule_lite/samgr_hal:ActsSamgrTest",
"//test/xts/acts/update_lite/updater_hal:ActsUpdaterFuncTest",
"//test/xts/acts/startup_lite/bootstrap_hal:ActsBootstrapTest",
]
} else if (ohos_kernel_type == "liteos_a") {
all_features += [
...
...
startup_lite/bootstrap_hal/BUILD.gn
0 → 100644
浏览文件 @
65613eb6
# Copyright (c) 2020-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.
import("//test/xts/tools/lite/build/suite_lite.gni")
hctest_suite("ActsBootstrapTest") {
suite_name = "acts"
sources = [
"src/samgr_api_test.c"
]
include_dirs = [
"src",
"//utils/native/native_lite/include",
]
cflags = [ "-Wno-error" ]
}
startup_lite/bootstrap_hal/Test.tmpl
0 → 100755
浏览文件 @
65613eb6
{
"description": "Config for $module test cases",
"environment": [
{
"type": "device",
"label": "wifiiot"
}
],
"kits": [
{
"type": "DeployKit",
"timeout": "20000",
"burn_file": "$subsystem/$module.bin"
}
],
"driver": {
"type": "CTestLite"
}
}
\ No newline at end of file
startup_lite/bootstrap_hal/src/samgr_api_test.c
0 → 100644
浏览文件 @
65613eb6
/*
* Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
*/
/**
* Copyright (c) 2020-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 "hctest.h"
#include <ohos_init.h>
#include <samgr_lite.h>
#include "samgr_api_test.h"
static
int
g_initIndex
=
0
;
static
int
g_coreInit
[
API_PRI_MAX
]
=
{
0
};
static
int
g_sysRun
[
API_PRI_MAX
]
=
{
0
};
static
int
g_sysServiceInit
[
API_PRI_MAX
]
=
{
0
};
static
int
g_sysFeatureInit
[
API_PRI_MAX
]
=
{
0
};
static
int
g_sysExServiceInit
[
API_PRI_MAX
]
=
{
0
};
static
int
g_sysExFeatureInit
[
API_PRI_MAX
]
=
{
0
};
static
int
g_appServiceInit
[
API_PRI_MAX
]
=
{
0
};
static
int
g_appFeatureInit
[
API_PRI_MAX
]
=
{
0
};
/**
* @tc.desc : register a test suite, this suite is used to test basic flow and interface dependency
* @param : subsystem name is startup
* @param : module name is bootstrap
* @param : test suit name is SamgrApiTestSuite
*/
LITE_TEST_SUIT
(
startup
,
bootstrap
,
SamgrApiTestSuite
);
/**
* @tc.setup : setup for all testcases
* @return : setup result, TRUE is success, FALSE is fail
*/
static
BOOL
SamgrApiTestSuiteSetUp
(
void
)
{
return
TRUE
;
}
/**
* @tc.teardown : teardown for all testcases
* @return : teardown result, TRUE is success, FALSE is fail
*/
static
BOOL
SamgrApiTestSuiteTearDown
(
void
)
{
printf
(
"+-------------------------------------------+
\n
"
);
return
TRUE
;
}
static
void
PrintInitIndex
(
const
int
initArr
[])
{
for
(
int
i
=
0
;
i
<
API_PRI_MAX
;
i
++
)
{
if
(
i
==
API_PRI_DEFAULT
)
{
printf
(
"default: %d"
,
initArr
[
i
]);
continue
;
}
printf
(
"%d: %d"
,
i
,
initArr
[
i
]);
}
}
static
void
CoreInitDef
(
void
)
{
g_coreInit
[
API_PRI_DEFAULT
]
=
g_initIndex
;
}
static
void
CoreInit0
(
void
)
{
g_coreInit
[
API_PRI0
]
=
g_initIndex
;
}
static
void
CoreInit1
(
void
)
{
g_coreInit
[
API_PRI1
]
=
g_initIndex
;
}
static
void
CoreInit2
(
void
)
{
g_coreInit
[
API_PRI2
]
=
g_initIndex
;
}
static
void
CoreInit3
(
void
)
{
g_coreInit
[
API_PRI3
]
=
g_initIndex
;
}
static
void
CoreInit4
(
void
)
{
g_coreInit
[
API_PRI4
]
=
g_initIndex
;
}
static
void
SysRunDef
(
void
)
{
g_sysRun
[
API_PRI_DEFAULT
]
=
g_initIndex
;
}
static
void
SysRun0
(
void
)
{
g_sysRun
[
API_PRI0
]
=
g_initIndex
;
}
static
void
SysRun1
(
void
)
{
g_sysRun
[
API_PRI1
]
=
g_initIndex
;
}
static
void
SysRun2
(
void
)
{
g_sysRun
[
API_PRI2
]
=
g_initIndex
;
}
static
void
SysRun3
(
void
)
{
g_sysRun
[
API_PRI3
]
=
g_initIndex
;
}
static
void
SysRun4
(
void
)
{
g_sysRun
[
API_PRI4
]
=
g_initIndex
;
}
static
void
SysServiceInitDef
(
void
)
{
g_sysServiceInit
[
API_PRI_DEFAULT
]
=
g_initIndex
;
}
static
void
SysServiceInit0
(
void
)
{
g_sysServiceInit
[
API_PRI0
]
=
g_initIndex
;
}
static
void
SysServiceInit1
(
void
)
{
g_sysServiceInit
[
API_PRI1
]
=
g_initIndex
;
}
static
void
SysServiceInit2
(
void
)
{
g_sysServiceInit
[
API_PRI2
]
=
g_initIndex
;
}
static
void
SysServiceInit3
(
void
)
{
g_sysServiceInit
[
API_PRI3
]
=
g_initIndex
;
}
static
void
SysServiceInit4
(
void
)
{
g_sysServiceInit
[
API_PRI4
]
=
g_initIndex
;
}
static
void
SysFeatureInitDef
(
void
)
{
g_sysFeatureInit
[
API_PRI_DEFAULT
]
=
g_initIndex
;
}
static
void
SysFeatureInit0
(
void
)
{
g_sysFeatureInit
[
API_PRI0
]
=
g_initIndex
;
}
static
void
SysFeatureInit1
(
void
)
{
g_sysFeatureInit
[
API_PRI1
]
=
g_initIndex
;
}
static
void
SysFeatureInit2
(
void
)
{
g_sysFeatureInit
[
API_PRI2
]
=
g_initIndex
;
}
static
void
SysFeatureInit3
(
void
)
{
g_sysFeatureInit
[
API_PRI3
]
=
g_initIndex
;
}
static
void
SysFeatureInit4
(
void
)
{
g_sysFeatureInit
[
API_PRI4
]
=
g_initIndex
;
}
static
void
SysExSerInitDef
(
void
)
{
g_sysExServiceInit
[
API_PRI_DEFAULT
]
=
g_initIndex
;
}
static
void
SysExSerInit0
(
void
)
{
g_sysExServiceInit
[
API_PRI0
]
=
g_initIndex
;
}
static
void
SysExSerInit1
(
void
)
{
g_sysExServiceInit
[
API_PRI1
]
=
g_initIndex
;
}
static
void
SysExSerInit2
(
void
)
{
g_sysExServiceInit
[
API_PRI2
]
=
g_initIndex
;
}
static
void
SysExSerInit3
(
void
)
{
g_sysExServiceInit
[
API_PRI3
]
=
g_initIndex
;
}
static
void
SysExSerInit4
(
void
)
{
g_sysExServiceInit
[
API_PRI4
]
=
g_initIndex
;
}
static
void
SysExFeaInitDef
(
void
)
{
g_sysExFeatureInit
[
API_PRI_DEFAULT
]
=
g_initIndex
;
}
static
void
SysExFeaInit0
(
void
)
{
g_sysExFeatureInit
[
API_PRI0
]
=
g_initIndex
;
}
static
void
SysExFeaInit1
(
void
)
{
g_sysExFeatureInit
[
API_PRI1
]
=
g_initIndex
;
}
static
void
SysExFeaInit2
(
void
)
{
g_sysExFeatureInit
[
API_PRI2
]
=
g_initIndex
;
}
static
void
SysExFeaInit3
(
void
)
{
g_sysExFeatureInit
[
API_PRI3
]
=
g_initIndex
;
}
static
void
SysExFeaInit4
(
void
)
{
g_sysExFeatureInit
[
API_PRI4
]
=
g_initIndex
;
}
static
void
AppServiceInitDef
(
void
)
{
g_appServiceInit
[
API_PRI_DEFAULT
]
=
g_initIndex
;
}
static
void
AppServiceInit0
(
void
)
{
g_appServiceInit
[
API_PRI0
]
=
g_initIndex
;
}
static
void
AppServiceInit1
(
void
)
{
g_appServiceInit
[
API_PRI1
]
=
g_initIndex
;
}
static
void
AppServiceInit2
(
void
)
{
g_appServiceInit
[
API_PRI2
]
=
g_initIndex
;
}
static
void
AppServiceInit3
(
void
)
{
g_appServiceInit
[
API_PRI3
]
=
g_initIndex
;
}
static
void
AppServiceInit4
(
void
)
{
g_appServiceInit
[
API_PRI4
]
=
g_initIndex
;
}
static
void
AppFeatureInitDef
(
void
)
{
g_appFeatureInit
[
API_PRI_DEFAULT
]
=
g_initIndex
;
}
static
void
AppFeatureInit0
(
void
)
{
g_appFeatureInit
[
API_PRI0
]
=
g_initIndex
;
}
static
void
AppFeatureInit1
(
void
)
{
g_appFeatureInit
[
API_PRI1
]
=
g_initIndex
;
}
static
void
AppFeatureInit2
(
void
)
{
g_appFeatureInit
[
API_PRI2
]
=
g_initIndex
;
}
static
void
AppFeatureInit3
(
void
)
{
g_appFeatureInit
[
API_PRI3
]
=
g_initIndex
;
}
static
void
AppFeatureInit4
(
void
)
{
g_appFeatureInit
[
API_PRI4
]
=
g_initIndex
;
}
// 接口注册后的启动顺序依赖hos_init.h中的定义的数字大小
// 第0个执行,内部按照0~4优先级执行,default优先级为2
CORE_INIT
(
CoreInitDef
);
CORE_INIT_PRI
(
CoreInit0
,
0
);
CORE_INIT_PRI
(
CoreInit1
,
1
);
CORE_INIT_PRI
(
CoreInit4
,
4
);
CORE_INIT_PRI
(
CoreInit2
,
2
);
CORE_INIT_PRI
(
CoreInit3
,
3
);
// 最后一个执行,内部按照0~4优先级执行,default优先级为2
SYS_RUN
(
SysRunDef
);
SYS_RUN_PRI
(
SysRun0
,
0
);
SYS_RUN_PRI
(
SysRun1
,
1
);
SYS_RUN_PRI
(
SysRun4
,
4
);
SYS_RUN_PRI
(
SysRun2
,
2
);
SYS_RUN_PRI
(
SysRun3
,
3
);
// 第1个执行,内部按照0~4优先级执行,default优先级为2
SYS_SERVICE_INIT
(
SysServiceInitDef
);
SYS_SERVICE_INIT_PRI
(
SysServiceInit0
,
0
);
SYS_SERVICE_INIT_PRI
(
SysServiceInit1
,
1
);
SYS_SERVICE_INIT_PRI
(
SysServiceInit4
,
4
);
SYS_SERVICE_INIT_PRI
(
SysServiceInit2
,
2
);
SYS_SERVICE_INIT_PRI
(
SysServiceInit3
,
3
);
// 第2个执行,内部按照0~4优先级执行,default优先级为2
SYS_FEATURE_INIT
(
SysFeatureInitDef
);
SYS_FEATURE_INIT_PRI
(
SysFeatureInit0
,
0
);
SYS_FEATURE_INIT_PRI
(
SysFeatureInit2
,
2
);
SYS_FEATURE_INIT_PRI
(
SysFeatureInit1
,
1
);
SYS_FEATURE_INIT_PRI
(
SysFeatureInit3
,
3
);
SYS_FEATURE_INIT_PRI
(
SysFeatureInit4
,
4
);
// 第3个执行,注意和APP_SERVICE_INIT_XXX并列,谁先注册先执行谁,内部按照0~4优先级执行,default优先级为2
SYSEX_SERVICE_INIT
(
SysExSerInitDef
);
SYSEX_SERVICE_INIT_PRI
(
SysExSerInit0
,
0
);
SYSEX_SERVICE_INIT_PRI
(
SysExSerInit1
,
1
);
SYSEX_SERVICE_INIT_PRI
(
SysExSerInit2
,
2
);
SYSEX_SERVICE_INIT_PRI
(
SysExSerInit3
,
3
);
SYSEX_SERVICE_INIT_PRI
(
SysExSerInit4
,
4
);
// 第4个执行,注意和APP_FEATURE_INIT_XXX并列,谁先注册先执行谁,内部按照0~4优先级执行,default优先级为2
SYSEX_FEATURE_INIT
(
SysExFeaInitDef
);
SYSEX_FEATURE_INIT_PRI
(
SysExFeaInit0
,
0
);
SYSEX_FEATURE_INIT_PRI
(
SysExFeaInit1
,
1
);
SYSEX_FEATURE_INIT_PRI
(
SysExFeaInit2
,
2
);
SYSEX_FEATURE_INIT_PRI
(
SysExFeaInit3
,
3
);
SYSEX_FEATURE_INIT_PRI
(
SysExFeaInit4
,
4
);
// 第3个执行,注意和SYSEX_SERVICE_INIT_XXX并列,谁先注册先执行谁,内部按照0~4优先级执行,default优先级为2
APP_SERVICE_INIT
(
AppServiceInitDef
);
APP_SERVICE_INIT_PRI
(
AppServiceInit0
,
0
);
APP_SERVICE_INIT_PRI
(
AppServiceInit4
,
4
);
APP_SERVICE_INIT_PRI
(
AppServiceInit3
,
3
);
APP_SERVICE_INIT_PRI
(
AppServiceInit2
,
2
);
APP_SERVICE_INIT_PRI
(
AppServiceInit1
,
1
);
// 第4个执行,注意和SYSEX_FEATURE_INIT_XXX并列,谁先注册先执行谁,内部按照0~4优先级执行,default优先级为2
APP_FEATURE_INIT
(
AppFeatureInitDef
);
APP_FEATURE_INIT_PRI
(
AppFeatureInit0
,
0
);
APP_FEATURE_INIT_PRI
(
AppFeatureInit1
,
1
);
APP_FEATURE_INIT_PRI
(
AppFeatureInit3
,
3
);
APP_FEATURE_INIT_PRI
(
AppFeatureInit4
,
4
);
APP_FEATURE_INIT_PRI
(
AppFeatureInit2
,
2
);
/**
* @tc.number : SUB_START_Bootstrap_Samgr_0100
* @tc.name : check total init index
* @tc.desc : check total init index, return success
*/
LITE_TEST_CASE
(
SamgrApiTestSuite
,
TestStartBootstrapSamgr001
,
Function
|
MediumTest
|
Level0
)
{
printf
(
"[TestStartBootstrapSamgr001:%d]"
,
g_initIndex
);
TEST_ASSERT_EQUAL_INT
(
g_initIndex
,
SAMGR_API_GROUP_NUM
*
SAMGR_API_CALL_NUM
);
};
/**
* @tc.number : SUB_START_Bootstrap_Samgr_0200
* @tc.name : check core init index
* @tc.desc : check core init, return success
*/
LITE_TEST_CASE
(
SamgrApiTestSuite
,
TestStartBootstrapSamgr002
,
Function
|
MediumTest
|
Level0
)
{
printf
(
"g_coreInit"
);
PrintInitIndex
(
g_coreInit
);
TEST_ASSERT_EQUAL_INT
(
g_coreInit
[
API_PRI0
],
GET_INIT_INDEX
(
CORE_INIT_E
,
API_PRI0
));
};
/**
* @tc.number : SUB_START_Bootstrap_Samgr_0300
* @tc.name : check system service init index
* @tc.desc : check system service init, return success
*/
LITE_TEST_CASE
(
SamgrApiTestSuite
,
TestStartBootstrapSamgr003
,
Function
|
MediumTest
|
Level0
)
{
printf
(
"g_sysServiceInit"
);
PrintInitIndex
(
g_sysServiceInit
);
TEST_ASSERT_EQUAL_INT
(
g_sysServiceInit
[
API_PRI0
],
GET_INIT_INDEX
(
SYS_SERVICE_INIT_E
,
API_PRI0
));
};
/**
* @tc.number : SUB_START_Bootstrap_Samgr_0400
* @tc.name : check system feature init index
* @tc.desc : check system feature init, return success
*/
LITE_TEST_CASE
(
SamgrApiTestSuite
,
TestStartBootstrapSamgr004
,
Function
|
MediumTest
|
Level0
)
{
printf
(
"g_sysFeatureInit"
);
PrintInitIndex
(
g_sysFeatureInit
);
TEST_ASSERT_EQUAL_INT
(
g_sysFeatureInit
[
API_PRI0
],
GET_INIT_INDEX
(
SYS_FEATURE_INIT_E
,
API_PRI0
));
};
/**
* @tc.number : SUB_START_Bootstrap_Samgr_0500
* @tc.name : check system extend service and app service init index
* @tc.desc : check system extend service and app service init, return success
*/
LITE_TEST_CASE
(
SamgrApiTestSuite
,
TestStartBootstrapSamgr005
,
Function
|
MediumTest
|
Level0
)
{
printf
(
"g_sysExServiceInit"
);
PrintInitIndex
(
g_sysExServiceInit
);
printf
(
"g_appServiceInit"
);
PrintInitIndex
(
g_appServiceInit
);
TEST_ASSERT_EQUAL_INT
(
g_sysExServiceInit
[
API_PRI0
],
GET_INIT_INDEX
(
APP_SERVICE_INIT_E
,
0
));
};
/**
* @tc.number : SUB_START_Bootstrap_Samgr_0600
* @tc.name : check system extend feature and app feature init index
* @tc.desc : check system extend feature and app feature init, return success
*/
LITE_TEST_CASE
(
SamgrApiTestSuite
,
TestStartBootstrapSamgr006
,
Function
|
MediumTest
|
Level0
)
{
printf
(
"g_sysExFeatureInit"
);
PrintInitIndex
(
g_sysExFeatureInit
);
printf
(
"g_appFeatureInit"
);
PrintInitIndex
(
g_appFeatureInit
);
TEST_ASSERT_EQUAL_INT
(
g_sysExFeatureInit
[
API_PRI0
],
GET_INIT_INDEX
(
APP_FEATURE_INIT_E
,
0
));
};
/**
* @tc.number : SUB_START_Bootstrap_Samgr_0700
* @tc.name : check system run index
* @tc.desc : check system run, return success
*/
LITE_TEST_CASE
(
SamgrApiTestSuite
,
TestStartBootstrapSamgr007
,
Function
|
MediumTest
|
Level0
)
{
printf
(
"g_sysRun"
);
PrintInitIndex
(
g_sysRun
);
TEST_ASSERT_EQUAL_INT
(
g_sysRun
[
API_PRI0
],
GET_INIT_INDEX
(
SYS_RUN_E
,
API_PRI0
));
};
RUN_TEST_SUITE
(
SamgrApiTestSuite
);
startup_lite/bootstrap_hal/src/samgr_api_test.h
0 → 100644
浏览文件 @
65613eb6
/*
* Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
*/
/*
* Copyright (c) 2020 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 XTS_HITS_SAMGR_API_EXPECT_H
#define XTS_HITS_SAMGR_API_EXPECT_H
const
int
SAMGR_API_GROUP_NUM
=
0
;
const
int
SAMGR_API_CALL_NUM
=
0
;
#define GET_INIT_INDEX(G, pri) (((G)*(SAMGR_API_CALL_NUM))+((G)*(pri)))
enum
TagSamgrApiGroup
{
CORE_INIT_E
=
0
,
SYS_SERVICE_INIT_E
=
0
,
SYS_FEATURE_INIT_E
=
0
,
APP_SERVICE_INIT_E
=
0
,
SYSEX_SERVICE_INIT_E
=
0
,
APP_FEATURE_INIT_E
=
0
,
SYSEX_FEATURE_INIT
=
0
,
SYS_RUN_E
=
0
,
};
enum
TagSamgrApiPri
{
API_PRI0
=
0
,
API_PRI1
=
0
,
API_PRI_DEFAULT
=
0
,
API_PRI2
=
0
,
API_PRI3
=
0
,
API_PRI4
=
0
,
API_PRI_MAX
=
0
,
};
#endif // XTS_HITS_SAMGR_API_EXPECT_H
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录