Merge branch 'master' of gitee.com:openharmony/startup_init into init_0517

Signed-off-by: 钟柠 <zhongning5@huawei.com>
This commit is contained in:
钟柠 2024-05-17 09:20:19 +00:00 committed by zhongning5
commit 447c97cfb9
31 changed files with 421 additions and 194 deletions

View File

@ -118,6 +118,14 @@
},
"name": "//base/startup/init/interfaces/innerkits:libbegetutil"
},
{
"header": {
"header_base": "//base/startup/init/interfaces/innerkits/include/",
"header_files": []
},
"name": "//base/startup/init/interfaces/innerkits:libbegetutil_static",
"visibility": [ "updater" ]
},
{
"header": {
"header_base": "//base/startup/init/interfaces/innerkits/include/fs_manager/",
@ -127,6 +135,14 @@
},
"name": "//base/startup/init/interfaces/innerkits/fs_manager:libfsmanager_static"
},
{
"header": {
"header_base": "//base/startup/init/interfaces/innerkits/include/fs_manager/",
"header_files": []
},
"name": "//base/startup/init/interfaces/innerkits/fs_manager:libfsmanager_static_real",
"visibility": [ "updater" ]
},
{
"header": {
"header_base": "//base/startup/init/interfaces/innerkits/include/",

View File

@ -22,6 +22,7 @@
#include "iservice_registry.h"
#include "system_ability_definition.h"
#include "securec.h"
#include "sysparam_errno.h"
namespace OHOS {
namespace device_info {
@ -34,10 +35,9 @@ DeviceInfoKits &DeviceInfoKits::GetInstance()
return DelayedRefSingleton<DeviceInfoKits>::GetInstance();
}
void DeviceInfoKits::LoadDeviceInfoSa()
void DeviceInfoKits::LoadDeviceInfoSa(std::unique_lock<std::mutex> &lock)
{
DINFO_LOGV("deviceInfoService_ is %d", deviceInfoService_ == nullptr);
std::unique_lock<std::mutex> lock(lock_);
if (deviceInfoService_ != nullptr) {
return;
}
@ -70,9 +70,9 @@ void DeviceInfoKits::LoadDeviceInfoSa()
}
}
sptr<IDeviceInfo> DeviceInfoKits::GetService()
sptr<IDeviceInfo> DeviceInfoKits::GetService(std::unique_lock<std::mutex> &lock)
{
LoadDeviceInfoSa();
LoadDeviceInfoSa(lock);
return deviceInfoService_;
}
@ -96,16 +96,42 @@ void DeviceInfoKits::FinishStartSAFailed()
int32_t DeviceInfoKits::GetUdid(std::string& result)
{
auto deviceService = GetService();
std::unique_lock<std::mutex> lock(lock_);
static std::optional<std::pair<int32_t, std::string>> resultPair;
if (resultPair.has_value()) {
int32_t ret = resultPair->first;
result = resultPair->second;
DINFO_LOGV("GetUdid from resultPair ret = %d", ret);
return ret;
}
auto deviceService = GetService(lock);
DINFO_CHECK(deviceService != nullptr, return -1, "Failed to get deviceinfo manager");
return deviceService->GetUdid(result);
int ret = deviceService->GetUdid(result);
DINFO_LOGV("GetSerialID from remote ret = %d", ret);
if (ret == 0 || ret == SYSPARAM_PERMISSION_DENIED) {
resultPair = std::make_optional(std::make_pair(ret, result));
}
return ret;
}
int32_t DeviceInfoKits::GetSerialID(std::string& result)
{
auto deviceService = GetService();
std::unique_lock<std::mutex> lock(lock_);
static std::optional<std::pair<int32_t, std::string>> resultPair;
if (resultPair.has_value()) {
int32_t ret = resultPair->first;
result = resultPair->second;
DINFO_LOGV("GetSerialID from resultPair ret = %d", ret);
return ret;
}
auto deviceService = GetService(lock);
DINFO_CHECK(deviceService != nullptr, return -1, "Failed to get deviceinfo manager");
return deviceService->GetSerialID(result);
int ret = deviceService->GetSerialID(result);
DINFO_LOGV("GetSerialID from remote ret = %d", ret);
if (ret == 0 || ret == SYSPARAM_PERMISSION_DENIED) {
resultPair = std::make_optional(std::make_pair(ret, result));
}
return ret;
}
void DeviceInfoKits::DeathRecipient::OnRemoteDied(const wptr<IRemoteObject> &remote)

View File

@ -49,8 +49,8 @@ private:
}
static const int DEVICEINFO_LOAD_SA_TIMEOUT_MS = 60000;
void LoadDeviceInfoSa();
sptr<IDeviceInfo> GetService();
void LoadDeviceInfoSa(std::unique_lock<std::mutex> &lock);
sptr<IDeviceInfo> GetService(std::unique_lock<std::mutex> &lock);
std::mutex lock_;
std::condition_variable deviceInfoLoadCon_;
sptr<IRemoteObject::DeathRecipient> deathRecipient_ {};

View File

@ -6,7 +6,8 @@
"libpath": "libdeviceinfoservice.z.so",
"run-on-create": true,
"distributed": false,
"dump_level": 1
"dump_level": 1,
"recycle-strategy": "low-memory"
}
]
}

View File

@ -90,6 +90,9 @@ if (defined(ohos_lite)) {
]
}
}
static_library("libbegetutil_static") {
}
}
if (ohos_kernel_type == "liteos_m") {
static_library("libbegetutil") {
@ -143,6 +146,9 @@ if (defined(ohos_lite)) {
}
}
}
static_library("libbegetutil_static") {
}
}
lite_component("parameter") {
@ -292,7 +298,10 @@ if (defined(ohos_lite)) {
ohos_static_library("libbegetutil_static") {
sources = syspara_sources
sources += [ "syspara/param_wrapper.cpp" ]
sources += [
"reboot/init_reboot_innerkits.c",
"syspara/param_wrapper.cpp",
]
defines = [
"INIT_AGENT",
@ -307,16 +316,17 @@ if (defined(ohos_lite)) {
deps = [
"//base/startup/init/services/log:agent_log",
"//base/startup/init/services/loopevent:loopevent",
"//base/startup/init/services/modules/udid:libudidcomm",
"//base/startup/init/services/modules/udid:libudidcomm_static",
"//base/startup/init/services/param/linux:param_client",
"//base/startup/init/services/utils:libinit_utils",
]
deps += [ "//base/startup/init/services/param/base:param_base" ]
external_deps = [
"bounds_checking_function:libsec_shared",
"c_utils:utils",
"bounds_checking_function:libsec_static",
"c_utils:utilsbase",
"hilog:libhilog_base",
]
public_configs = [ ":exported_header_files" ]
part_name = "init"
subsystem_name = "startup"
}

View File

@ -95,6 +95,7 @@ static int ServiceSendFds(const char *serviceName, int *fds, int fdCount, bool d
BEGET_LOGE("Failed to build control message");
if (msghdr.msg_control != NULL) {
free(msghdr.msg_control);
msghdr.msg_control = NULL;
}
msghdr.msg_controllen = 0;
close(sock);
@ -105,6 +106,7 @@ static int ServiceSendFds(const char *serviceName, int *fds, int fdCount, bool d
BEGET_LOGE("Failed to send fds to init, err = %d", errno);
if (msghdr.msg_control != NULL) {
free(msghdr.msg_control);
msghdr.msg_control = NULL;
}
msghdr.msg_controllen = 0;
close(sock);
@ -112,6 +114,7 @@ static int ServiceSendFds(const char *serviceName, int *fds, int fdCount, bool d
}
if (msghdr.msg_control != NULL) {
free(msghdr.msg_control);
msghdr.msg_control = NULL;
}
msghdr.msg_controllen = 0;
BEGET_LOGI("Send fds done");

View File

@ -52,6 +52,7 @@ int BuildControlMessage(struct msghdr *msghdr, int *fds, int fdCount, bool send
cmsg->cmsg_len = CMSG_LEN(sizeof(int) * fdCount);
int ret = memcpy_s(CMSG_DATA(cmsg), cmsg->cmsg_len, fds, sizeof(int) * fdCount);
BEGET_ERROR_CHECK(ret == 0, free(msghdr->msg_control);
msghdr->msg_control = NULL;
return -1, "Control message is not valid");
// build ucred info
cmsg = CMSG_NXTHDR(msghdr, cmsg);
@ -59,6 +60,7 @@ int BuildControlMessage(struct msghdr *msghdr, int *fds, int fdCount, bool send
if (sendUcred) {
BEGET_ERROR_CHECK(cmsg != NULL, free(msghdr->msg_control);
msghdr->msg_control = NULL;
return -1, "Control message is not valid");
struct ucred *ucred;

View File

@ -63,3 +63,45 @@ ohos_static_library("libfsmanager_static") {
part_name = "init"
subsystem_name = "startup"
}
ohos_static_library("libfsmanager_static_real") {
if (!defined(ohos_lite)) {
sources = [
"fstab.c",
"fstab_mount.c",
]
include_dirs = [
"//base/startup/init/interfaces/innerkits/include",
"//base/startup/init/interfaces/innerkits/include/param",
"//base/startup/init/interfaces/innerkits/init_module_engine/include",
"//base/startup/init/services/log",
"//base/startup/init/services/param/include",
]
external_deps = [ "bounds_checking_function:libsec_static" ]
deps = [ "//base/startup/init/services/utils:libinit_utils" ]
if (defined(global_parts_info) && defined(global_parts_info.startup_hvb)) {
sources += [
"dm_verity/dm_verity.c",
"libfs_dm/fs_dm.c",
"libfs_hvb/fs_hvb.c",
"libfs_hvb/hvb_ops.c",
]
include_dirs += [
"//base/startup/init/interfaces/innerkits/fs_manager/libfs_dm/include",
"//base/startup/init/interfaces/innerkits/fs_manager/libfs_hvb/include",
"//base/startup/init/interfaces/innerkits/fs_manager/dm_verity/include",
"//base/startup/hvb/libhvb/include",
"//base/startup/init/ueventd/include",
]
defines = [ "SUPPORT_HVB" ]
external_deps += [ "hvb:libhvb_static" ]
deps += [ "//base/startup/init/ueventd:libueventd_ramdisk_static_real" ]
}
}
public_configs = [ ":libfsmanager_exported_configs" ]
part_name = "init"
subsystem_name = "startup"
}

View File

@ -241,24 +241,28 @@ int FsDmCreateDevice(char **dmDevPath, const char *devName, DmVerityTarget *targ
rc = CreateDmDevice(fd, devName);
if (rc != 0) {
BEGET_LOGE("error 0x%x, create dm device fail", rc);
close(fd);
return rc;
}
rc = LoadDmDeviceTable(fd, devName, target);
if (rc != 0) {
BEGET_LOGE("error 0x%x, load device table fail", rc);
close(fd);
return rc;
}
rc = ActiveDmDevice(fd, devName);
if (rc != 0) {
BEGET_LOGE("error 0x%x, active device fail", rc);
close(fd);
return rc;
}
rc = GetDmDevPath(fd, dmDevPath, devName);
if (rc != 0) {
BEGET_LOGE("error 0x%x, get dm dev fail", rc);
close(fd);
return rc;
}

View File

@ -503,6 +503,7 @@ int FsHvbFinal(void)
{
if (g_vd != NULL) {
hvb_chain_verify_data_free(g_vd);
g_vd = NULL;
}
return 0;

View File

@ -70,6 +70,7 @@ if (defined(ohos_lite)) {
ohos_executable("begetctl") {
sources = [
"appspawntime_cmd.c",
"begetctl_cmd.c",
"bootchart_cmd.c",
"dump_service.c",

View File

@ -0,0 +1,81 @@
/*
* Copyright (c) 2024 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 <errno.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "begetctl.h"
#include "init_utils.h"
#include "control_fd.h"
#ifdef ENABLE_ENTER_APPSPAWN_SANDBOX
#include "appspawn.h"
#endif
#define APPSPAWN_CMD_NUMBER 1
static int SendAppspawnTimeMessage(const CmdAgent *agent, uint16_t type, const char *ptyName)
{
#ifdef ENABLE_ENTER_APPSPAWN_SANDBOX
if ((agent == NULL) || (ptyName == NULL)) {
BEGET_LOGE("Invalid parameter");
return -1;
}
AppSpawnClientHandle clientHandle;
int ret = AppSpawnClientInit("Appspawn", &clientHandle);
BEGET_ERROR_CHECK(ret == 0, return -1, "AppSpawnClientInit error, errno = %d", errno);
AppSpawnReqMsgHandle reqHandle;
ret = AppSpawnReqMsgCreate(MSG_BEGET_SPAWNTIME, "init", &reqHandle);
AppSpawnResult result = {};
ret = AppSpawnClientSendMsg(clientHandle, reqHandle, &result);
if (ret != 0) {
AppSpawnClientDestroy(clientHandle);
return -1;
}
int minAppspawnTime = result.result;
int maxAppspawnTime = result.pid;
printf("minAppspawnTime: %d, maxAppspawnTime: %d \n", minAppspawnTime, maxAppspawnTime);
AppSpawnClientDestroy(clientHandle);
return 0;
#endif
return -1;
}
static int main_cmd(BShellHandle shell, int argc, char* argv[])
{
if (argc != APPSPAWN_CMD_NUMBER) {
BShellCmdHelp(shell, argc, argv);
return 0;
}
CmdAgent agent;
int ret = InitPtyInterface(&agent, ACTION_APP_APAWNTIME, "init", (CallbackSendMsgProcess)SendAppspawnTimeMessage);
if (ret != 0) {
BEGET_LOGE("initptyinterface failed");
return -1;
}
return 0;
}
MODULE_CONSTRUCTOR(void)
{
CmdInfo infos[] = {
{"appspawn_time", main_cmd, "get appspawn time", "appspawn_time", ""},
};
for (size_t i = 0; i < sizeof(infos) / sizeof(infos[0]); i++) {
BShellEnvRegisterCmd(GetShellHandle(), &infos[i]);
}
}

View File

@ -150,6 +150,7 @@ servicerouter:x:6066:
nwebspawn:x:3081:
oaid_service:x:6101:
code_sign:x:3074:
el5_filekey_manager:x:3077:
hdf_ext_devmgr:x:3085:
intell_voice_host:x:3100:
user_data_r:x:2008:

View File

@ -25,7 +25,7 @@ startup_init_param=81920
hiviewdfx_profiler_param=4096
ohos_boot_param = 8192
bluetooth_param = 8192
hiviewdfx_hiview_param = 2048
hiviewdfx_hiview_param = 8192
telephony_param = 20480
vendor_camera_param=6144
edm_writable_param = 4096
@ -33,3 +33,4 @@ arkui_param = 2048
wireless_hid_accessory_manager_param = 4096
debug_param = 4096
sys_usb_param = 4096
i18n_param = 4096

View File

@ -147,6 +147,7 @@ servicerouter:x:6066:6066:::/bin/false
nwebspawn:x:3081:3081:::/bin/false
oaid_service:x:6101:6101:::/bin/false
code_sign:x:3074:3074:::/bin/false
el5_filekey_manager:x:3077:3077:::/bin/false
hdf_ext_devmgr:x:3085:3085:::/bin/false
intell_voice_host:x:3100:3100:::/bin/false
huawei_id:x:7008:7008:::/bin/false

View File

@ -118,6 +118,7 @@ static void StartSecondStageInit(long long uptime)
SwitchRoot("/usr");
char buf[64];
uptime = GetUptimeInMicroSeconds(NULL);
snprintf_s(buf, sizeof(buf), sizeof(buf) - 1, "%lld", uptime);
// Execute init second stage
char * const args[] = {

View File

@ -123,4 +123,14 @@ if (defined(ohos_lite)) {
part_name = "init"
subsystem_name = "startup"
}
ohos_static_library("libudidcomm_static") {
sources = [ "udid_comm.c" ]
defines = [ "_GNU_SOURCE" ]
include_dirs = comm_include
external_deps = [ "bounds_checking_function:libsec_static" ]
part_name = "init"
subsystem_name = "startup"
}
}

View File

@ -307,6 +307,7 @@ static int CreateCtrlInfo(ServiceCtrlInfo **ctrlInfo, const char *cmd, uint32_t
(*ctrlInfo)->valueOffset = offset;
if (ret != 0 || len <= 0) {
free(*ctrlInfo);
*ctrlInfo = NULL;
return -1;
}
(*ctrlInfo)->ctrlParam = ctrlParam;

View File

@ -29,7 +29,7 @@ public:
void TearDown(void) {};
};
HWTEST_F(BegetctlUnitTest, TestShellInit, TestSize.Level0)
HWTEST_F(BegetctlUnitTest, Init_TestShellInit_001, TestSize.Level0)
{
BShellParamCmdRegister(GetShellHandle(), 0);
const char *args[] = {
@ -38,7 +38,7 @@ HWTEST_F(BegetctlUnitTest, TestShellInit, TestSize.Level0)
BShellEnvDirectExecute(GetShellHandle(), 1, const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestShellLs, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestShellLs_001, TestSize.Level1)
{
BShellParamCmdRegister(GetShellHandle(), 0);
const char *args[] = {
@ -47,7 +47,7 @@ HWTEST_F(BegetctlUnitTest, TestShellLs, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestShellLsWithR, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestShellLsWithR_001, TestSize.Level1)
{
BShellParamCmdRegister(GetShellHandle(), 0);
const char *args[] = {
@ -56,7 +56,7 @@ HWTEST_F(BegetctlUnitTest, TestShellLsWithR, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestShellLsGet, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestShellLsGet_001, TestSize.Level1)
{
BShellParamCmdRegister(GetShellHandle(), 0);
const char *args[] = {
@ -65,7 +65,7 @@ HWTEST_F(BegetctlUnitTest, TestShellLsGet, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestShellSet, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestShellSet_001, TestSize.Level1)
{
BShellParamCmdRegister(GetShellHandle(), 0);
const char *args[] = {
@ -74,7 +74,7 @@ HWTEST_F(BegetctlUnitTest, TestShellSet, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestShellGetWithKey, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestShellGetWithKey_001, TestSize.Level1)
{
BShellParamCmdRegister(GetShellHandle(), 0);
const char *args[] = {
@ -83,7 +83,7 @@ HWTEST_F(BegetctlUnitTest, TestShellGetWithKey, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestShellWait, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestShellWait_001, TestSize.Level1)
{
BShellParamCmdRegister(GetShellHandle(), 0);
const char *args[] = {
@ -91,7 +91,7 @@ HWTEST_F(BegetctlUnitTest, TestShellWait, TestSize.Level1)
};
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestShellWaitFalse, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestShellWaitFalse_001, TestSize.Level1)
{
BShellParamCmdRegister(GetShellHandle(), 0);
const char *args[] = {
@ -100,7 +100,7 @@ HWTEST_F(BegetctlUnitTest, TestShellWaitFalse, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestShellWaitWithKey, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestShellWaitWithKey_001, TestSize.Level1)
{
BShellParamCmdRegister(GetShellHandle(), 0);
const char *args[] = {
@ -108,7 +108,7 @@ HWTEST_F(BegetctlUnitTest, TestShellWaitWithKey, TestSize.Level1)
};
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestShellParamShell, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestShellParamShell_001, TestSize.Level1)
{
BShellParamCmdRegister(GetShellHandle(), 0);
const char *args[] = {
@ -116,7 +116,7 @@ HWTEST_F(BegetctlUnitTest, TestShellParamShell, TestSize.Level1)
};
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestShellLsWithvalue, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestShellLsWithvalue_001, TestSize.Level1)
{
BShellParamCmdRegister(GetShellHandle(), 0);
BShellEnvSetParam(GetShellHandle(), PARAM_REVERESD_NAME_CURR_PARAMETER, "..a", PARAM_STRING, (void *)"..a");
@ -125,7 +125,7 @@ HWTEST_F(BegetctlUnitTest, TestShellLsWithvalue, TestSize.Level1)
};
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestShellLsWithvalueExist, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestShellLsWithvalueExist_001, TestSize.Level1)
{
BShellParamCmdRegister(GetShellHandle(), 0);
BShellEnvSetParam(GetShellHandle(), PARAM_REVERESD_NAME_CURR_PARAMETER, "#", PARAM_STRING, (void *)"#");
@ -135,7 +135,7 @@ HWTEST_F(BegetctlUnitTest, TestShellLsWithvalueExist, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestPartitionSlot_1, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestPartitionSlot_001, TestSize.Level1)
{
const char *args[] = {
"partitionslot", "getslot"
@ -143,7 +143,7 @@ HWTEST_F(BegetctlUnitTest, TestPartitionSlot_1, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestPartitionSlot_2, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestPartitionSlot_002, TestSize.Level1)
{
const char *args[] = {
"partitionslot", "getsuffix", "1"
@ -151,7 +151,7 @@ HWTEST_F(BegetctlUnitTest, TestPartitionSlot_2, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestPartitionSlot_3, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestPartitionSlot_003, TestSize.Level1)
{
const char *args[] = {
"partitionslot", "setactive", "1"
@ -159,7 +159,7 @@ HWTEST_F(BegetctlUnitTest, TestPartitionSlot_3, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestPartitionSlot_4, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestPartitionSlot_004, TestSize.Level1)
{
const char *args[] = {
"partitionslot", "setunboot", "2"
@ -167,7 +167,7 @@ HWTEST_F(BegetctlUnitTest, TestPartitionSlot_4, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestPartitionSlot_5, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestPartitionSlot_005, TestSize.Level1)
{
const char *args[] = {
"partitionslot", "setactive"
@ -175,7 +175,7 @@ HWTEST_F(BegetctlUnitTest, TestPartitionSlot_5, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestPartitionSlot_6, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestPartitionSlot_006, TestSize.Level1)
{
const char *args[] = {
"partitionslot", "setunboot"
@ -183,7 +183,7 @@ HWTEST_F(BegetctlUnitTest, TestPartitionSlot_6, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestPartitionSlot_7, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestPartitionSlot_007, TestSize.Level1)
{
const char *args[] = {
"partitionslot", "getsuffix"
@ -191,7 +191,7 @@ HWTEST_F(BegetctlUnitTest, TestPartitionSlot_7, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestBegetctl_1, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestShellLog_001, TestSize.Level1)
{
const char *args[] = {
"set", "log", "level", "1"
@ -199,7 +199,7 @@ HWTEST_F(BegetctlUnitTest, TestBegetctl_1, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestBegetctl_2, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestShellLog_002, TestSize.Level1)
{
const char *args[] = {
"get", "log", "level"
@ -207,7 +207,7 @@ HWTEST_F(BegetctlUnitTest, TestBegetctl_2, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestBegetctl_3, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestShellLog_003, TestSize.Level1)
{
const char *args[] = {
"set", "log", "level"
@ -215,7 +215,7 @@ HWTEST_F(BegetctlUnitTest, TestBegetctl_3, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestBegetctl_4, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestShellLog_004, TestSize.Level1)
{
const char *args[] = {
"set", "log", "level", "1000"
@ -223,7 +223,7 @@ HWTEST_F(BegetctlUnitTest, TestBegetctl_4, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestBegetctl_5, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestShellLog_005, TestSize.Level1)
{
const char *args[] = {
"set", "log", "level", "a"
@ -231,7 +231,7 @@ HWTEST_F(BegetctlUnitTest, TestBegetctl_5, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestBootChart_1, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestBootChart_001, TestSize.Level1)
{
const char *args[] = {
"bootchart", "enable"
@ -240,7 +240,7 @@ HWTEST_F(BegetctlUnitTest, TestBootChart_1, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestBootChart_2, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestBootChart_002, TestSize.Level1)
{
const char *args[] = {
"bootchart", "start"
@ -249,7 +249,7 @@ HWTEST_F(BegetctlUnitTest, TestBootChart_2, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestBootChart_3, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestBootChart_003, TestSize.Level1)
{
const char *args[] = {
"bootchart", "stop"
@ -257,7 +257,7 @@ HWTEST_F(BegetctlUnitTest, TestBootChart_3, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestBootChart_4, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestBootChart_004, TestSize.Level1)
{
const char *args[] = {
"bootchart", "disable"
@ -266,7 +266,7 @@ HWTEST_F(BegetctlUnitTest, TestBootChart_4, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestBootChart_5, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestBootChart_005, TestSize.Level1)
{
const char *args[] = {
"bootchart"
@ -274,7 +274,7 @@ HWTEST_F(BegetctlUnitTest, TestBootChart_5, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestDumpService_1, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestDumpService_001, TestSize.Level1)
{
const char *args[] = {
"bootevent", "enable"
@ -282,7 +282,7 @@ HWTEST_F(BegetctlUnitTest, TestDumpService_1, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestDumpService_2, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestDumpService_002, TestSize.Level1)
{
const char *args[] = {
"bootevent", "disable"
@ -290,7 +290,7 @@ HWTEST_F(BegetctlUnitTest, TestDumpService_2, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestDumpService_3, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestDumpService_003, TestSize.Level1)
{
const char *args[] = {
"dump_service", "all"
@ -298,7 +298,7 @@ HWTEST_F(BegetctlUnitTest, TestDumpService_3, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestDumpService_4, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestDumpService_004, TestSize.Level1)
{
const char *args[] = {
"dump_service", "param_watcher"
@ -306,7 +306,7 @@ HWTEST_F(BegetctlUnitTest, TestDumpService_4, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestDumpService_5, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestDumpService_005, TestSize.Level1)
{
const char *args[] = {
"dump_service", "parameter-service", "trigger"
@ -330,7 +330,7 @@ HWTEST_F(BegetctlUnitTest, Init_TestDumpAppspawn_001, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestMiscDaemon, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestMiscDaemon_001, TestSize.Level1)
{
const char *args[] = {
"misc_daemon", "--write_logo", BOOT_CMD_LINE
@ -338,7 +338,7 @@ HWTEST_F(BegetctlUnitTest, TestMiscDaemon, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestMiscDaemon_1, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestMiscDaemon_002, TestSize.Level1)
{
const char *args[] = {
"misc_daemon", "--write_logo1111", "test"
@ -346,7 +346,7 @@ HWTEST_F(BegetctlUnitTest, TestMiscDaemon_1, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestMiscDaemon_2, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestMiscDaemon_003, TestSize.Level1)
{
const char *args[] = {
"misc_daemon", "--write_logo", ""
@ -354,7 +354,7 @@ HWTEST_F(BegetctlUnitTest, TestMiscDaemon_2, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestMiscDaemon_3, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestMiscDaemon_004, TestSize.Level1)
{
const char *args[] = {
"misc_daemon", "--write_logo"
@ -362,7 +362,7 @@ HWTEST_F(BegetctlUnitTest, TestMiscDaemon_3, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestMiscDaemon_4, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestMiscDaemon_005, TestSize.Level1)
{
// clear misc logo
const char *args[] = {
@ -371,7 +371,7 @@ HWTEST_F(BegetctlUnitTest, TestMiscDaemon_4, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestModulectl_1, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestModulectl_001, TestSize.Level1)
{
const char *args[] = {
"modulectl", "install", "testModule"
@ -379,7 +379,7 @@ HWTEST_F(BegetctlUnitTest, TestModulectl_1, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestModulectl_2, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestModulectl_002, TestSize.Level1)
{
const char *args[] = {
"modulectl", "uninstall", "testModule"
@ -387,7 +387,7 @@ HWTEST_F(BegetctlUnitTest, TestModulectl_2, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestModulectl_3, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestModulectl_003, TestSize.Level1)
{
const char *args[] = {
"modulectl", "list", "testModule"
@ -395,7 +395,7 @@ HWTEST_F(BegetctlUnitTest, TestModulectl_3, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestModulectl_4, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestModulectl_004, TestSize.Level1)
{
const char *args[] = {
"modulectl", "install"
@ -403,7 +403,7 @@ HWTEST_F(BegetctlUnitTest, TestModulectl_4, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestModulectl_5, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestModulectl_005, TestSize.Level1)
{
const char *args[] = {
"modulectl", "list"
@ -411,12 +411,12 @@ HWTEST_F(BegetctlUnitTest, TestModulectl_5, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestModulectl_6, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestModulectl_006, TestSize.Level1)
{
BShellEnvDirectExecute(GetShellHandle(), 0, nullptr);
}
HWTEST_F(BegetctlUnitTest, TestServiceControl_1, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestServiceControl_001, TestSize.Level1)
{
const char *args[] = {
"service_control", "stop", "test"
@ -424,7 +424,7 @@ HWTEST_F(BegetctlUnitTest, TestServiceControl_1, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestServiceControl_2, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestServiceControl_002, TestSize.Level1)
{
const char *args[] = {
"service_control", "start", "test"
@ -432,7 +432,7 @@ HWTEST_F(BegetctlUnitTest, TestServiceControl_2, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestServiceControl_3, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestServiceControl_003, TestSize.Level1)
{
const char *args[] = {
"stop_service", "test"
@ -440,7 +440,7 @@ HWTEST_F(BegetctlUnitTest, TestServiceControl_3, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestServiceControl_4, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestServiceControl_004, TestSize.Level1)
{
const char *args[] = {
"start_service", "test"
@ -448,7 +448,7 @@ HWTEST_F(BegetctlUnitTest, TestServiceControl_4, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestServiceControl_5, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestServiceControl_005, TestSize.Level1)
{
const char *args[] = {
"timer_stop", "test"
@ -456,7 +456,7 @@ HWTEST_F(BegetctlUnitTest, TestServiceControl_5, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestServiceControl_6, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestServiceControl_006, TestSize.Level1)
{
const char *args[] = {
"timer_stop"
@ -464,7 +464,7 @@ HWTEST_F(BegetctlUnitTest, TestServiceControl_6, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestServiceControl_7, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestServiceControl_007, TestSize.Level1)
{
const char *args[] = {
"timer_start", "test-service", "10"
@ -472,7 +472,7 @@ HWTEST_F(BegetctlUnitTest, TestServiceControl_7, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestServiceControl_8, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestServiceControl_008, TestSize.Level1)
{
const char *args[] = {
"timer_start", "test-service",
@ -480,7 +480,7 @@ HWTEST_F(BegetctlUnitTest, TestServiceControl_8, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestServiceControl_9, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestServiceControl_009, TestSize.Level1)
{
const char *args[] = {
"timer_start", "test-service", "ww"
@ -488,7 +488,7 @@ HWTEST_F(BegetctlUnitTest, TestServiceControl_9, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestServiceControl_10, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestServiceControl_010, TestSize.Level1)
{
const char *args[] = {
"xxxxxxxxxxxxxx", "test-service", "ww"
@ -496,7 +496,7 @@ HWTEST_F(BegetctlUnitTest, TestServiceControl_10, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestSetLogLevel_1, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestSetLogLevel_001, TestSize.Level1)
{
const char *args[] = {
"setloglevel", "1"
@ -504,7 +504,7 @@ HWTEST_F(BegetctlUnitTest, TestSetLogLevel_1, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestSetLogLevel_2, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestSetLogLevel_002, TestSize.Level1)
{
const char *args[] = {
"getloglevel"
@ -512,7 +512,7 @@ HWTEST_F(BegetctlUnitTest, TestSetLogLevel_2, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestSetLogLevel_3, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestSetLogLevel_003, TestSize.Level1)
{
const char *args[] = {
"setloglevel", "a"
@ -520,7 +520,7 @@ HWTEST_F(BegetctlUnitTest, TestSetLogLevel_3, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestSetLogLevel_4, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestSetLogLevel_004, TestSize.Level1)
{
const char *args[] = {
"setloglevel"
@ -528,7 +528,7 @@ HWTEST_F(BegetctlUnitTest, TestSetLogLevel_4, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestSetLogLevel_5, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestSetLogLevel_005, TestSize.Level1)
{
const char *args[] = {
"setloglevel"
@ -536,7 +536,7 @@ HWTEST_F(BegetctlUnitTest, TestSetLogLevel_5, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), 0, const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestSandbox_1, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestSandbox_001, TestSize.Level1)
{
const char *args[] = {
"sandbox", "-s", "test", "-n", "test2", "-p", "test3", "-h", "?"
@ -544,7 +544,7 @@ HWTEST_F(BegetctlUnitTest, TestSandbox_1, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestSandbox_2, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestSandbox_002, TestSize.Level1)
{
const char *args[] = {
"sandbox", "-b", "1008"
@ -552,7 +552,7 @@ HWTEST_F(BegetctlUnitTest, TestSandbox_2, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestReboot_1, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestReboot_001, TestSize.Level1)
{
const char *args[] = {
"reboot"
@ -560,7 +560,7 @@ HWTEST_F(BegetctlUnitTest, TestReboot_1, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestReboot_2, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestReboot_002, TestSize.Level1)
{
const char *args[] = {
"reboot", "shutdown"
@ -568,7 +568,7 @@ HWTEST_F(BegetctlUnitTest, TestReboot_2, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestReboot_3, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestReboot_003, TestSize.Level1)
{
const char *args[] = {
"reboot", "charge"
@ -576,7 +576,7 @@ HWTEST_F(BegetctlUnitTest, TestReboot_3, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestReboot_4, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestReboot_004, TestSize.Level1)
{
const char *args[] = {
"reboot", "updater"
@ -584,7 +584,7 @@ HWTEST_F(BegetctlUnitTest, TestReboot_4, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestReboot_5, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestReboot_005, TestSize.Level1)
{
const char *args[] = {
"reboot", "updater:aaaaaaa"
@ -592,7 +592,7 @@ HWTEST_F(BegetctlUnitTest, TestReboot_5, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestReboot_6, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestReboot_006, TestSize.Level1)
{
const char *args[] = {
"reboot", "flashd:aaaaaaa"
@ -600,7 +600,7 @@ HWTEST_F(BegetctlUnitTest, TestReboot_6, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestReboot_7, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestReboot_007, TestSize.Level1)
{
const char *args[] = {
"reboot", "flashd"
@ -608,7 +608,7 @@ HWTEST_F(BegetctlUnitTest, TestReboot_7, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestReboot_8, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestReboot_008, TestSize.Level1)
{
const char *args[] = {
"reboot", "suspend"
@ -616,7 +616,7 @@ HWTEST_F(BegetctlUnitTest, TestReboot_8, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestReboot_9, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestReboot_009, TestSize.Level1)
{
const char *args[] = {
"reboot", "222222222"
@ -624,7 +624,7 @@ HWTEST_F(BegetctlUnitTest, TestReboot_9, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestGid_1, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestGid_001, TestSize.Level1)
{
const char *args[] = {
"dac", "gid", "logd"
@ -632,7 +632,7 @@ HWTEST_F(BegetctlUnitTest, TestGid_1, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestGid_2, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestGid_002, TestSize.Level1)
{
const char *args[] = {
"dac"
@ -640,7 +640,7 @@ HWTEST_F(BegetctlUnitTest, TestGid_2, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestUid_1, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestUid_001, TestSize.Level1)
{
const char *args[] = {
"dac", "uid", ""
@ -648,7 +648,7 @@ HWTEST_F(BegetctlUnitTest, TestUid_1, TestSize.Level1)
BShellEnvDirectExecute(GetShellHandle(), sizeof(args) / sizeof(args[0]), const_cast<char **>(args));
}
HWTEST_F(BegetctlUnitTest, TestUid_2, TestSize.Level1)
HWTEST_F(BegetctlUnitTest, Init_TestUid_002, TestSize.Level1)
{
const char *args[] = {
"dac", "uid", ""

View File

@ -80,7 +80,7 @@ public:
}
};
HWTEST_F(DeviceInfoUnittest, DevInfoAgentTest, TestSize.Level1)
HWTEST_F(DeviceInfoUnittest, Init_DevInfoAgentTest_001, TestSize.Level1)
{
OHOS::device_info::DeviceInfoKits &kits = OHOS::device_info::DeviceInfoKits::GetInstance();
std::string serial = {};
@ -90,7 +90,7 @@ HWTEST_F(DeviceInfoUnittest, DevInfoAgentTest, TestSize.Level1)
EXPECT_EQ(ret, SYSPARAM_PERMISSION_DENIED);
}
HWTEST_F(DeviceInfoUnittest, DevInfoDiedTest, TestSize.Level1)
HWTEST_F(DeviceInfoUnittest, Init_DevInfoDiedTest_001, TestSize.Level1)
{
sptr<ISystemAbilityManager> samgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager();
DINFO_CHECK(samgr != nullptr, return, "Get samgr failed");
@ -105,7 +105,7 @@ HWTEST_F(DeviceInfoUnittest, DevInfoDiedTest, TestSize.Level1)
EXPECT_EQ(ret, SYSPARAM_PERMISSION_DENIED);
}
HWTEST_F(DeviceInfoUnittest, DevInfoAgentFail, TestSize.Level1)
HWTEST_F(DeviceInfoUnittest, Init_DevInfoAgentFail_001, TestSize.Level1)
{
sptr<OHOS::device_info::DeviceInfoLoad> deviceInfoLoad = new (std::nothrow) OHOS::device_info::DeviceInfoLoad();
ASSERT_NE(deviceInfoLoad, nullptr);
@ -116,7 +116,7 @@ HWTEST_F(DeviceInfoUnittest, DevInfoAgentFail, TestSize.Level1)
kits.FinishStartSAFailed();
}
HWTEST_F(DeviceInfoUnittest, DeviceInfoServiceInvalidTokenTest, TestSize.Level1)
HWTEST_F(DeviceInfoUnittest, Init_DeviceInfoServiceInvalidTokenTest_001, TestSize.Level1)
{
string result;
DeviceInfoServicePtr deviceInfoService = GetDeviceInfoService();
@ -130,7 +130,7 @@ HWTEST_F(DeviceInfoUnittest, DeviceInfoServiceInvalidTokenTest, TestSize.Level1)
(static_cast<uint32_t> (OHOS::device_info::DeviceInfoInterfaceCode::COMMAND_GET_UDID), data, reply, option);
}
HWTEST_F(DeviceInfoUnittest, DeviceInfoServiceFailTest, TestSize.Level1)
HWTEST_F(DeviceInfoUnittest, Init_DeviceInfoServiceFailTest_001, TestSize.Level1)
{
string result;
DeviceInfoServicePtr deviceInfoService = GetDeviceInfoService();
@ -153,7 +153,7 @@ HWTEST_F(DeviceInfoUnittest, DeviceInfoServiceFailTest, TestSize.Level1)
data, reply, option);
}
HWTEST_F(DeviceInfoUnittest, DeviceInfoServiceTest, TestSize.Level1)
HWTEST_F(DeviceInfoUnittest, Init_DeviceInfoServiceTest_001, TestSize.Level1)
{
string result;
DeviceInfoServicePtr deviceInfoService = GetDeviceInfoService();
@ -188,7 +188,7 @@ HWTEST_F(DeviceInfoUnittest, DeviceInfoServiceTest, TestSize.Level1)
deviceInfoService->Dump(-1, args);
}
HWTEST_F(DeviceInfoUnittest, TestInterface, TestSize.Level1)
HWTEST_F(DeviceInfoUnittest, Init_TestInterface_001, TestSize.Level1)
{
char localDeviceId[UDID_LEN] = {0};
int ret = AclGetDevUdid(nullptr, UDID_LEN);
@ -201,9 +201,11 @@ HWTEST_F(DeviceInfoUnittest, TestInterface, TestSize.Level1)
EXPECT_NE(nullptr, serialNumber);
}
HWTEST_F(DeviceInfoUnittest, TestDeviceInfoProxy1, TestSize.Level1)
HWTEST_F(DeviceInfoUnittest, Init_TestDeviceInfoProxy_001, TestSize.Level1)
{
auto remotePtr = device_info::DeviceInfoKits::GetInstance().GetService();
OHOS::device_info::DeviceInfoKits &kits = device_info::DeviceInfoKits::GetInstance();
std::unique_lock<std::mutex> lock(kits.lock_);
auto remotePtr = device_info::DeviceInfoKits::GetInstance().GetService(lock);
ASSERT_NE(remotePtr, nullptr);
auto remote = remotePtr->AsObject();
sptr<device_info::DeviceInfoProxy> proxy = new(std::nothrow) device_info::DeviceInfoProxy(remote);
@ -221,7 +223,7 @@ HWTEST_F(DeviceInfoUnittest, TestDeviceInfoProxy1, TestSize.Level1)
EXPECT_NE(nullptr, serialNumber);
}
HWTEST_F(DeviceInfoUnittest, TestDeviceInfoProxy2, TestSize.Level1)
HWTEST_F(DeviceInfoUnittest, Init_TestDeviceInfoProxy_002, TestSize.Level1)
{
sptr<device_info::DeviceInfoProxy> proxy = new(std::nothrow) device_info::DeviceInfoProxy(nullptr);
ASSERT_NE(proxy, nullptr);

View File

@ -101,7 +101,7 @@ static void *TestReadData(void *args)
return nullptr;
}
HWTEST_F(AtomicUnitTest, AtomicUnitTest_001, TestSize.Level0)
HWTEST_F(AtomicUnitTest, Init_AtomicUnitTest_001, TestSize.Level0)
{
printf("AtomicUnitTest_001 \n");
pthread_t writeThread = 0;

View File

@ -183,7 +183,7 @@ public:
void TestBody(void) {}
};
HWTEST_F(ClientUnitTest, TestClient_01, TestSize.Level0)
HWTEST_F(ClientUnitTest, Init_TestClient_001, TestSize.Level0)
{
const std::string name = "test.add.client.001.001";
const std::string value = "test.add.client.value.001.001";
@ -201,7 +201,7 @@ HWTEST_F(ClientUnitTest, TestClient_01, TestSize.Level0)
SystemWaitParameter("@@@@", value.c_str(), 1);
}
HWTEST_F(ClientUnitTest, TestParamValue, TestSize.Level0)
HWTEST_F(ClientUnitTest, Init_TestParamValue_001, TestSize.Level0)
{
// support empty string
const char *name = "test_readonly.dddddddddddddddddd.fffffffffffffffffff";
@ -213,7 +213,7 @@ HWTEST_F(ClientUnitTest, TestParamValue, TestSize.Level0)
EXPECT_EQ(ret, 0);
}
HWTEST_F(ClientUnitTest, TestClient_02, TestSize.Level0)
HWTEST_F(ClientUnitTest, Init_TestClient_002, TestSize.Level0)
{
char testBuffer[PARAM_BUFFER_SIZE] = {0};
const std::string value = "test.add.client.value.001";
@ -221,14 +221,14 @@ HWTEST_F(ClientUnitTest, TestClient_02, TestSize.Level0)
TestClientApi(testBuffer, PARAM_BUFFER_SIZE, name.c_str(), value.c_str());
}
HWTEST_F(ClientUnitTest, TestClient_03, TestSize.Level0)
HWTEST_F(ClientUnitTest, Init_TestClient_003, TestSize.Level0)
{
// 3 Traversal test
TestParamTraversal();
SystemDumpParameters(1, -1, nullptr);
}
HWTEST_F(ClientUnitTest, TestClient_04, TestSize.Level0)
HWTEST_F(ClientUnitTest, Init_TestClient_004, TestSize.Level0)
{
const std::string name = "test.add.client.001.004";
int ret = WatchParamCheck(name.c_str());
@ -246,12 +246,12 @@ HWTEST_F(ClientUnitTest, TestClient_04, TestSize.Level0)
TestPermission();
}
HWTEST_F(ClientUnitTest, TestClient_05, TestSize.Level0)
HWTEST_F(ClientUnitTest, Init_TestClient_005, TestSize.Level0)
{
TestForMultiThread();
}
HWTEST_F(ClientUnitTest, TestClient_06, TestSize.Level0)
HWTEST_F(ClientUnitTest, Init_TestClient_006, TestSize.Level0)
{
int ret = SystemSetParameter("test.type.string.xxx", "xxxxxxx");
EXPECT_EQ(ret, 0);

View File

@ -127,19 +127,19 @@ private:
ParamSecurityOps clientParamSercurityOps {};
};
HWTEST_F(DacUnitTest, TestDacInitLocalLabel, TestSize.Level0)
HWTEST_F(DacUnitTest, Init_TestDacInitLocalLabel_001, TestSize.Level0)
{
DacUnitTest test;
test.TestDacInitLocalLabel();
}
HWTEST_F(DacUnitTest, TestDacCheckFilePermission, TestSize.Level0)
HWTEST_F(DacUnitTest, Init_TestDacCheckFilePermission_001, TestSize.Level0)
{
DacUnitTest test;
test.TestDacCheckFilePermission(STARTUP_INIT_UT_PATH "/trigger_test.cfg");
}
HWTEST_F(DacUnitTest, TestDacCheckUserParaPermission, TestSize.Level0)
HWTEST_F(DacUnitTest, Init_TestDacCheckUserParaPermission_001, TestSize.Level0)
{
// 相同用户
DacUnitTest test;
@ -180,7 +180,7 @@ HWTEST_F(DacUnitTest, TestDacCheckUserParaPermission, TestSize.Level0)
EXPECT_EQ(ret, 0);
}
HWTEST_F(DacUnitTest, TestDacCheckGroupParaPermission, TestSize.Level0)
HWTEST_F(DacUnitTest, Init_TestDacCheckGroupParaPermission_001, TestSize.Level0)
{
// 相同组
DacUnitTest test;
@ -221,7 +221,7 @@ HWTEST_F(DacUnitTest, TestDacCheckGroupParaPermission, TestSize.Level0)
EXPECT_EQ(ret, 0);
}
HWTEST_F(DacUnitTest, TestDacCheckOtherParaPermission, TestSize.Level0)
HWTEST_F(DacUnitTest, Init_TestDacCheckOtherParaPermission_001, TestSize.Level0)
{
// 其他用户
DacUnitTest test;
@ -262,7 +262,7 @@ HWTEST_F(DacUnitTest, TestDacCheckOtherParaPermission, TestSize.Level0)
EXPECT_EQ(ret, 0);
}
HWTEST_F(DacUnitTest, TestClientDacCheckFilePermission, TestSize.Level0)
HWTEST_F(DacUnitTest, Init_TestClientDacCheckFilePermission_001, TestSize.Level0)
{
DacUnitTest test;
test.TestClientDacCheckFilePermission(STARTUP_INIT_UT_PATH "/trigger_test.cfg");

View File

@ -180,14 +180,14 @@ public:
}
};
HWTEST_F(ParamShellUnitTest, TestInitParamShell, TestSize.Level1)
HWTEST_F(ParamShellUnitTest, Init_TestInitParamShell_001, TestSize.Level1)
{
ParamShellUnitTest test;
test.TestInitParamShell();
test.TestParamShellCmd();
test.TestParamShellCmd1();
}
HWTEST_F(ParamShellUnitTest, TestParamShellInput, TestSize.Level1)
HWTEST_F(ParamShellUnitTest, Init_TestParamShellInput_001, TestSize.Level1)
{
BShellHandle bshd = GetShellHandle();
BShellEnvProcessInput(bshd, '\n');
@ -206,7 +206,7 @@ HWTEST_F(ParamShellUnitTest, TestParamShellInput, TestSize.Level1)
int ret = BShellEnvRegisterKeyHandle(bshd, 'z', (BShellkeyHandle)(void*)0x409600); // 0x409600 construct address
EXPECT_EQ(ret, 0);
}
HWTEST_F(ParamShellUnitTest, TestParamShellcmd2, TestSize.Level1)
HWTEST_F(ParamShellUnitTest, Init_TestParamShellcmd_001, TestSize.Level1)
{
ParamShellUnitTest test;
test.TestParamShellcmdEndkey();

View File

@ -316,13 +316,13 @@ public:
}
};
HWTEST_F(ParamUnitTest, TestPersistParam, TestSize.Level0)
HWTEST_F(ParamUnitTest, Init_TestPersistParam_001, TestSize.Level0)
{
ParamUnitTest test;
test.TestPersistParam();
}
HWTEST_F(ParamUnitTest, TestSetParam_1, TestSize.Level0)
HWTEST_F(ParamUnitTest, Init_TestSetParam_001, TestSize.Level0)
{
ParamUnitTest test;
const char *params[][2] = {{"111.2222", "1"},
@ -333,7 +333,7 @@ HWTEST_F(ParamUnitTest, TestSetParam_1, TestSize.Level0)
test.TestSetParams(params, 5);
}
HWTEST_F(ParamUnitTest, TestSetParam_2, TestSize.Level0)
HWTEST_F(ParamUnitTest, Init_TestSetParam_002, TestSize.Level0)
{
ParamUnitTest test;
const char *params[][2] = {{"111.2222.xxxx.xxx.xxx", "1_1"},
@ -358,13 +358,13 @@ HWTEST_F(ParamUnitTest, TestSetParam_2, TestSize.Level0)
test.TestSetParams(sysParams, 5);
}
HWTEST_F(ParamUnitTest, TestNameIsValid, TestSize.Level0)
HWTEST_F(ParamUnitTest, Init_TestNameIsValid_001, TestSize.Level0)
{
ParamUnitTest test;
test.TestNameIsValid();
}
HWTEST_F(ParamUnitTest, TestParamValue, TestSize.Level0)
HWTEST_F(ParamUnitTest, Init_TestParamValue_001, TestSize.Level0)
{
// support empty string
const char *name = "test_readonly.dddddddddddddddddd.fffffffffffffffffff";
@ -379,31 +379,31 @@ HWTEST_F(ParamUnitTest, TestParamValue, TestSize.Level0)
CheckServerParamValue(name, "");
}
HWTEST_F(ParamUnitTest, TestAddSecurityLabel1, TestSize.Level0)
HWTEST_F(ParamUnitTest, Init_TestAddSecurityLabel_001, TestSize.Level0)
{
ParamUnitTest test;
test.TestAddSecurityLabel1();
}
HWTEST_F(ParamUnitTest, TestAddSecurityLabel2, TestSize.Level0)
HWTEST_F(ParamUnitTest, Init_TestAddSecurityLabel_002, TestSize.Level0)
{
ParamUnitTest test;
test.TestAddSecurityLabel2();
}
HWTEST_F(ParamUnitTest, TestAddSecurityLabel3, TestSize.Level0)
HWTEST_F(ParamUnitTest, Init_TestAddSecurityLabel_003, TestSize.Level0)
{
ParamUnitTest test;
test.TestAddSecurityLabel3();
}
HWTEST_F(ParamUnitTest, TestAddSecurityLabel4, TestSize.Level0)
HWTEST_F(ParamUnitTest, Init_TestAddSecurityLabel_004, TestSize.Level0)
{
ParamUnitTest test;
test.TestAddSecurityLabel4();
}
HWTEST_F(ParamUnitTest, TestUpdateParam, TestSize.Level0)
HWTEST_F(ParamUnitTest, Init_TestUpdateParam_001, TestSize.Level0)
{
ParamUnitTest test;
test.TestUpdateParam("test.aaa.bbb.ccc.ddd", "100");
@ -413,19 +413,19 @@ HWTEST_F(ParamUnitTest, TestUpdateParam, TestSize.Level0)
test.TestUpdateParam("net.tcp.default_init_rwnd", "60");
}
HWTEST_F(ParamUnitTest, TestParamTraversal, TestSize.Level0)
HWTEST_F(ParamUnitTest, Init_TestParamTraversal_001, TestSize.Level0)
{
ParamUnitTest test;
test.TestParamTraversal();
}
HWTEST_F(ParamUnitTest, TestDumpParamMemory, TestSize.Level0)
HWTEST_F(ParamUnitTest, Init_TestDumpParamMemory_001, TestSize.Level0)
{
ParamUnitTest test;
test.TestDumpParamMemory();
}
HWTEST_F(ParamUnitTest, TestLinuxRWLock, TestSize.Level0)
HWTEST_F(ParamUnitTest, Init_TestLinuxRWLock_001, TestSize.Level0)
{
ParamRWMutexCreate(nullptr);
ParamRWMutexWRLock(nullptr);
@ -435,7 +435,7 @@ HWTEST_F(ParamUnitTest, TestLinuxRWLock, TestSize.Level0)
ParamMutexDelete(nullptr);
}
HWTEST_F(ParamUnitTest, TestWorkSpace1, TestSize.Level0)
HWTEST_F(ParamUnitTest, Init_TestWorkSpace_001, TestSize.Level0)
{
int ret = AddWorkSpace("test.workspace.1", GetWorkSpaceIndex("test.workspace.1"), 0, PARAM_WORKSPACE_DEF);
EXPECT_EQ(ret, 0);
@ -448,7 +448,7 @@ HWTEST_F(ParamUnitTest, TestWorkSpace1, TestSize.Level0)
CloseWorkSpace(nullptr);
}
HWTEST_F(ParamUnitTest, TestWorkSpace2, TestSize.Level0)
HWTEST_F(ParamUnitTest, Init_TestWorkSpace_002, TestSize.Level0)
{
const char *spaceName = "test.workspace2";
const size_t size = strlen(spaceName) + 1;
@ -466,7 +466,7 @@ HWTEST_F(ParamUnitTest, TestWorkSpace2, TestSize.Level0)
}
#if !(defined __LITEOS_A__ || defined __LITEOS_M__) // can not support parameter type
HWTEST_F(ParamUnitTest, TestParamValueType1, TestSize.Level0)
HWTEST_F(ParamUnitTest, Init_TestParamValueType_001, TestSize.Level0)
{
int ret = SystemWriteParam("test.type.int.1000", "10000");
EXPECT_EQ(ret, 0);
@ -477,7 +477,7 @@ HWTEST_F(ParamUnitTest, TestParamValueType1, TestSize.Level0)
EXPECT_EQ(ret, PARAM_CODE_INVALID_VALUE);
}
HWTEST_F(ParamUnitTest, TestParamValueType2, TestSize.Level0)
HWTEST_F(ParamUnitTest, Init_TestParamValueType_002, TestSize.Level0)
{
int ret = SystemWriteParam("test.type.bool.1000", "10000");
EXPECT_EQ(ret, PARAM_CODE_INVALID_VALUE);
@ -509,7 +509,7 @@ HWTEST_F(ParamUnitTest, TestParamValueType2, TestSize.Level0)
}
#endif
HWTEST_F(ParamUnitTest, TestGetServiceCtlName, TestSize.Level0)
HWTEST_F(ParamUnitTest, Init_TestGetServiceCtlName_001, TestSize.Level0)
{
ServiceCtrlInfo *serviceInfo = nullptr;
GetServiceCtrlInfo("ohos.startup.powerctrl", "reboot,updater", &serviceInfo);
@ -530,7 +530,7 @@ HWTEST_F(ParamUnitTest, TestGetServiceCtlName, TestSize.Level0)
ParamWorBaseLog(INIT_DEBUG, PARAN_DOMAIN, "PARAM", "%s", "ParamWorBaseLog");
}
HWTEST_F(ParamUnitTest, TestFindTrieNode, TestSize.Level0)
HWTEST_F(ParamUnitTest, Init_TestFindTrieNode_001, TestSize.Level0)
{
int ret = AddWorkSpace("test.workspace.1", GetWorkSpaceIndex("test.workspace.1"), 0, PARAM_WORKSPACE_DEF);
EXPECT_EQ(ret, 0);
@ -547,7 +547,7 @@ HWTEST_F(ParamUnitTest, TestFindTrieNode, TestSize.Level0)
}
#ifndef OHOS_LITE
HWTEST_F(ParamUnitTest, TestConnectServer, TestSize.Level0)
HWTEST_F(ParamUnitTest, Init_TestConnectServer_001, TestSize.Level0)
{
int ret = ConnectServer(-1, CLIENT_PIPE_NAME);
EXPECT_NE(ret, 0);
@ -559,7 +559,7 @@ HWTEST_F(ParamUnitTest, TestConnectServer, TestSize.Level0)
close(fd);
}
HWTEST_F(ParamUnitTest, TestRequestMessage, TestSize.Level0)
HWTEST_F(ParamUnitTest, Init_TestRequestMessage_001, TestSize.Level0)
{
const int maxSize = 1024 * 64 + 10;
const int msgSize = sizeof(ParamMessage) + 128; // 128 TEST
@ -604,7 +604,7 @@ HWTEST_F(ParamUnitTest, TestRequestMessage, TestSize.Level0)
free(msg);
}
HWTEST_F(ParamUnitTest, TestServerTaskFail, TestSize.Level0)
HWTEST_F(ParamUnitTest, Init_TestServerTaskFail_001, TestSize.Level0)
{
ParamTaskPtr serverTask = nullptr;
ParamStreamInfo info = {};
@ -620,7 +620,7 @@ HWTEST_F(ParamUnitTest, TestServerTaskFail, TestSize.Level0)
EXPECT_NE(ret, 0);
}
HWTEST_F(ParamUnitTest, TestStreamTaskFail, TestSize.Level0)
HWTEST_F(ParamUnitTest, Init_TestStreamTaskFail_001, TestSize.Level0)
{
ParamTaskPtr client = nullptr;
ParamStreamInfo info = {};
@ -653,7 +653,7 @@ HWTEST_F(ParamUnitTest, TestStreamTaskFail, TestSize.Level0)
EXPECT_NE(ret, 0);
}
HWTEST_F(ParamUnitTest, TestParamCache, TestSize.Level0)
HWTEST_F(ParamUnitTest, Init_TestParamCache_001, TestSize.Level0)
{
const char *value = CachedParameterGet(nullptr);
EXPECT_EQ(value, nullptr);

View File

@ -466,13 +466,13 @@ public:
}
};
HWTEST_F(ParamServiceUnitTest, TestPersistParam, TestSize.Level0)
HWTEST_F(ParamServiceUnitTest, Init_TestPersistParam_001, TestSize.Level0)
{
ParamServiceUnitTest test;
test.TestPersistParam();
}
HWTEST_F(ParamServiceUnitTest, TestReadCmdline, TestSize.Level0)
HWTEST_F(ParamServiceUnitTest, Init_TestReadCmdline_001, TestSize.Level0)
{
const char *snData = "222222222222222222222";
CreateTestFile(STARTUP_INIT_UT_PATH "/system/etc/sn", snData);
@ -490,45 +490,45 @@ HWTEST_F(ParamServiceUnitTest, TestReadCmdline, TestSize.Level0)
LoadParamFromCmdLine();
}
HWTEST_F(ParamServiceUnitTest, TestServiceProcessMessage, TestSize.Level0)
HWTEST_F(ParamServiceUnitTest, Init_TestServiceProcessMessage_001, TestSize.Level0)
{
ParamServiceUnitTest test;
test.TestServiceProcessMessage("wertt.qqqq.wwww.rrrr", "wwww.eeeee", 1);
test.TestServiceProcessMessage("wertt.2222.wwww.3333", "wwww.eeeee", 0);
}
HWTEST_F(ParamServiceUnitTest, TestAddParamWait1, TestSize.Level0)
HWTEST_F(ParamServiceUnitTest, Init_TestAddParamWait_001, TestSize.Level0)
{
ParamServiceUnitTest test;
test.TestAddParamWait1();
}
HWTEST_F(ParamServiceUnitTest, TestAddParamWait2, TestSize.Level0)
HWTEST_F(ParamServiceUnitTest, Init_TestAddParamWait_002, TestSize.Level0)
{
ParamServiceUnitTest test;
test.TestAddParamWait2();
}
HWTEST_F(ParamServiceUnitTest, TestAddParamWait3, TestSize.Level0)
HWTEST_F(ParamServiceUnitTest, Init_TestAddParamWait_003, TestSize.Level0)
{
ParamServiceUnitTest test;
test.TestAddParamWait3();
}
HWTEST_F(ParamServiceUnitTest, TestAddParamWatch1, TestSize.Level0)
HWTEST_F(ParamServiceUnitTest, Init_TestAddParamWatch_001, TestSize.Level0)
{
ParamServiceUnitTest test;
test.TestAddParamWatch1();
}
HWTEST_F(ParamServiceUnitTest, TestAddParamWatch2, TestSize.Level0)
HWTEST_F(ParamServiceUnitTest, Init_TestAddParamWatch_002, TestSize.Level0)
{
ParamServiceUnitTest test;
test.TestAddParamWatch2();
}
#ifndef OHOS_LITE
HWTEST_F(ParamServiceUnitTest, TestAddParamWatch3, TestSize.Level0)
HWTEST_F(ParamServiceUnitTest, Init_TestAddParamWatch_003, TestSize.Level0)
{
ParamServiceUnitTest test;
test.TestAddParamWatch3();
@ -536,13 +536,13 @@ HWTEST_F(ParamServiceUnitTest, TestAddParamWatch3, TestSize.Level0)
EXPECT_EQ(hashCode, 0);
}
HWTEST_F(ParamServiceUnitTest, TestCloseTriggerWatch, TestSize.Level0)
HWTEST_F(ParamServiceUnitTest, Init_TestCloseTriggerWatch_001, TestSize.Level0)
{
ParamServiceUnitTest test;
test.TestCloseTriggerWatch();
}
HWTEST_F(ParamServiceUnitTest, TestServiceCtrl, TestSize.Level0)
HWTEST_F(ParamServiceUnitTest, Init_TestServiceCtrl_001, TestSize.Level0)
{
ParamServiceUnitTest test;
int ret = test.TestServiceCtrl("server1", 0770);
@ -555,7 +555,7 @@ HWTEST_F(ParamServiceUnitTest, TestServiceCtrl, TestSize.Level0)
ret = 0;
}
HWTEST_F(ParamServiceUnitTest, TestPowerCtrl, TestSize.Level0)
HWTEST_F(ParamServiceUnitTest, Init_TestPowerCtrl_001, TestSize.Level0)
{
ParamServiceUnitTest test;
int ret = test.TestPowerCtrl("reboot,shutdown", 0770);

View File

@ -158,31 +158,31 @@ private:
ParamSecurityOps clientParamSercurityOps {};
};
HWTEST_F(SelinuxUnitTest, TestSelinuxInitLocalLabel, TestSize.Level0)
HWTEST_F(SelinuxUnitTest, Init_TestSelinuxInitLocalLabel_001, TestSize.Level0)
{
SelinuxUnitTest test;
test.TestSelinuxInitLocalLabel();
}
HWTEST_F(SelinuxUnitTest, TestSelinuxCheckFilePermission, TestSize.Level0)
HWTEST_F(SelinuxUnitTest, Init_TestSelinuxCheckFilePermission_001, TestSize.Level0)
{
SelinuxUnitTest test;
test.TestSelinuxCheckFilePermission(STARTUP_INIT_UT_PATH "/trigger_test.cfg");
}
HWTEST_F(SelinuxUnitTest, TestSelinuxCheckParaPermission, TestSize.Level0)
HWTEST_F(SelinuxUnitTest, Init_TestSelinuxCheckParaPermission_001, TestSize.Level0)
{
SelinuxUnitTest test;
test.TestSelinuxCheckParaPermission("aaa.bbb.bbb.ccc", "user:group1:r");
}
HWTEST_F(SelinuxUnitTest, TestClientDacCheckFilePermission, TestSize.Level0)
HWTEST_F(SelinuxUnitTest, Init_TestClientDacCheckFilePermission_001, TestSize.Level0)
{
SelinuxUnitTest test;
test.TestClientSelinuxCheckFilePermission(STARTUP_INIT_UT_PATH "/trigger_test.cfg");
}
HWTEST_F(SelinuxUnitTest, TestClientDacCheckParaPermission, TestSize.Level0)
HWTEST_F(SelinuxUnitTest, Init_TestClientDacCheckParaPermission_001, TestSize.Level0)
{
SelinuxUnitTest test;
test.TestClientSelinuxCheckParaPermissionWrite("aaa.bbb.bbb.ccc", "user:group1:r");

View File

@ -495,13 +495,13 @@ public:
}
};
HWTEST_F(TriggerUnitTest, TestLoadTrigger, TestSize.Level0)
HWTEST_F(TriggerUnitTest, Init_TestLoadTrigger_001, TestSize.Level0)
{
TriggerUnitTest test;
test.TestLoadTrigger();
}
HWTEST_F(TriggerUnitTest, TestBootEvent, TestSize.Level0)
HWTEST_F(TriggerUnitTest, Init_TestBootEvent_001, TestSize.Level0)
{
TriggerUnitTest test;
test.TestBootEvent("pre-init");
@ -510,55 +510,55 @@ HWTEST_F(TriggerUnitTest, TestBootEvent, TestSize.Level0)
test.TestBootEvent("early-init");
}
HWTEST_F(TriggerUnitTest, TestAddTriggerForBoot, TestSize.Level0)
HWTEST_F(TriggerUnitTest, Init_TestAddTriggerForBoot_001, TestSize.Level0)
{
TriggerUnitTest test;
test.TestAddTriggerForBoot();
}
HWTEST_F(TriggerUnitTest, TestAddTriggerForParm, TestSize.Level0)
HWTEST_F(TriggerUnitTest, Init_TestAddTriggerForParm_001, TestSize.Level0)
{
TriggerUnitTest test;
test.TestAddTriggerForParm();
}
HWTEST_F(TriggerUnitTest, TestCheckParamTrigger1, TestSize.Level0)
HWTEST_F(TriggerUnitTest, Init_TestCheckParamTrigger_001, TestSize.Level0)
{
TriggerUnitTest test;
test.TestCheckParamTrigger1();
}
HWTEST_F(TriggerUnitTest, TestCheckParamTrigger2, TestSize.Level0)
HWTEST_F(TriggerUnitTest, Init_TestCheckParamTrigger_002, TestSize.Level0)
{
TriggerUnitTest test;
test.TestCheckParamTrigger2();
}
HWTEST_F(TriggerUnitTest, TestCheckParamTrigger3, TestSize.Level0)
HWTEST_F(TriggerUnitTest, Init_TestCheckParamTrigger_003, TestSize.Level0)
{
TriggerUnitTest test;
test.TestCheckParamTrigger3();
}
HWTEST_F(TriggerUnitTest, TestCheckParamTrigger4, TestSize.Level0)
HWTEST_F(TriggerUnitTest, Init_TestCheckParamTrigger_004, TestSize.Level0)
{
TriggerUnitTest test;
test.TestCheckParamTrigger4();
}
HWTEST_F(TriggerUnitTest, TestCheckParamTrigger5, TestSize.Level0)
HWTEST_F(TriggerUnitTest, Init_TestCheckParamTrigger_005, TestSize.Level0)
{
TriggerUnitTest test;
test.TestCheckParamTrigger5();
}
HWTEST_F(TriggerUnitTest, TestParamEvent, TestSize.Level0)
HWTEST_F(TriggerUnitTest, Init_TestParamEvent_001, TestSize.Level0)
{
TriggerUnitTest test;
test.TestParamEvent();
}
HWTEST_F(TriggerUnitTest, ComputerCondition, TestSize.Level0)
HWTEST_F(TriggerUnitTest, Init_TestComputerCondition_001, TestSize.Level0)
{
TriggerUnitTest test;
test.TestComputeCondition("aaa=111||aaa=222||aaa=333");
@ -567,37 +567,37 @@ HWTEST_F(TriggerUnitTest, ComputerCondition, TestSize.Level0)
test.TestComputeCondition("aaa=111||(aaa=222&&aaa=333)");
}
HWTEST_F(TriggerUnitTest, TestExecuteParamTrigger1, TestSize.Level0)
HWTEST_F(TriggerUnitTest, Init_TestExecuteParamTrigger_001, TestSize.Level0)
{
TriggerUnitTest test;
test.TestExecuteParamTrigger1();
}
HWTEST_F(TriggerUnitTest, TestExecuteParamTrigger2, TestSize.Level0)
HWTEST_F(TriggerUnitTest, Init_TestExecuteParamTrigger_002, TestSize.Level0)
{
TriggerUnitTest test;
test.TestExecuteParamTrigger2();
}
HWTEST_F(TriggerUnitTest, TestExecuteParamTrigger3, TestSize.Level0)
HWTEST_F(TriggerUnitTest, Init_TestExecuteParamTrigger_003, TestSize.Level0)
{
TriggerUnitTest test;
test.TestExecuteParamTrigger3();
}
HWTEST_F(TriggerUnitTest, TestExecuteParamTrigger4, TestSize.Level0)
HWTEST_F(TriggerUnitTest, Init_TestExecuteParamTrigger_004, TestSize.Level0)
{
TriggerUnitTest test;
test.TestExecuteParamTrigger4();
}
HWTEST_F(TriggerUnitTest, TestExecuteParamTrigger5, TestSize.Level0)
HWTEST_F(TriggerUnitTest, Init_TestExecuteParamTrigger_005, TestSize.Level0)
{
TriggerUnitTest test;
test.TestExecuteParamTrigger5();
}
HWTEST_F(TriggerUnitTest, TestExecuteParamTrigger6, TestSize.Level0)
HWTEST_F(TriggerUnitTest, Init_TestExecuteParamTrigger_006, TestSize.Level0)
{
TriggerUnitTest test;
test.TestDumpTrigger();

View File

@ -251,31 +251,31 @@ public:
}
};
HWTEST_F(WatcherAgentUnitTest, TestAddWatcher, TestSize.Level0)
HWTEST_F(WatcherAgentUnitTest, Init_TestAddWatcher_001, TestSize.Level0)
{
WatcherAgentUnitTest test;
test.TestAddWatcher();
}
HWTEST_F(WatcherAgentUnitTest, TestRecvMessage, TestSize.Level0)
HWTEST_F(WatcherAgentUnitTest, Init_TestRecvMessage_001, TestSize.Level0)
{
WatcherAgentUnitTest test;
test.TestRecvMessage("test.permission.watcher.agent.test1");
}
HWTEST_F(WatcherAgentUnitTest, TestDelWatcher, TestSize.Level0)
HWTEST_F(WatcherAgentUnitTest, Init_TestDelWatcher_001, TestSize.Level0)
{
WatcherAgentUnitTest test;
test.TestDelWatcher();
}
HWTEST_F(WatcherAgentUnitTest, TestResetService, TestSize.Level0)
HWTEST_F(WatcherAgentUnitTest, Init_TestResetService_001, TestSize.Level0)
{
WatcherAgentUnitTest test;
test.TestResetService();
}
HWTEST_F(WatcherAgentUnitTest, TestWatcherService, TestSize.Level0)
HWTEST_F(WatcherAgentUnitTest, Init_TestWatcherService_001, TestSize.Level0)
{
const char *errstr = "111111111111111111111111111111111111111111111111111111111111111111111111111111111111";
ServiceWatchForStatus("param_watcher", TestWatcherCallBack);
@ -286,7 +286,7 @@ HWTEST_F(WatcherAgentUnitTest, TestWatcherService, TestSize.Level0)
WatchParameter(nullptr, nullptr, nullptr);
}
HWTEST_F(WatcherAgentUnitTest, TestInvalidWatcher, TestSize.Level0)
HWTEST_F(WatcherAgentUnitTest, Init_TestInvalidWatcher_001, TestSize.Level0)
{
int ret = SystemWatchParameter(nullptr, TestParameterChange, nullptr);
ASSERT_NE(ret, 0);
@ -294,7 +294,7 @@ HWTEST_F(WatcherAgentUnitTest, TestInvalidWatcher, TestSize.Level0)
ASSERT_NE(ret, 0);
}
HWTEST_F(WatcherAgentUnitTest, TestWatcherProxy, TestSize.Level0)
HWTEST_F(WatcherAgentUnitTest, Init_TestWatcherProxy_001, TestSize.Level0)
{
WatcherAgentUnitTest test;
test.TestWatcherProxy();

View File

@ -269,7 +269,7 @@ public:
}
};
HWTEST_F(WatcherProxyUnitTest, TestAddWatcher, TestSize.Level0)
HWTEST_F(WatcherProxyUnitTest, Init_TestAddWatcher_001, TestSize.Level0)
{
WatcherProxyUnitTest test;
uint32_t watcherId = 0;
@ -280,7 +280,7 @@ HWTEST_F(WatcherProxyUnitTest, TestAddWatcher, TestSize.Level0)
test.TestWatchAgentDump("test.permission.watcher.test1");
}
HWTEST_F(WatcherProxyUnitTest, TestAddWatcher2, TestSize.Level0)
HWTEST_F(WatcherProxyUnitTest, Init_TestAddWatcher_002, TestSize.Level0)
{
WatcherProxyUnitTest test;
uint32_t watcherId = 0;
@ -292,7 +292,7 @@ HWTEST_F(WatcherProxyUnitTest, TestAddWatcher2, TestSize.Level0)
test.TestWatchAgentDump("test.permission.watcher.test2");
}
HWTEST_F(WatcherProxyUnitTest, TestAddWatcher3, TestSize.Level0)
HWTEST_F(WatcherProxyUnitTest, Init_TestAddWatcher_003, TestSize.Level0)
{
WatcherProxyUnitTest test;
uint32_t watcherId = 0;
@ -301,7 +301,7 @@ HWTEST_F(WatcherProxyUnitTest, TestAddWatcher3, TestSize.Level0)
test.TestWatchAgentDump("test.permission.watcher.test3");
}
HWTEST_F(WatcherProxyUnitTest, TestAddWatcher4, TestSize.Level0)
HWTEST_F(WatcherProxyUnitTest, Init_TestAddWatcher_004, TestSize.Level0)
{
WatcherProxyUnitTest test;
uint32_t watcherId = 0;
@ -312,7 +312,7 @@ HWTEST_F(WatcherProxyUnitTest, TestAddWatcher4, TestSize.Level0)
test.TestWatchAgentDump("test.watcher.test4*");
}
HWTEST_F(WatcherProxyUnitTest, TestAddWatcher5, TestSize.Level0)
HWTEST_F(WatcherProxyUnitTest, Init_TestAddWatcher_005, TestSize.Level0)
{
WatcherProxyUnitTest test;
uint32_t watcherId = 0;
@ -322,7 +322,7 @@ HWTEST_F(WatcherProxyUnitTest, TestAddWatcher5, TestSize.Level0)
test.TestWatchAgentDump("test.permission.watcher.test5");
}
HWTEST_F(WatcherProxyUnitTest, TestDelWatcher, TestSize.Level0)
HWTEST_F(WatcherProxyUnitTest, Init_TestDelWatcher_001, TestSize.Level0)
{
WatcherProxyUnitTest test;
uint32_t watcherId = 0;
@ -333,7 +333,7 @@ HWTEST_F(WatcherProxyUnitTest, TestDelWatcher, TestSize.Level0)
test.TestWatchAgentDump("test.permission.watcher.testDel");
}
HWTEST_F(WatcherProxyUnitTest, TestDiedWatcher, TestSize.Level0)
HWTEST_F(WatcherProxyUnitTest, Init_TestDiedWatcher_001, TestSize.Level0)
{
WatcherProxyUnitTest test;
uint32_t watcherId = 0;
@ -344,7 +344,7 @@ HWTEST_F(WatcherProxyUnitTest, TestDiedWatcher, TestSize.Level0)
test.TestWatchAgentDump("test.permission.watcher.testdied");
}
HWTEST_F(WatcherProxyUnitTest, TestSendLocalChange, TestSize.Level0)
HWTEST_F(WatcherProxyUnitTest, Init_TestSendLocalChange_001, TestSize.Level0)
{
WatcherProxyUnitTest test;
uint32_t watcherId = 0;
@ -354,19 +354,19 @@ HWTEST_F(WatcherProxyUnitTest, TestSendLocalChange, TestSize.Level0)
test.TestWatchAgentDump("test.watcher.");
}
HWTEST_F(WatcherProxyUnitTest, TestWatchProxy, TestSize.Level0)
HWTEST_F(WatcherProxyUnitTest, Init_TestWatchProxy_001, TestSize.Level0)
{
WatcherProxyUnitTest test;
test.TestWatchProxy("test.permission.watcher.test1", "watcherId");
}
HWTEST_F(WatcherProxyUnitTest, TestInvalid, TestSize.Level0)
HWTEST_F(WatcherProxyUnitTest, Init_TestInvalid_001, TestSize.Level0)
{
WatcherProxyUnitTest test;
test.TestInvalid("test.permission.watcher.test1");
}
HWTEST_F(WatcherProxyUnitTest, TestStop, TestSize.Level0)
HWTEST_F(WatcherProxyUnitTest, Init_TestStop_001, TestSize.Level0)
{
WatcherProxyUnitTest test;
uint32_t watcherId = 0;

View File

@ -76,6 +76,11 @@ if (defined(ohos_lite)) {
"//base/startup/init/services/utils:libinit_utils",
]
service_ueventd_ramdisk_deps = [
"//base/startup/init/interfaces/innerkits/socket:libsocket",
"//base/startup/init/services/utils:libinit_utils",
]
#
# exported include directories
#
@ -101,6 +106,24 @@ if (defined(ohos_lite)) {
subsystem_name = "startup"
}
ohos_static_library("libueventd_ramdisk_static_real") {
sources = service_ueventd_sources
include_dirs = service_ueventd_include
deps = service_ueventd_ramdisk_deps
defines = [ "__RAMDISK__" ]
external_deps = []
cflags = []
if (build_selinux) {
external_deps += [ "selinux_adapter:librestorecon_static" ]
cflags += [ "-DWITH_SELINUX" ]
}
external_deps += [ "selinux:libselinux_static" ]
external_deps += [ "bounds_checking_function:libsec_static" ]
public_configs = [ ":libueventd_exported_config" ]
part_name = "init"
subsystem_name = "startup"
}
ohos_executable("ueventd") {
sources = service_ueventd_sources
sources += [