diff --git a/interfaces/native/innerkits/hisysevent/BUILD.gn b/interfaces/native/innerkits/hisysevent/BUILD.gn index fe50e1ddfa87c88e4143b69d972378a71e27642a..8901c19f94576d150231339a8724c76acc04a070 100644 --- a/interfaces/native/innerkits/hisysevent/BUILD.gn +++ b/interfaces/native/innerkits/hisysevent/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2023 Huawei Device Co., Ltd. +# Copyright (c) 2021-2025 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 @@ -36,6 +36,7 @@ ohos_shared_library("libhisysevent") { sources = [ "encoded_param.cpp", + "event_socket_factory.cpp", "hisysevent.cpp", "hisysevent_c.cpp", "raw_data.cpp", @@ -86,6 +87,7 @@ ohos_static_library("hisysevent_static_lib_for_tdd") { sources = [ "encoded_param.cpp", + "event_socket_factory.cpp", "hisysevent.cpp", "hisysevent_c.cpp", "raw_data.cpp", diff --git a/interfaces/native/innerkits/hisysevent/event_socket_factory.cpp b/interfaces/native/innerkits/hisysevent/event_socket_factory.cpp new file mode 100644 index 0000000000000000000000000000000000000000..82ca427dbc66f5081798963a8ec51f8d73da3e7c --- /dev/null +++ b/interfaces/native/innerkits/hisysevent/event_socket_factory.cpp @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2025 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 "event_socket_factory.h" + +#include "def.h" +#include "hisysevent.h" +#include "hilog/log.h" +#include "raw_data_base_def.h" + +#include +#include +#include + +#undef LOG_DOMAIN +#define LOG_DOMAIN 0xD002D08 + +#undef LOG_TAG +#define LOG_TAG "EVENT_SOCKET_FACTORY" + +namespace OHOS { +namespace HiviewDFX { +namespace { +struct sockaddr_un normalAddr = { + .sun_family = AF_UNIX, + .sun_path = "/dev/unix/socket/hisysevent", +}; + +struct sockaddr_un higherPriorityAddr = { + .sun_family = AF_UNIX, + .sun_path = "/dev/unix/socket/hisysevent_fast", +}; + +inline bool IsHigherPriorityEventName(const std::list& events, const std::string& name) +{ + auto iter = std::find(events.begin(), events.end(), name); + return iter != events.end(); +} + +bool IsHigherPriorityAafwkEvent(const std::string& name) +{ + static std::list events { + "APP_INPUT_BLOCK", "BUSSINESS_THREAD_BLOCK_3S", "BUSSINESS_THREAD_BLOCK_6S", + "LIFECYCLE_HALF_TIMEOUT", "LIFECYCLE_TIME_OUT", "THREAD_BLOCK_3S", "THREAD_BLOCK_6S" }; + return IsHigherPriorityEventName(events, name); +} + +bool IsHigerPriorityAceEvent(const std::string& name) +{ + static std::list events { + "UI_BLOCK_3S", "UI_BLOCK_6S", "UI_BLOCK_RECOVERED" }; + return IsHigherPriorityEventName(events, name); +} + +bool IsHigerPriorityFrameworkEvent(const std::string& name) +{ + static std::list events { + "IPC_FULL", "SERVICE_BLOCK", "SERVICE_TIMEOUT", "SERVICE_WARNING" }; + return IsHigherPriorityEventName(events, name); +} + +bool IsHigherPriorityEvent(const std::string& domain, const std::string& name, int type) +{ + if (domain == "AAFWK") { + return IsHigherPriorityAafwkEvent(name); + } else if (domain == "ACE") { + return IsHigerPriorityAceEvent(name); + } else if (domain == "FRAMEWORK") { + return IsHigerPriorityFrameworkEvent(name); + } else if (domain == "RELIABILITY") { + return type == HiSysEvent::EventType::FAULT; + } else if (domain == "GRAPHIC") { + return name == "NO_DRAW"; + } else if (domain == "MULTIMODALINPUT") { + return name == "TARGET_POINTER_EVENT_FAILURE"; + } else if (domain == "POWER") { + return name == "SCREEN_ON_TIMEOUT"; + } else if (domain == "WINDOWMANAGER") { + return name == "NO_FOCUS_WINDOW"; + } else if (domain == "SCHEDULE_EXT") { + return name == "SYSTEM_LOAD_LEVEL_CHANGED"; + } else { + return false; + } +} + +void ParseDomainAndNameFromRawData(RawData& data, std::string& domain, std::string& name, int& type) +{ + if (size_t len = data.GetDataLength(); len < sizeof(int32_t) + sizeof(struct HiSysEventHeader)) { + HILOG_WARN(LOG_CORE, "length[%{public}zu] of data is invalid", len); + return; + } + auto originalData = data.GetData(); + struct HiSysEventHeader header = *(reinterpret_cast(originalData + sizeof(int32_t))); + domain = std::string(header.domain); + name = std::string(header.name); + type = static_cast(header.type); +} +} + +EventSocket& EventSocketFactory::GetEventSocket(RawData& data) +{ + std::string domain; + std::string name; + int type; + ParseDomainAndNameFromRawData(data, domain, name, type); + return IsHigherPriorityEvent(domain, name, type) ? higherPriorityAddr : normalAddr; +} +} +} diff --git a/interfaces/native/innerkits/hisysevent/include/event_socket_factory.h b/interfaces/native/innerkits/hisysevent/include/event_socket_factory.h new file mode 100644 index 0000000000000000000000000000000000000000..20b8c177eca36e6cdf93c3baf9ec3745d2d85452 --- /dev/null +++ b/interfaces/native/innerkits/hisysevent/include/event_socket_factory.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2025 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 EVENT_SOCKET_FACTORY_H +#define EVENT_SOCKET_FACTORY_H + +#include +#include + +#include "raw_data.h" + +namespace OHOS { +namespace HiviewDFX { +using namespace Encoded; +using EventSocket = struct sockaddr_un; +class EventSocketFactory { +public: + static EventSocket& GetEventSocket(RawData& data); +}; +} +} + +#endif // EVENT_SOCKET_FACTORY_H \ No newline at end of file diff --git a/interfaces/native/innerkits/hisysevent/libhisysevent.map b/interfaces/native/innerkits/hisysevent/libhisysevent.map index 961bb1e63231e2ddf226b266c9b034357d221c34..944783ee89c6bc999596faedfc0688cca740138c 100644 --- a/interfaces/native/innerkits/hisysevent/libhisysevent.map +++ b/interfaces/native/innerkits/hisysevent/libhisysevent.map @@ -42,6 +42,7 @@ "OHOS::HiviewDFX::Encoded::ParseTimeZone(long)"; "OHOS::HiviewDFX::HiSysEvent::EventBase::AppendParam(std::__h::shared_ptr)"; "OHOS::HiviewDFX::Encoded::EncodedParam::SetRawData(std::__h::shared_ptr)"; + "OHOS::HiviewDFX::EventSocketFactory::GetEventSocket(OHOS::HiviewDFX::Encoded::RawData&)"; }; extern "C" { "HiSysEvent_Write"; diff --git a/interfaces/native/innerkits/hisysevent/transport.cpp b/interfaces/native/innerkits/hisysevent/transport.cpp index dfc0ce2c63913151699d91a6dfe3860146c85adc..b908389d58df06eedc5051c9fe7b8c13f9904026 100644 --- a/interfaces/native/innerkits/hisysevent/transport.cpp +++ b/interfaces/native/innerkits/hisysevent/transport.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Copyright (c) 2021-2025 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 @@ -27,6 +27,7 @@ #include #include "def.h" +#include "event_socket_factory.h" #include "hilog/log.h" #undef LOG_DOMAIN @@ -38,21 +39,24 @@ namespace OHOS { namespace HiviewDFX { namespace { -struct sockaddr_un g_serverAddr = { - .sun_family = AF_UNIX, - .sun_path = "/dev/unix/socket/hisysevent", -}; - -void LogErrorInfo(const std::string& logFormatStr, bool isLogLevel) +void LogErrorInfo(const std::string& socketPath, const std::string& logFormatStr, bool isLogLevel) { const size_t buffSize { 256 }; char errMsg[buffSize] { }; strerror_r(errno, errMsg, buffSize); if (isLogLevel) { - HILOG_DEBUG(LOG_CORE, "%{public}s, errno=%{public}d, msg=%{public}s", logFormatStr.c_str(), errno, errMsg); + HILOG_DEBUG(LOG_CORE, "%{public}s %{public}s, errno=%{public}d, msg=%{public}s", socketPath.c_str(), + logFormatStr.c_str(), errno, errMsg); return; } - HILOG_ERROR(LOG_CORE, "%{public}s, errno=%{public}d, msg=%{public}s", logFormatStr.c_str(), errno, errMsg); + HILOG_ERROR(LOG_CORE, "%{public}s %{public}s, errno=%{public}d, msg=%{public}s", socketPath.c_str(), + logFormatStr.c_str(), errno, errMsg); +} + +void LogErrorInfo(const std::string& logFormatStr, bool isLogLevel) +{ + std::string socketPath; + LogErrorInfo(socketPath, logFormatStr, isLogLevel); } } @@ -95,16 +99,19 @@ int Transport::SendToHiSysEventDataSource(RawData& rawData) InitRecvBuffer(socketId); auto sendRet = 0; auto retryTimes = RETRY_TIMES; + std::string socketPath; do { + auto serverAddr = EventSocketFactory::GetEventSocket(rawData); + socketPath = serverAddr.sun_path; sendRet = sendto(socketId, rawData.GetData(), rawData.GetDataLength(), 0, - reinterpret_cast(&g_serverAddr), sizeof(g_serverAddr)); + reinterpret_cast(&serverAddr), sizeof(serverAddr)); retryTimes--; } while (sendRet < 0 && retryTimes > 0 && (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR)); if (sendRet < 0) { if (errno == EACCES) { - LogErrorInfo("sysevent write failed", true); + LogErrorInfo(socketPath, "sysevent write failed", true); } else { - LogErrorInfo("sysevent write failed", false); + LogErrorInfo(socketPath, "sysevent write failed", false); } close(socketId); return ERR_SEND_FAIL; diff --git a/test/moduletest/common/hisysevent_native_test.cpp b/test/moduletest/common/hisysevent_native_test.cpp index c34c138c268513a75f3c1bee932c43e8e341d613..2b1488b153c0cd35f8439e2437a72a925c9bb867 100644 --- a/test/moduletest/common/hisysevent_native_test.cpp +++ b/test/moduletest/common/hisysevent_native_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Copyright (c) 2021-2025 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 @@ -29,6 +29,7 @@ #include "hilog/log.h" #include "def.h" +#include "event_socket_factory.h" #include "hisysevent.h" #include "hisysevent_base_manager.h" #include "hisysevent_manager.h" @@ -37,6 +38,7 @@ #include "hisysevent_listener.h" #include "ret_code.h" #include "rule_type.h" +#include "securec.h" #ifndef SYS_EVENT_PARAMS #define SYS_EVENT_PARAMS(A) "key"#A, 0 + (A), "keyA"#A, 1 + (A), "keyB"#A, 2 + (A), "keyC"#A, 3 + (A), \ @@ -109,6 +111,24 @@ private: OnQueryCallback onQueryCallback; OnCompleteCallback onCompleteCallback; }; + +void BuildRawData(RawData& data, const std::string& domain, const std::string& name, HiSysEvent::EventType type) +{ + struct Encoded::HiSysEventHeader header = { + {0}, {0}, 0, 0, 0, 0, 0, 0, 0, 0 + }; + auto ret = memcpy_s(header.domain, MAX_DOMAIN_LENGTH, domain.c_str(), domain.length()); + ASSERT_EQ(ret, EOK); + header.domain[domain.length()] = '\0'; + ret = memcpy_s(header.name, MAX_EVENT_NAME_LENGTH, name.c_str(), name.length()); + ASSERT_EQ(ret, EOK); + header.name[name.length()] = '\0'; + header.type = type; + int32_t len = sizeof(struct Encoded::HiSysEventHeader) + sizeof(int32_t); + (void)data.Update(reinterpret_cast(&len), sizeof(int32_t), 0); + (void)data.Update(reinterpret_cast(&header), sizeof(struct Encoded::HiSysEventHeader), + sizeof(int32_t)); +} } static bool WrapSysEventWriteAssertion(int32_t ret, bool cond) @@ -1517,3 +1537,153 @@ HWTEST_F(HiSysEventNativeTest, TestHiSysEventManagerQueryWithDefaultQueryArgumen ASSERT_EQ(ret, OHOS::HiviewDFX::IPC_CALL_SUCCEED); } +/** + * @tc.name: TestEventSocketFactory1 + * @tc.desc: Test apis of EventSocketFactory + * @tc.type: FUNC + * @tc.require: issueIC70PG + */ +HWTEST_F(HiSysEventNativeTest, TestEventSocketFactory1, TestSize.Level1) +{ + RawData data; + BuildRawData(data, "AAFWK", "APP_INPUT_BLOCK", HiSysEvent::EventType::FAULT); + auto socketAddr = EventSocketFactory::GetEventSocket(data); + ASSERT_EQ(std::string(socketAddr.sun_path), "/dev/unix/socket/hisysevent_fast"); + BuildRawData(data, "AAFWK", "BUSSINESS_THREAD_BLOCK_3S", HiSysEvent::EventType::FAULT); + socketAddr = EventSocketFactory::GetEventSocket(data); + ASSERT_EQ(std::string(socketAddr.sun_path), "/dev/unix/socket/hisysevent_fast"); + BuildRawData(data, "AAFWK", "BUSSINESS_THREAD_BLOCK_6S", HiSysEvent::EventType::FAULT); + socketAddr = EventSocketFactory::GetEventSocket(data); + ASSERT_EQ(std::string(socketAddr.sun_path), "/dev/unix/socket/hisysevent_fast"); + BuildRawData(data, "AAFWK", "LIFECYCLE_HALF_TIMEOUT", HiSysEvent::EventType::FAULT); + socketAddr = EventSocketFactory::GetEventSocket(data); + ASSERT_EQ(std::string(socketAddr.sun_path), "/dev/unix/socket/hisysevent_fast"); + BuildRawData(data, "AAFWK", "LIFECYCLE_TIME_OUT", HiSysEvent::EventType::FAULT); + socketAddr = EventSocketFactory::GetEventSocket(data); + ASSERT_EQ(std::string(socketAddr.sun_path), "/dev/unix/socket/hisysevent_fast"); + BuildRawData(data, "AAFWK", "THREAD_BLOCK_3S", HiSysEvent::EventType::FAULT); + socketAddr = EventSocketFactory::GetEventSocket(data); + ASSERT_EQ(std::string(socketAddr.sun_path), "/dev/unix/socket/hisysevent_fast"); + BuildRawData(data, "AAFWK", "THREAD_BLOCK_6S", HiSysEvent::EventType::FAULT); + socketAddr = EventSocketFactory::GetEventSocket(data); + ASSERT_EQ(std::string(socketAddr.sun_path), "/dev/unix/socket/hisysevent_fast"); + BuildRawData(data, "AAFWK", "EXCLUDED_NAME", HiSysEvent::EventType::FAULT); + socketAddr = EventSocketFactory::GetEventSocket(data); + ASSERT_EQ(std::string(socketAddr.sun_path), "/dev/unix/socket/hisysevent"); +} + +/** + * @tc.name: TestEventSocketFactory2 + * @tc.desc: Test apis of EventSocketFactory + * @tc.type: FUNC + * @tc.require: issueIC70PG + */ +HWTEST_F(HiSysEventNativeTest, TestEventSocketFactory2, TestSize.Level1) +{ + RawData data; + BuildRawData(data, "ACE", "UI_BLOCK_3S", HiSysEvent::EventType::FAULT); + auto socketAddr = EventSocketFactory::GetEventSocket(data); + ASSERT_EQ(std::string(socketAddr.sun_path), "/dev/unix/socket/hisysevent_fast"); + BuildRawData(data, "ACE", "UI_BLOCK_6S", HiSysEvent::EventType::FAULT); + socketAddr = EventSocketFactory::GetEventSocket(data); + ASSERT_EQ(std::string(socketAddr.sun_path), "/dev/unix/socket/hisysevent_fast"); + BuildRawData(data, "ACE", "UI_BLOCK_RECOVERED", HiSysEvent::EventType::FAULT); + socketAddr = EventSocketFactory::GetEventSocket(data); + ASSERT_EQ(std::string(socketAddr.sun_path), "/dev/unix/socket/hisysevent_fast"); + BuildRawData(data, "ACE", "EXCLUDED_NAME", HiSysEvent::EventType::FAULT); + socketAddr = EventSocketFactory::GetEventSocket(data); + ASSERT_EQ(std::string(socketAddr.sun_path), "/dev/unix/socket/hisysevent"); +} + +/** + * @tc.name: TestEventSocketFactory3 + * @tc.desc: Test apis of EventSocketFactory + * @tc.type: FUNC + * @tc.require: issueIC70PG + */ +HWTEST_F(HiSysEventNativeTest, TestEventSocketFactory3, TestSize.Level1) +{ + RawData data; + BuildRawData(data, "FRAMEWORK", "IPC_FULL", HiSysEvent::EventType::FAULT); + auto socketAddr = EventSocketFactory::GetEventSocket(data); + ASSERT_EQ(std::string(socketAddr.sun_path), "/dev/unix/socket/hisysevent_fast"); + BuildRawData(data, "FRAMEWORK", "SERVICE_BLOCK", HiSysEvent::EventType::FAULT); + socketAddr = EventSocketFactory::GetEventSocket(data); + ASSERT_EQ(std::string(socketAddr.sun_path), "/dev/unix/socket/hisysevent_fast"); + BuildRawData(data, "FRAMEWORK", "SERVICE_TIMEOUT", HiSysEvent::EventType::FAULT); + socketAddr = EventSocketFactory::GetEventSocket(data); + ASSERT_EQ(std::string(socketAddr.sun_path), "/dev/unix/socket/hisysevent_fast"); + BuildRawData(data, "FRAMEWORK", "SERVICE_WARNING", HiSysEvent::EventType::FAULT); + socketAddr = EventSocketFactory::GetEventSocket(data); + ASSERT_EQ(std::string(socketAddr.sun_path), "/dev/unix/socket/hisysevent_fast"); + BuildRawData(data, "FRAMEWORK", "EXCLUDED_NAME", HiSysEvent::EventType::FAULT); + socketAddr = EventSocketFactory::GetEventSocket(data); + ASSERT_EQ(std::string(socketAddr.sun_path), "/dev/unix/socket/hisysevent"); +} + +/** + * @tc.name: TestEventSocketFactory4 + * @tc.desc: Test apis of EventSocketFactory + * @tc.type: FUNC + * @tc.require: issueIC70PG + */ +HWTEST_F(HiSysEventNativeTest, TestEventSocketFactory4, TestSize.Level1) +{ + RawData data; + BuildRawData(data, "RELIABILITY", "ANY_NAME", HiSysEvent::EventType::FAULT); + auto socketAddr = EventSocketFactory::GetEventSocket(data); + ASSERT_EQ(std::string(socketAddr.sun_path), "/dev/unix/socket/hisysevent_fast"); + BuildRawData(data, "RELIABILITY", "ANY_NAME", HiSysEvent::EventType::BEHAVIOR); + socketAddr = EventSocketFactory::GetEventSocket(data); + ASSERT_EQ(std::string(socketAddr.sun_path), "/dev/unix/socket/hisysevent"); +} + +/** + * @tc.name: TestEventSocketFactory5 + * @tc.desc: Test apis of EventSocketFactory + * @tc.type: FUNC + * @tc.require: issueIC70PG + */ +HWTEST_F(HiSysEventNativeTest, TestEventSocketFactory5, TestSize.Level1) +{ + RawData data; + BuildRawData(data, "GRAPHIC", "NO_DRAW", HiSysEvent::EventType::FAULT); + auto socketAddr = EventSocketFactory::GetEventSocket(data); + ASSERT_EQ(std::string(socketAddr.sun_path), "/dev/unix/socket/hisysevent_fast"); + BuildRawData(data, "GRAPHIC", "EXCLUDED_NAME", HiSysEvent::EventType::FAULT); + socketAddr = EventSocketFactory::GetEventSocket(data); + ASSERT_EQ(std::string(socketAddr.sun_path), "/dev/unix/socket/hisysevent"); + + BuildRawData(data, "MULTIMODALINPUT", "TARGET_POINTER_EVENT_FAILURE", HiSysEvent::EventType::FAULT); + socketAddr = EventSocketFactory::GetEventSocket(data); + ASSERT_EQ(std::string(socketAddr.sun_path), "/dev/unix/socket/hisysevent_fast"); + BuildRawData(data, "MULTIMODALINPUT", "EXCLUDED_NAME", HiSysEvent::EventType::FAULT); + socketAddr = EventSocketFactory::GetEventSocket(data); + ASSERT_EQ(std::string(socketAddr.sun_path), "/dev/unix/socket/hisysevent"); + + BuildRawData(data, "POWER", "SCREEN_ON_TIMEOUT", HiSysEvent::EventType::FAULT); + socketAddr = EventSocketFactory::GetEventSocket(data); + ASSERT_EQ(std::string(socketAddr.sun_path), "/dev/unix/socket/hisysevent_fast"); + BuildRawData(data, "POWER", "EXCLUDED_NAME", HiSysEvent::EventType::FAULT); + socketAddr = EventSocketFactory::GetEventSocket(data); + ASSERT_EQ(std::string(socketAddr.sun_path), "/dev/unix/socket/hisysevent"); + + BuildRawData(data, "WINDOWMANAGER", "NO_FOCUS_WINDOW", HiSysEvent::EventType::FAULT); + socketAddr = EventSocketFactory::GetEventSocket(data); + ASSERT_EQ(std::string(socketAddr.sun_path), "/dev/unix/socket/hisysevent_fast"); + BuildRawData(data, "WINDOWMANAGER", "EXCLUDED_NAME", HiSysEvent::EventType::FAULT); + socketAddr = EventSocketFactory::GetEventSocket(data); + ASSERT_EQ(std::string(socketAddr.sun_path), "/dev/unix/socket/hisysevent"); + + BuildRawData(data, "SCHEDULE_EXT", "SYSTEM_LOAD_LEVEL_CHANGED", HiSysEvent::EventType::FAULT); + socketAddr = EventSocketFactory::GetEventSocket(data); + ASSERT_EQ(std::string(socketAddr.sun_path), "/dev/unix/socket/hisysevent_fast"); + BuildRawData(data, "SCHEDULE_EXT", "EXCLUDED_NAME", HiSysEvent::EventType::FAULT); + socketAddr = EventSocketFactory::GetEventSocket(data); + ASSERT_EQ(std::string(socketAddr.sun_path), "/dev/unix/socket/hisysevent"); + + BuildRawData(data, "EXCLUDED_DOMAIN", "ANY_NAME", HiSysEvent::EventType::FAULT); + socketAddr = EventSocketFactory::GetEventSocket(data); + ASSERT_EQ(std::string(socketAddr.sun_path), "/dev/unix/socket/hisysevent"); +} +