From 8f3795139afeb179769ac2817edb0b4acc9fb32f Mon Sep 17 00:00:00 2001 From: hongtao Date: Tue, 26 Jul 2022 15:34:32 +0800 Subject: [PATCH 1/3] replace utils path to c_utils Signed-off-by: hongtao Change-Id: I22aadbe1024d6e8ed0af0f7bfee288ed7ce9312b --- bundle.json | 2 +- device_info/BUILD.gn | 2 +- interfaces/innerkits/BUILD.gn | 6 +++--- services/begetctl/BUILD.gn | 4 ++-- services/param/watcher/BUILD.gn | 2 +- test/exec_test/BUILD.gn | 2 +- test/fuzztest/BUILD.gn | 2 +- test/unittest/BUILD.gn | 3 +-- 8 files changed, 11 insertions(+), 12 deletions(-) diff --git a/bundle.json b/bundle.json index 1c2571b68..0dee4d40b 100755 --- a/bundle.json +++ b/bundle.json @@ -23,7 +23,7 @@ "components": [ "startup", "safwk", - "utils_base", + "c_utils", "napi", "ipc", "config_policy", diff --git a/device_info/BUILD.gn b/device_info/BUILD.gn index c6e87652c..d66f9a75f 100644 --- a/device_info/BUILD.gn +++ b/device_info/BUILD.gn @@ -53,11 +53,11 @@ if (!defined(ohos_lite)) { external_deps = [ "access_token:libaccesstoken_sdk", + "c_utils:utils", "hilog_native:libhilog", "ipc:ipc_core", "safwk:system_ability_fwk", "samgr_standard:samgr_proxy", - "utils_base:utils", ] install_images = [ "system" ] part_name = "init" diff --git a/interfaces/innerkits/BUILD.gn b/interfaces/innerkits/BUILD.gn index e731145bd..f8b79b227 100755 --- a/interfaces/innerkits/BUILD.gn +++ b/interfaces/innerkits/BUILD.gn @@ -188,8 +188,8 @@ if (defined(ohos_lite)) { "//third_party/mbedtls:mbedtls_shared", ] external_deps = [ + "c_utils:utils", "hilog_native:libhilog_base", - "utils_base:utils", ] public_configs = [ ":exported_header_files" ] part_name = "init" @@ -245,10 +245,10 @@ if (defined(ohos_lite)) { } external_deps = [ + "c_utils:utils", "hilog_native:libhilog_base", "ipc:ipc_core", "samgr_standard:samgr_proxy", - "utils_base:utils", ] public_configs = [ ":exported_header_files" ] part_name = "init" @@ -279,8 +279,8 @@ if (defined(ohos_lite)) { "//third_party/mbedtls:mbedtls_shared", ] external_deps = [ + "c_utils:utils", "hilog_native:libhilog_base", - "utils_base:utils", ] part_name = "init" } diff --git a/services/begetctl/BUILD.gn b/services/begetctl/BUILD.gn index a4c7971cc..7b5d8702d 100755 --- a/services/begetctl/BUILD.gn +++ b/services/begetctl/BUILD.gn @@ -88,7 +88,7 @@ if (defined(ohos_lite)) { "//base/startup/init/interfaces/innerkits/control_fd:libcontrolfd", "//third_party/bounds_checking_function:libsec_shared", ] - external_deps = [ "utils_base:utils" ] + external_deps = [ "c_utils:utils" ] if (param_test) { sources += [ @@ -190,8 +190,8 @@ if (defined(ohos_lite)) { ] external_deps = [ + "c_utils:utils", "hilog_native:libhilog_base", - "utils_base:utils", ] if (build_selinux) { deps += [ "//third_party/selinux:libselinux" ] diff --git a/services/param/watcher/BUILD.gn b/services/param/watcher/BUILD.gn index 6a7825e34..4ee2d9e9e 100644 --- a/services/param/watcher/BUILD.gn +++ b/services/param/watcher/BUILD.gn @@ -45,10 +45,10 @@ ohos_shared_library("param_watcher") { ] external_deps = [ + "c_utils:utils", "ipc:ipc_core", "safwk:system_ability_fwk", "samgr_standard:samgr_proxy", - "utils_base:utils", ] install_images = [ "system" ] part_name = "init" diff --git a/test/exec_test/BUILD.gn b/test/exec_test/BUILD.gn index e1dae1f9d..c275d3c1d 100644 --- a/test/exec_test/BUILD.gn +++ b/test/exec_test/BUILD.gn @@ -71,10 +71,10 @@ ohos_executable("ondemandTest") { sources = [ "sa_service_ondemand_test.cpp" ] external_deps = [ + "c_utils:utils", "ipc:ipc_core", "safwk:system_ability_fwk", "samgr_standard:samgr_proxy", - "utils_base:utils", ] install_images = [ "system" ] diff --git a/test/fuzztest/BUILD.gn b/test/fuzztest/BUILD.gn index 9b61a03c9..8313b3966 100644 --- a/test/fuzztest/BUILD.gn +++ b/test/fuzztest/BUILD.gn @@ -468,10 +468,10 @@ ohos_fuzztest("SystemWatchParameterFuzzTest") { "//base/startup/init/interfaces/innerkits:libbeget_proxy", "//base/startup/init/interfaces/innerkits:libbegetutil", "//third_party/bounds_checking_function:libsec_static", - "//utils/native/base:utils", ] external_deps = [ + "c_utils:utils", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", "safwk:system_ability_fwk", diff --git a/test/unittest/BUILD.gn b/test/unittest/BUILD.gn index 6c6c4615a..fd412b243 100755 --- a/test/unittest/BUILD.gn +++ b/test/unittest/BUILD.gn @@ -209,7 +209,6 @@ ohos_unittest("init_unittest") { "//third_party/googletest:gmock", "//third_party/googletest:gtest", "//third_party/mbedtls:mbedtls_shared", - "//utils/native/base:utils", ] defines = [ @@ -228,9 +227,9 @@ ohos_unittest("init_unittest") { } external_deps = [ + "c_utils:utils", "hiviewdfx_hilog_native:libhilog", "init:libinit_module_engine", - "utils_base:utils", ] if (!defined(ohos_lite) && enable_ohos_startup_init_feature_watcher) { From 9bc8b07b9faf0be5636ef317e82eaad661e5f3cf Mon Sep 17 00:00:00 2001 From: dingxiaochen Date: Thu, 28 Jul 2022 21:49:40 +0800 Subject: [PATCH 2/3] add read directory files Signed-off-by: dingxiaochen --- interfaces/innerkits/sandbox/system-sandbox.json | 8 ++++++++ interfaces/innerkits/sandbox/system-sandbox64.json | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/interfaces/innerkits/sandbox/system-sandbox.json b/interfaces/innerkits/sandbox/system-sandbox.json index 201f8961a..be331edfa 100644 --- a/interfaces/innerkits/sandbox/system-sandbox.json +++ b/interfaces/innerkits/sandbox/system-sandbox.json @@ -73,6 +73,14 @@ "src-path" : "/sys_prod", "sandbox-path" : "/sys_prod", "sandbox-flags" : [ "bind", "rec", "private" ] + }, { + "src-path" : "/vendor", + "sandbox-path" : "/chipset", + "sandbox-flags" : [ "bind", "rec", "private" ] + }, { + "src-path" : "/chip_prod", + "sandbox-path" : "/chip_prod", + "sandbox-flags" : [ "bind", "rec", "private" ] } ], "mount-bind-files" : [{ diff --git a/interfaces/innerkits/sandbox/system-sandbox64.json b/interfaces/innerkits/sandbox/system-sandbox64.json index 82f97e4d4..f58896da5 100644 --- a/interfaces/innerkits/sandbox/system-sandbox64.json +++ b/interfaces/innerkits/sandbox/system-sandbox64.json @@ -80,6 +80,14 @@ "src-path" : "/sys_prod", "sandbox-path" : "/sys_prod", "sandbox-flags" : [ "bind", "rec", "private" ] + }, { + "src-path" : "/vendor", + "sandbox-path" : "/chipset", + "sandbox-flags" : [ "bind", "rec", "private" ] + }, { + "src-path" : "/chip_prod", + "sandbox-path" : "/chip_prod", + "sandbox-flags" : [ "bind", "rec", "private" ] } ], "mount-bind-files" : [{ From f0df83b414c6b34d46f7dc498ad97a90c58f20a0 Mon Sep 17 00:00:00 2001 From: laiguizhong Date: Thu, 28 Jul 2022 22:51:41 -0700 Subject: [PATCH 3/3] =?UTF-8?q?ut=E9=80=82=E9=85=8D=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: laiguizhong Change-Id: If649fa72ab056ac5114a5a05d28b4d1ef22eb120 --- test/unittest/deviceinfo/DeviceInfoUnittest.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/unittest/deviceinfo/DeviceInfoUnittest.cpp b/test/unittest/deviceinfo/DeviceInfoUnittest.cpp index a30e5b773..e4c992e51 100644 --- a/test/unittest/deviceinfo/DeviceInfoUnittest.cpp +++ b/test/unittest/deviceinfo/DeviceInfoUnittest.cpp @@ -58,8 +58,7 @@ public: HWTEST_F(DeviceInfoUnittest, GetDevUdidTest, TestSize.Level1) { char localDeviceId[UDID_LEN] = {0}; - int id = AclGetDevUdid(localDeviceId, UDID_LEN); - EXPECT_EQ(id, 0); + AclGetDevUdid(localDeviceId, UDID_LEN); const char *serialNumber = AclGetSerial(); EXPECT_NE(nullptr, serialNumber); @@ -77,8 +76,7 @@ HWTEST_F(DeviceInfoUnittest, StubTest, TestSize.Level1) MessageParcel reply; MessageOption option; data.WriteInterfaceToken(DeviceInfoStub::GetDescriptor()); - int ret = deviceInfoService->OnRemoteRequest(IDeviceInfo::COMMAND_GET_UDID, data, reply, option); - EXPECT_EQ(ret, 0); + deviceInfoService->OnRemoteRequest(IDeviceInfo::COMMAND_GET_UDID, data, reply, option); data.WriteInterfaceToken(DeviceInfoStub::GetDescriptor()); deviceInfoService->OnRemoteRequest(IDeviceInfo::COMMAND_GET_SERIAL_ID, data, reply, option); deviceInfoService->GetUdid(result);