From 28d15a07cd293c4f79a73de488043c9786afcfed Mon Sep 17 00:00:00 2001 From: baoyang Date: Thu, 24 Apr 2025 15:27:56 +0800 Subject: [PATCH] fix scId reuse problem Signed-off-by: baoyang Change-Id: I46adf0a161bb04fe7b060f90c19364080a9ff32e --- .../unittest/src/sec_comp_enhance_test.cpp | 104 ++++++++++++++++++ .../unittest/src/location_button_test.cpp | 34 +++--- .../test/unittest/src/paste_button_test.cpp | 8 +- .../test/unittest/src/save_button_test.cpp | 8 +- .../test/unittest/src/sec_comp_kit_test.cpp | 12 +- .../src/sec_comp_register_callback_test.cpp | 30 ++--- .../sa/sa_main/sec_comp_manager.cpp | 25 ++++- .../sa/sa_main/sec_comp_manager.h | 1 + .../unittest/src/app_state_observer_test.cpp | 18 +-- .../unittest/src/sec_comp_entity_test.cpp | 10 +- .../src/sec_comp_info_helper_test.cpp | 36 +++--- .../unittest/src/sec_comp_manager_test.cpp | 61 ++++++---- .../src/sec_comp_service_mock_test.cpp | 10 +- .../unittest/src/sec_comp_service_test.cpp | 20 ++-- .../test/unittest/src/sec_comp_stub_test.cpp | 12 +- 15 files changed, 265 insertions(+), 124 deletions(-) create mode 100644 frameworks/inner_api/enhance_kits/test/unittest/src/sec_comp_enhance_test.cpp diff --git a/frameworks/inner_api/enhance_kits/test/unittest/src/sec_comp_enhance_test.cpp b/frameworks/inner_api/enhance_kits/test/unittest/src/sec_comp_enhance_test.cpp new file mode 100644 index 0000000..b85018e --- /dev/null +++ b/frameworks/inner_api/enhance_kits/test/unittest/src/sec_comp_enhance_test.cpp @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2023-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 "sec_comp_enhance_test.h" +#include +#include +#include "sec_comp_err.h" +#include "sec_comp_log.h" +#include "sec_comp_info.h" + +using namespace testing::ext; +using namespace OHOS::Security::SecurityComponent; + +namespace { +static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { + LOG_CORE, SECURITY_DOMAIN_SECURITY_COMPONENT, "SecCompEnhanceTest"}; +static bool g_inputEnhanceExist = false; +static bool g_srvEnhanceExist = false; +static constexpr uint32_t SEC_COMP_ENHANCE_CFG_SIZE = 76; +static const std::string ENHANCE_INPUT_INTERFACE_LIB = "libsecurity_component_client_enhance.z.so"; +static const std::string ENHANCE_SRV_INTERFACE_LIB = "libsecurity_component_service_enhance.z.so"; +static constexpr uint32_t MAX_HMAC_SIZE = 64; +} // namespace + +void SecCompEnhanceTest::SetUpTestCase() +{ + void *handle = dlopen(ENHANCE_INPUT_INTERFACE_LIB.c_str(), RTLD_LAZY); + if (handle != nullptr) { + g_inputEnhanceExist = true; + } + dlclose(handle); + + handle = dlopen(ENHANCE_SRV_INTERFACE_LIB.c_str(), RTLD_LAZY); + if (handle != nullptr) { + g_srvEnhanceExist = true; + } + dlclose(handle); + system("kill -9 `pidof security_component_service`"); + SC_LOG_INFO(LABEL, "SetUpTestCase."); +} + +void SecCompEnhanceTest::TearDownTestCase() +{ + SC_LOG_INFO(LABEL, "TearDownTestCase."); +} + +void SecCompEnhanceTest::SetUp() +{ + SC_LOG_INFO(LABEL, "SetUp ok."); +} + +void SecCompEnhanceTest::TearDown() +{ + SC_LOG_INFO(LABEL, "TearDown."); +} + +/** + * @tc.name: SetEnhanceCfg001 + * @tc.desc: test SetEnhanceCfg + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(SecCompEnhanceTest, SetEnhanceCfg001, TestSize.Level1) +{ + uint8_t cfgData[SEC_COMP_ENHANCE_CFG_SIZE] = { 0 }; + int32_t result = SecCompEnhanceKit::SetEnhanceCfg(cfgData, SEC_COMP_ENHANCE_CFG_SIZE); + if (g_inputEnhanceExist) { + EXPECT_EQ(result, SC_OK); + } else { + EXPECT_EQ(result, SC_ENHANCE_ERROR_NOT_EXIST_ENHANCE); + } +} + +/** + * @tc.name: GetPoniterEventEnhanceData001 + * @tc.desc: test GetPoniterEventEnhanceData + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(SecCompEnhanceTest, GetPoniterEventEnhanceData001, TestSize.Level1) +{ + uint8_t originData[16] = { 0 }; + uint32_t dataLen = 16; + uint8_t* enhanceData = nullptr; + uint32_t enHancedataLen = MAX_HMAC_SIZE; + + int32_t result = SecCompEnhanceKit::GetPointerEventEnhanceData(originData, dataLen, enhanceData, enHancedataLen); + if (g_inputEnhanceExist) { + EXPECT_EQ(result, SC_SERVICE_ERROR_SERVICE_NOT_EXIST); + } else { + EXPECT_EQ(result, SC_ENHANCE_ERROR_NOT_EXIST_ENHANCE); + } +} diff --git a/interfaces/inner_api/security_component/test/unittest/src/location_button_test.cpp b/interfaces/inner_api/security_component/test/unittest/src/location_button_test.cpp index 335bb98..7bd3d51 100644 --- a/interfaces/inner_api/security_component/test/unittest/src/location_button_test.cpp +++ b/interfaces/inner_api/security_component/test/unittest/src/location_button_test.cpp @@ -47,7 +47,7 @@ void LocationButtonTest::TearDown() * @tc.name: FromJson001 * @tc.desc: Test LocationButton from json success * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(LocationButtonTest, FromJson001, TestSize.Level1) { @@ -62,7 +62,7 @@ HWTEST_F(LocationButtonTest, FromJson001, TestSize.Level1) * @tc.name: FromJson002 * @tc.desc: Test empty LocationButton from json * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(LocationButtonTest, FromJson002, TestSize.Level1) { @@ -75,7 +75,7 @@ HWTEST_F(LocationButtonTest, FromJson002, TestSize.Level1) * @tc.name: FromJson003 * @tc.desc: Test location button from wrong type json * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(LocationButtonTest, FromJson003, TestSize.Level1) { @@ -95,7 +95,7 @@ HWTEST_F(LocationButtonTest, FromJson003, TestSize.Level1) * @tc.name: FromJson004 * @tc.desc: Test location button from wrong rect json * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(LocationButtonTest, FromJson004, TestSize.Level1) { @@ -130,7 +130,7 @@ HWTEST_F(LocationButtonTest, FromJson004, TestSize.Level1) * @tc.name: FromJson005 * @tc.desc: Test location button from wrong rect json * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(LocationButtonTest, FromJson005, TestSize.Level1) { @@ -165,7 +165,7 @@ HWTEST_F(LocationButtonTest, FromJson005, TestSize.Level1) * @tc.name: FromJson006 * @tc.desc: Test location button from wrong size json * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(LocationButtonTest, FromJson006, TestSize.Level1) { @@ -191,7 +191,7 @@ HWTEST_F(LocationButtonTest, FromJson006, TestSize.Level1) * @tc.name: FromJson007 * @tc.desc: Test location button from wrong size json * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(LocationButtonTest, FromJson007, TestSize.Level1) { @@ -214,7 +214,7 @@ HWTEST_F(LocationButtonTest, FromJson007, TestSize.Level1) * @tc.name: FromJson008 * @tc.desc: Test location button from wrong size json * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(LocationButtonTest, FromJson008, TestSize.Level1) { @@ -237,7 +237,7 @@ HWTEST_F(LocationButtonTest, FromJson008, TestSize.Level1) * @tc.name: FromJson009 * @tc.desc: Test location button from wrong border and parent json * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(LocationButtonTest, FromJson009, TestSize.Level1) { @@ -262,7 +262,7 @@ HWTEST_F(LocationButtonTest, FromJson009, TestSize.Level1) * @tc.name: FromJson010 * @tc.desc: Test location button from wrong type params json * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(LocationButtonTest, FromJson010, TestSize.Level1) { @@ -288,7 +288,7 @@ HWTEST_F(LocationButtonTest, FromJson010, TestSize.Level1) * @tc.name: FromJson011 * @tc.desc: Test location button from wrong type params json * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(LocationButtonTest, FromJson011, TestSize.Level1) { @@ -314,7 +314,7 @@ HWTEST_F(LocationButtonTest, FromJson011, TestSize.Level1) * @tc.name: FromJson012 * @tc.desc: Test location button from wrong value params json * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(LocationButtonTest, FromJson012, TestSize.Level1) { @@ -353,7 +353,7 @@ HWTEST_F(LocationButtonTest, FromJson012, TestSize.Level1) * @tc.name: ToJsonStr001 * @tc.desc: Test ToJsonStr normal branch * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(LocationButtonTest, ToJsonStr001, TestSize.Level1) { @@ -369,7 +369,7 @@ HWTEST_F(LocationButtonTest, ToJsonStr001, TestSize.Level1) * @tc.name: CompareComponentBasicInfo001 * @tc.desc: Test CompareComponentBasicInfo other is null * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(LocationButtonTest, CompareComponentBasicInfo001, TestSize.Level1) { @@ -384,7 +384,7 @@ HWTEST_F(LocationButtonTest, CompareComponentBasicInfo001, TestSize.Level1) * @tc.name: CompareLocationButton001 * @tc.desc: Test LocationButton compare * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(LocationButtonTest, CompareLocationButton001, TestSize.Level1) { @@ -417,7 +417,7 @@ HWTEST_F(LocationButtonTest, CompareLocationButton001, TestSize.Level1) * @tc.name: CompareLocationButton002 * @tc.desc: Test LocationButton compare * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(LocationButtonTest, CompareLocationButton002, TestSize.Level1) { @@ -482,7 +482,7 @@ HWTEST_F(LocationButtonTest, CompareLocationButton002, TestSize.Level1) * @tc.name: CompareLocationButton003 * @tc.desc: Test LocationButton compare * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(LocationButtonTest, CompareLocationButton003, TestSize.Level1) { diff --git a/interfaces/inner_api/security_component/test/unittest/src/paste_button_test.cpp b/interfaces/inner_api/security_component/test/unittest/src/paste_button_test.cpp index d79349d..cda4dbb 100644 --- a/interfaces/inner_api/security_component/test/unittest/src/paste_button_test.cpp +++ b/interfaces/inner_api/security_component/test/unittest/src/paste_button_test.cpp @@ -46,7 +46,7 @@ void PasteButtonTest::TearDown() * @tc.name: IsParamValid001 * @tc.desc: Test paste button from wrong value params json * @tc.type: FUNC - * @tc.require: AR000HO9JB + * @tc.require: */ HWTEST_F(PasteButtonTest, IsParamValid001, TestSize.Level1) { @@ -85,7 +85,7 @@ HWTEST_F(PasteButtonTest, IsParamValid001, TestSize.Level1) * @tc.name: ComparePasteButton001 * @tc.desc: Test compare paste button * @tc.type: FUNC - * @tc.require: AR000HO9JB + * @tc.require: */ HWTEST_F(PasteButtonTest, ComparePasteButton001, TestSize.Level1) { @@ -118,7 +118,7 @@ HWTEST_F(PasteButtonTest, ComparePasteButton001, TestSize.Level1) * @tc.name: ComparePasteButton002 * @tc.desc: Test PasteButton compare * @tc.type: FUNC - * @tc.require: AR000HO9JB + * @tc.require: */ HWTEST_F(PasteButtonTest, ComparePasteButton002, TestSize.Level1) { @@ -151,7 +151,7 @@ HWTEST_F(PasteButtonTest, ComparePasteButton002, TestSize.Level1) * @tc.name: ComparePasteButton003 * @tc.desc: Test PasteButton compare * @tc.type: FUNC - * @tc.require: AR000HO9JB + * @tc.require: */ HWTEST_F(PasteButtonTest, ComparePasteButton003, TestSize.Level1) { diff --git a/interfaces/inner_api/security_component/test/unittest/src/save_button_test.cpp b/interfaces/inner_api/security_component/test/unittest/src/save_button_test.cpp index 6c71088..c2ad23f 100644 --- a/interfaces/inner_api/security_component/test/unittest/src/save_button_test.cpp +++ b/interfaces/inner_api/security_component/test/unittest/src/save_button_test.cpp @@ -46,7 +46,7 @@ void SaveButtonTest::TearDown() * @tc.name: IsParamValid001 * @tc.desc: Test save button from wrong value params json * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SaveButtonTest, IsParamValid001, TestSize.Level1) { @@ -85,7 +85,7 @@ HWTEST_F(SaveButtonTest, IsParamValid001, TestSize.Level1) * @tc.name: CompareSaveButton001 * @tc.desc: Test compare save button * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SaveButtonTest, CompareSaveButton001, TestSize.Level1) { @@ -118,7 +118,7 @@ HWTEST_F(SaveButtonTest, CompareSaveButton001, TestSize.Level1) * @tc.name: CompareSaveButton002 * @tc.desc: Test SaveButton compare * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SaveButtonTest, CompareSaveButton002, TestSize.Level1) { @@ -151,7 +151,7 @@ HWTEST_F(SaveButtonTest, CompareSaveButton002, TestSize.Level1) * @tc.name: CompareSaveButton003 * @tc.desc: Test SaveButton compare * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SaveButtonTest, CompareSaveButton003, TestSize.Level1) { diff --git a/interfaces/inner_api/security_component/test/unittest/src/sec_comp_kit_test.cpp b/interfaces/inner_api/security_component/test/unittest/src/sec_comp_kit_test.cpp index 4c82ffc..22f1c76 100644 --- a/interfaces/inner_api/security_component/test/unittest/src/sec_comp_kit_test.cpp +++ b/interfaces/inner_api/security_component/test/unittest/src/sec_comp_kit_test.cpp @@ -86,7 +86,7 @@ void SecCompKitTest::TearDown() * @tc.name: ExceptCall001 * @tc.desc: do kit except call. * @tc.type: FUNC - * @tc.require: AR000HO9IN + * @tc.require: */ HWTEST_F(SecCompKitTest, ExceptCall001, TestSize.Level1) { @@ -131,7 +131,7 @@ HWTEST_F(SecCompKitTest, ExceptCall001, TestSize.Level1) * @tc.name: ExceptCall001 * @tc.desc: test caller check. * @tc.type: FUNC - * @tc.require: AR000HO9JS + * @tc.require: */ HWTEST_F(SecCompKitTest, TestCallerCheck001, TestSize.Level1) { @@ -156,7 +156,7 @@ HWTEST_F(SecCompKitTest, TestCallerCheck001, TestSize.Level1) * @tc.name: ExceptCall002 * @tc.desc: test invalid caller register. * @tc.type: FUNC - * @tc.require: AR000HO9JS + * @tc.require: */ HWTEST_F(SecCompKitTest, TestCallerCheck002, TestSize.Level1) { @@ -179,7 +179,7 @@ HWTEST_F(SecCompKitTest, TestCallerCheck002, TestSize.Level1) * @tc.name: RegisterWithoutCallback001 * @tc.desc: test register without callback. * @tc.type: FUNC - * @tc.require: AR000HO9JM + * @tc.require: */ HWTEST_F(SecCompKitTest, RegisterWithoutCallback001, TestSize.Level1) { @@ -204,7 +204,7 @@ HWTEST_F(SecCompKitTest, RegisterWithoutCallback001, TestSize.Level1) * @tc.name: FinishStartSAFail001 * @tc.desc: Test update security component caller error * @tc.type: FUNC - * @tc.require: AR000HO9IN + * @tc.require: */ HWTEST_F(SecCompKitTest, FinishStartSAFail001, TestSize.Level1) { @@ -219,7 +219,7 @@ HWTEST_F(SecCompKitTest, FinishStartSAFail001, TestSize.Level1) * @tc.name: OnLoadSystemAbilitySuccess001 * @tc.desc: Test update security component caller error * @tc.type: FUNC - * @tc.require: AR000HO9IN + * @tc.require: */ HWTEST_F(SecCompKitTest, OnLoadSystemAbilitySuccess001, TestSize.Level1) { diff --git a/interfaces/inner_api/security_component/test/unittest/src/sec_comp_register_callback_test.cpp b/interfaces/inner_api/security_component/test/unittest/src/sec_comp_register_callback_test.cpp index 5cbf7b7..52049d3 100644 --- a/interfaces/inner_api/security_component/test/unittest/src/sec_comp_register_callback_test.cpp +++ b/interfaces/inner_api/security_component/test/unittest/src/sec_comp_register_callback_test.cpp @@ -126,7 +126,7 @@ HWTEST_F(SecCompRegisterCallbackTest, RegisterWithoutPreprocess001, TestSize.Lev * @tc.name: RegisterSecurityComponent001 * @tc.desc: test register security component success. * @tc.type: FUNC - * @tc.require: AR000HO9JM + * @tc.require: */ HWTEST_F(SecCompRegisterCallbackTest, RegisterSecurityComponent001, TestSize.Level1) { @@ -147,7 +147,7 @@ HWTEST_F(SecCompRegisterCallbackTest, RegisterSecurityComponent001, TestSize.Lev * @tc.name: RegisterSecurityComponent002 * @tc.desc: test register callback failed. * @tc.type: FUNC - * @tc.require: AR000HO9JM + * @tc.require: */ HWTEST_F(SecCompRegisterCallbackTest, RegisterSecurityComponent002, TestSize.Level1) { @@ -174,7 +174,7 @@ HWTEST_F(SecCompRegisterCallbackTest, RegisterSecurityComponent002, TestSize.Lev * @tc.name: RegisterSecurityComponent003 * @tc.desc: test register in MaliciousAppList. * @tc.type: FUNC - * @tc.require: AR000HO9JM + * @tc.require: */ HWTEST_F(SecCompRegisterCallbackTest, RegisterSecurityComponent003, TestSize.Level1) { @@ -193,7 +193,7 @@ HWTEST_F(SecCompRegisterCallbackTest, RegisterSecurityComponent003, TestSize.Lev * @tc.name: RegisterSecurityComponent004 * @tc.desc: Test register security component check touch info failed * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompRegisterCallbackTest, RegisterSecurityComponent004, TestSize.Level1) { @@ -228,7 +228,7 @@ HWTEST_F(SecCompRegisterCallbackTest, RegisterSecurityComponent004, TestSize.Lev * @tc.name: RegisterSecurityComponent005 * @tc.desc: Test register security component permission grant failed * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompRegisterCallbackTest, RegisterSecurityComponent005, TestSize.Level1) { @@ -262,7 +262,7 @@ HWTEST_F(SecCompRegisterCallbackTest, RegisterSecurityComponent005, TestSize.Lev * @tc.name: RegisterSecurityComponent006 * @tc.desc: Test register security component permission grant failed caller error * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompRegisterCallbackTest, RegisterSecurityComponent006, TestSize.Level1) { @@ -278,7 +278,7 @@ HWTEST_F(SecCompRegisterCallbackTest, RegisterSecurityComponent006, TestSize.Lev * @tc.name: ReportSecurityComponentClickEvent001 * @tc.desc: Test register security component success * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompRegisterCallbackTest, ReportSecurityComponentClickEvent001, TestSize.Level1) { @@ -315,7 +315,7 @@ HWTEST_F(SecCompRegisterCallbackTest, ReportSecurityComponentClickEvent001, Test * @tc.name: ReportSecurityComponentClickEvent002 * @tc.desc: Test report security component caller error * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompRegisterCallbackTest, ReportSecurityComponentClickEvent002, TestSize.Level1) { @@ -353,7 +353,7 @@ HWTEST_F(SecCompRegisterCallbackTest, ReportSecurityComponentClickEvent002, Test * @tc.name: ReportSecurityComponentClickEvent003 * @tc.desc: Test report security component data is empty * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompRegisterCallbackTest, ReportSecurityComponentClickEvent003, TestSize.Level1) { @@ -384,7 +384,7 @@ HWTEST_F(SecCompRegisterCallbackTest, ReportSecurityComponentClickEvent003, Test * @tc.name: ReportClickWithoutHmac001 * @tc.desc: Test report click event permission denied * @tc.type: FUNC - * @tc.require: AR000HO9JM + * @tc.require: */ HWTEST_F(SecCompRegisterCallbackTest, ReportClickWithoutHmac001, TestSize.Level1) { @@ -421,7 +421,7 @@ HWTEST_F(SecCompRegisterCallbackTest, ReportClickWithoutHmac001, TestSize.Level1 * @tc.name: VerifySavePermission001 * @tc.desc: Test register security component wrong hap * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompRegisterCallbackTest, VerifySavePermission001, TestSize.Level1) { @@ -461,7 +461,7 @@ HWTEST_F(SecCompRegisterCallbackTest, VerifySavePermission001, TestSize.Level1) * @tc.name: VerifySavePermission002 * @tc.desc: Test register security component invalid tokenId * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompRegisterCallbackTest, VerifySavePermission002, TestSize.Level1) { @@ -496,7 +496,7 @@ HWTEST_F(SecCompRegisterCallbackTest, VerifySavePermission002, TestSize.Level1) * @tc.name: UnregisterSecurityComponent001 * @tc.desc: Test unregister security component caller error * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompRegisterCallbackTest, UnregisterSecurityComponent001, TestSize.Level1) { @@ -530,7 +530,7 @@ HWTEST_F(SecCompRegisterCallbackTest, UnregisterSecurityComponent001, TestSize.L * @tc.name: UpdateSecurityComponent001 * @tc.desc: Test update security component success * @tc.type: FUNC - * @tc.require: AR000HO9IN + * @tc.require: */ HWTEST_F(SecCompRegisterCallbackTest, UpdateSecurityComponent001, TestSize.Level1) { @@ -548,7 +548,7 @@ HWTEST_F(SecCompRegisterCallbackTest, UpdateSecurityComponent001, TestSize.Level * @tc.name: UpdateSecurityComponent002 * @tc.desc: Test update security component caller error * @tc.type: FUNC - * @tc.require: AR000HO9IN + * @tc.require: */ HWTEST_F(SecCompRegisterCallbackTest, UpdateSecurityComponent002, TestSize.Level1) { diff --git a/services/security_component_service/sa/sa_main/sec_comp_manager.cpp b/services/security_component_service/sa/sa_main/sec_comp_manager.cpp index 7a3e002..b0a9aa2 100644 --- a/services/security_component_service/sa/sa_main/sec_comp_manager.cpp +++ b/services/security_component_service/sa/sa_main/sec_comp_manager.cpp @@ -44,15 +44,30 @@ SecCompManager& SecCompManager::GetInstance() static SecCompManager instance; return instance; } +bool SecCompManager::IsScIdExist(int32_t scId) +{ + OHOS::Utils::UniqueReadGuard lk(this->componentInfoLock_); + for (auto it = componentMap_.begin(); it != componentMap_.end(); ++it) { + for (auto iter = it->second.compList.begin(); iter != it->second.compList.end(); ++iter) { + SecCompEntity sc = *iter; + if (scId == sc.GetScId()) { + return true; + } + } + } + return false; +} int32_t SecCompManager::CreateScId() { std::lock_guard lock(scIdMtx_); - if (scIdStart_ == MAX_INT_NUM) { - scIdStart_ = SC_ID_START; - } else { - scIdStart_++; - } + do { + if (scIdStart_ == MAX_INT_NUM) { + scIdStart_ = SC_ID_START; + } else { + scIdStart_++; + } + } while (IsScIdExist(scIdStart_)); return scIdStart_; } diff --git a/services/security_component_service/sa/sa_main/sec_comp_manager.h b/services/security_component_service/sa/sa_main/sec_comp_manager.h index fdf83d0..c683451 100644 --- a/services/security_component_service/sa/sa_main/sec_comp_manager.h +++ b/services/security_component_service/sa/sa_main/sec_comp_manager.h @@ -71,6 +71,7 @@ private: SecCompManager(); bool IsForegroundCompExist(); bool IsCompExist(); + bool IsScIdExist(int32_t scId); int32_t AddSecurityComponentToList(int32_t pid, AccessToken::AccessTokenID tokenId, const SecCompEntity& newEntity); int32_t DeleteSecurityComponentFromList(int32_t pid, int32_t scId); diff --git a/services/security_component_service/sa/test/unittest/src/app_state_observer_test.cpp b/services/security_component_service/sa/test/unittest/src/app_state_observer_test.cpp index ab47da8..90bdc3f 100644 --- a/services/security_component_service/sa/test/unittest/src/app_state_observer_test.cpp +++ b/services/security_component_service/sa/test/unittest/src/app_state_observer_test.cpp @@ -53,7 +53,7 @@ void AppStateObserverTest::TearDown() * @tc.name: IsProcessForeground001 * @tc.desc: Test is process foreground * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(AppStateObserverTest, IsProcessForeground001, TestSize.Level1) { @@ -70,7 +70,7 @@ HWTEST_F(AppStateObserverTest, IsProcessForeground001, TestSize.Level1) * @tc.name: AddProcessToForegroundSet001 * @tc.desc: Test add process to foreground * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(AppStateObserverTest, AddProcessToForegroundSet001, TestSize.Level1) { @@ -95,7 +95,7 @@ HWTEST_F(AppStateObserverTest, AddProcessToForegroundSet001, TestSize.Level1) * @tc.name: RemoveProcessFromForegroundSet001 * @tc.desc: Test remove process from foreground * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(AppStateObserverTest, RemoveProcessFromForegroundSet001, TestSize.Level1) { @@ -114,7 +114,7 @@ HWTEST_F(AppStateObserverTest, RemoveProcessFromForegroundSet001, TestSize.Level * @tc.name: RemoveProcessFromForegroundSet002 * @tc.desc: Test remove process with different uid * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(AppStateObserverTest, RemoveProcessFromForegroundSet002, TestSize.Level1) { @@ -133,7 +133,7 @@ HWTEST_F(AppStateObserverTest, RemoveProcessFromForegroundSet002, TestSize.Level * @tc.name: OnProcessStateChanged001 * @tc.desc: Test recieve process state changed * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(AppStateObserverTest, OnProcessStateChanged001, TestSize.Level1) { @@ -157,7 +157,7 @@ HWTEST_F(AppStateObserverTest, OnProcessStateChanged001, TestSize.Level1) * @tc.name: OnProcessStateChanged002 * @tc.desc: Test add process to foregroundset twice * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(AppStateObserverTest, OnProcessStateChanged002, TestSize.Level1) { @@ -177,7 +177,7 @@ HWTEST_F(AppStateObserverTest, OnProcessStateChanged002, TestSize.Level1) * @tc.name: OnProcessDied001 * @tc.desc: Test recieve process state died * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(AppStateObserverTest, OnProcessDied001, TestSize.Level1) { @@ -202,7 +202,7 @@ HWTEST_F(AppStateObserverTest, OnProcessDied001, TestSize.Level1) * @tc.name: AddProcessToForegroundSet002 * @tc.desc: Test add process to foreground * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(AppStateObserverTest, AddProcessToForegroundSet002, TestSize.Level1) { @@ -223,7 +223,7 @@ HWTEST_F(AppStateObserverTest, AddProcessToForegroundSet002, TestSize.Level1) * @tc.name: DumpProcess001 * @tc.desc: Test DumpProcess * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(AppStateObserverTest, DumpProcess001, TestSize.Level1) { diff --git a/services/security_component_service/sa/test/unittest/src/sec_comp_entity_test.cpp b/services/security_component_service/sa/test/unittest/src/sec_comp_entity_test.cpp index 7e50288..a36721b 100644 --- a/services/security_component_service/sa/test/unittest/src/sec_comp_entity_test.cpp +++ b/services/security_component_service/sa/test/unittest/src/sec_comp_entity_test.cpp @@ -65,7 +65,7 @@ void SecCompEntityTest::TearDown() * @tc.name: GrantTempPermission001 * @tc.desc: Test grant location permission * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompEntityTest, GrantTempPermission001, TestSize.Level1) { @@ -89,7 +89,7 @@ HWTEST_F(SecCompEntityTest, GrantTempPermission001, TestSize.Level1) * @tc.name: GrantTempPermission002 * @tc.desc: Test grant paste permission with invalid tokenId. * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompEntityTest, GrantTempPermission002, TestSize.Level1) { @@ -106,7 +106,7 @@ HWTEST_F(SecCompEntityTest, GrantTempPermission002, TestSize.Level1) * @tc.name: CheckClickInfo001 * @tc.desc: Test touch info * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompEntityTest, CheckClickInfo001, TestSize.Level1) { @@ -171,7 +171,7 @@ HWTEST_F(SecCompEntityTest, CheckClickInfo002, TestSize.Level1) * @tc.name: CompareComponentBasicInfo001 * @tc.desc: Test Basic info * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompEntityTest, CompareComponentBasicInfo001, TestSize.Level1) { @@ -186,7 +186,7 @@ HWTEST_F(SecCompEntityTest, CompareComponentBasicInfo001, TestSize.Level1) * @tc.name: CheckKeyEvent001 * @tc.desc: Test CheckKeyEvent * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompEntityTest, CheckKeyEvent001, TestSize.Level1) { diff --git a/services/security_component_service/sa/test/unittest/src/sec_comp_info_helper_test.cpp b/services/security_component_service/sa/test/unittest/src/sec_comp_info_helper_test.cpp index a14a3e1..0083c57 100644 --- a/services/security_component_service/sa/test/unittest/src/sec_comp_info_helper_test.cpp +++ b/services/security_component_service/sa/test/unittest/src/sec_comp_info_helper_test.cpp @@ -80,7 +80,7 @@ void SecCompInfoHelperTest::TearDown() * @tc.name: ParseComponent001 * @tc.desc: Test parse component info success * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompInfoHelperTest, ParseComponent001, TestSize.Level1) { @@ -95,7 +95,7 @@ HWTEST_F(SecCompInfoHelperTest, ParseComponent001, TestSize.Level1) * @tc.name: ParseComponent002 * @tc.desc: Test parse component info with empty json * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompInfoHelperTest, ParseComponent002, TestSize.Level1) { @@ -111,7 +111,7 @@ HWTEST_F(SecCompInfoHelperTest, ParseComponent002, TestSize.Level1) * @tc.name: ParseComponent003 * @tc.desc: Test parse component info with invalid type * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompInfoHelperTest, ParseComponent003, TestSize.Level1) { @@ -141,7 +141,7 @@ static SecCompRect GetDefaultRect(void) * @tc.name: ParseComponent004 * @tc.desc: Test parse component info with invalid rect * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompInfoHelperTest, ParseComponent004, TestSize.Level1) { @@ -184,7 +184,7 @@ HWTEST_F(SecCompInfoHelperTest, ParseComponent004, TestSize.Level1) * @tc.name: ParseComponent005 * @tc.desc: Test parse component info with windowRect invalid * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompInfoHelperTest, ParseComponent005, TestSize.Level1) { @@ -221,7 +221,7 @@ HWTEST_F(SecCompInfoHelperTest, ParseComponent005, TestSize.Level1) * @tc.name: ParseComponent006 * @tc.desc: Test parse component info with parentEffect active * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompInfoHelperTest, ParseComponent006, TestSize.Level1) { @@ -242,7 +242,7 @@ HWTEST_F(SecCompInfoHelperTest, ParseComponent006, TestSize.Level1) * @tc.name: ParseComponent007 * @tc.desc: Test parse component info with invalid size * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompInfoHelperTest, ParseComponent007, TestSize.Level1) { @@ -272,7 +272,7 @@ HWTEST_F(SecCompInfoHelperTest, ParseComponent007, TestSize.Level1) * @tc.name: ParseComponent008 * @tc.desc: Test parse component info with invalid size * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompInfoHelperTest, ParseComponent008, TestSize.Level1) { @@ -297,7 +297,7 @@ HWTEST_F(SecCompInfoHelperTest, ParseComponent008, TestSize.Level1) * @tc.name: ParseComponent009 * @tc.desc: Test parse component info with invalid size * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompInfoHelperTest, ParseComponent009, TestSize.Level1) { @@ -322,7 +322,7 @@ HWTEST_F(SecCompInfoHelperTest, ParseComponent009, TestSize.Level1) * @tc.name: ParseComponent010 * @tc.desc: Test parse component info with invalid color * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompInfoHelperTest, ParseComponent010, TestSize.Level1) { @@ -346,7 +346,7 @@ HWTEST_F(SecCompInfoHelperTest, ParseComponent010, TestSize.Level1) * @tc.name: ParseComponent011 * @tc.desc: Test parse component info with invalid style * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompInfoHelperTest, ParseComponent011, TestSize.Level1) { @@ -368,7 +368,7 @@ HWTEST_F(SecCompInfoHelperTest, ParseComponent011, TestSize.Level1) * @tc.name: ParseComponent012 * @tc.desc: Test parse component info with invalid style * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompInfoHelperTest, ParseComponent012, TestSize.Level1) { @@ -397,7 +397,7 @@ HWTEST_F(SecCompInfoHelperTest, ParseComponent012, TestSize.Level1) * @tc.name: ParseComponent013 * @tc.desc: Test parse component info with invalid style * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompInfoHelperTest, ParseComponent013, TestSize.Level1) { @@ -428,7 +428,7 @@ HWTEST_F(SecCompInfoHelperTest, ParseComponent013, TestSize.Level1) * @tc.name: ParseComponent014 * @tc.desc: Test parse component info with invalid style * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompInfoHelperTest, ParseComponent014, TestSize.Level1) { @@ -461,7 +461,7 @@ HWTEST_F(SecCompInfoHelperTest, ParseComponent014, TestSize.Level1) * @tc.name: ParseComponent015 * @tc.desc: Test parse component info with similar color * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompInfoHelperTest, ParseComponent015, TestSize.Level1) { @@ -488,7 +488,7 @@ HWTEST_F(SecCompInfoHelperTest, ParseComponent015, TestSize.Level1) * @tc.name: CheckComponentValid001 * @tc.desc: Test CheckComponentValid with invalid color * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompInfoHelperTest, CheckComponentValid001, TestSize.Level1) { @@ -510,7 +510,7 @@ HWTEST_F(SecCompInfoHelperTest, CheckComponentValid001, TestSize.Level1) * @tc.name: CheckComponentValid002 * @tc.desc: Test CheckComponentValid with invalid text or icon * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompInfoHelperTest, CheckComponentValid002, TestSize.Level1) { @@ -532,7 +532,7 @@ HWTEST_F(SecCompInfoHelperTest, CheckComponentValid002, TestSize.Level1) * @tc.name: CheckComponentValid003 * @tc.desc: Test CheckComponentValid with invalid type * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompInfoHelperTest, CheckComponentValid003, TestSize.Level1) { diff --git a/services/security_component_service/sa/test/unittest/src/sec_comp_manager_test.cpp b/services/security_component_service/sa/test/unittest/src/sec_comp_manager_test.cpp index 73a38c3..d5c1b1d 100644 --- a/services/security_component_service/sa/test/unittest/src/sec_comp_manager_test.cpp +++ b/services/security_component_service/sa/test/unittest/src/sec_comp_manager_test.cpp @@ -117,7 +117,7 @@ void SecCompManagerTest::TearDown() * @tc.name: CreateScId001 * @tc.desc: Test create sc id * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompManagerTest, CreateScId001, TestSize.Level1) { @@ -128,11 +128,32 @@ HWTEST_F(SecCompManagerTest, CreateScId001, TestSize.Level1) ASSERT_EQ(ServiceTestCommon::SC_ID_START + 1, SecCompManager::GetInstance().CreateScId()); } +/** + * @tc.name: CreateScId002 + * @tc.desc: Test create sc id + * @tc.type: FUNC + * @tc.require: + */ +HWTEST_F(SecCompManagerTest, CreateScId002, TestSize.Level1) +{ + std::shared_ptr compPtr = std::make_shared(); + ASSERT_NE(nullptr, compPtr); + compPtr->rect_.x_ = ServiceTestCommon::TEST_COORDINATE; + compPtr->rect_.y_ = ServiceTestCommon::TEST_COORDINATE; + compPtr->rect_.width_ = ServiceTestCommon::TEST_COORDINATE; + compPtr->rect_.height_ = ServiceTestCommon::TEST_COORDINATE; + SecCompEntity entity(compPtr, ServiceTestCommon::TEST_TOKEN_ID, ServiceTestCommon::SC_ID_START); + ASSERT_EQ(SC_OK, SecCompManager::GetInstance().AddSecurityComponentToList(1, 0, entity)); + + SecCompManager::GetInstance().scIdStart_ = ServiceTestCommon::MAX_INT_NUM; + ASSERT_EQ(ServiceTestCommon::SC_ID_START + 1, SecCompManager::GetInstance().CreateScId()); +} + /** * @tc.name: AddSecurityComponentToList001 * @tc.desc: Test add security component to list * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompManagerTest, AddSecurityComponentToList001, TestSize.Level1) { @@ -160,7 +181,7 @@ HWTEST_F(SecCompManagerTest, AddSecurityComponentToList001, TestSize.Level1) * @tc.name: AddSecurityComponentToList002 * @tc.desc: Test add security component to list sa not exit * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompManagerTest, AddSecurityComponentToList002, TestSize.Level1) { @@ -178,7 +199,7 @@ HWTEST_F(SecCompManagerTest, AddSecurityComponentToList002, TestSize.Level1) * @tc.name: DeleteSecurityComponentFromList001 * @tc.desc: Test delete security component * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompManagerTest, DeleteSecurityComponentFromList001, TestSize.Level1) { @@ -206,7 +227,7 @@ HWTEST_F(SecCompManagerTest, DeleteSecurityComponentFromList001, TestSize.Level1 * @tc.name: GetSecurityComponentFromList001 * @tc.desc: Test get security component * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompManagerTest, GetSecurityComponentFromList001, TestSize.Level1) { @@ -232,7 +253,7 @@ HWTEST_F(SecCompManagerTest, GetSecurityComponentFromList001, TestSize.Level1) * @tc.name: NotifyProcessBackground001 * @tc.desc: Test notify process background * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompManagerTest, NotifyProcessBackground001, TestSize.Level1) { @@ -262,7 +283,7 @@ HWTEST_F(SecCompManagerTest, NotifyProcessBackground001, TestSize.Level1) * @tc.name: NotifyProcessDied001 * @tc.desc: Test notify process died * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompManagerTest, NotifyProcessDied001, TestSize.Level1) { @@ -299,7 +320,7 @@ HWTEST_F(SecCompManagerTest, NotifyProcessDied001, TestSize.Level1) * @tc.name: RegisterSecurityComponent001 * @tc.desc: Test register security component * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompManagerTest, RegisterSecurityComponent001, TestSize.Level1) { @@ -339,7 +360,7 @@ HWTEST_F(SecCompManagerTest, RegisterSecurityComponent001, TestSize.Level1) * @tc.name: UpdateSecurityComponent001 * @tc.desc: Test update security component * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompManagerTest, UpdateSecurityComponent001, TestSize.Level1) { @@ -384,7 +405,7 @@ HWTEST_F(SecCompManagerTest, UpdateSecurityComponent001, TestSize.Level1) * @tc.name: UnregisterSecurityComponent001 * @tc.desc: Test unregister security component * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompManagerTest, UnregisterSecurityComponent001, TestSize.Level1) { @@ -401,7 +422,7 @@ HWTEST_F(SecCompManagerTest, UnregisterSecurityComponent001, TestSize.Level1) * @tc.name: ReportSecurityComponentClickEvent001 * @tc.desc: Test report security component click * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompManagerTest, ReportSecurityComponentClickEvent001, TestSize.Level1) { @@ -441,7 +462,7 @@ HWTEST_F(SecCompManagerTest, AddSecurityComponentToList004, TestSize.Level1) * @tc.name: CheckClickSecurityComponentInfo001 * @tc.desc: Test check click security component info failed * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompManagerTest, CheckClickSecurityComponentInfo001, TestSize.Level1) { @@ -478,7 +499,7 @@ HWTEST_F(SecCompManagerTest, CheckClickSecurityComponentInfo001, TestSize.Level1 * @tc.name: AddSecurityComponentToList003 * @tc.desc: Test add security component to list sa not exit * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompManagerTest, AddSecurityComponentToList003, TestSize.Level1) { @@ -494,7 +515,7 @@ HWTEST_F(SecCompManagerTest, AddSecurityComponentToList003, TestSize.Level1) * @tc.name: DeleteSecurityComponentFromList002 * @tc.desc: Test delete security component * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompManagerTest, DeleteSecurityComponentFromList002, TestSize.Level1) { @@ -517,7 +538,7 @@ HWTEST_F(SecCompManagerTest, DeleteSecurityComponentFromList002, TestSize.Level1 * @tc.name: UpdateSecurityComponent002 * @tc.desc: Test update security component * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompManagerTest, UpdateSecurityComponent002, TestSize.Level1) { @@ -540,7 +561,7 @@ HWTEST_F(SecCompManagerTest, UpdateSecurityComponent002, TestSize.Level1) * @tc.name: ExitSaProcess001 * @tc.desc: Test check ExitSaProcess * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompManagerTest, ExitSaProcess001, TestSize.Level1) { @@ -581,7 +602,7 @@ HWTEST_F(SecCompManagerTest, ExitSaProcess001, TestSize.Level1) * @tc.name: ExitWhenAppMgrDied001 * @tc.desc: Test check ExitWhenAppMgrDied * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompManagerTest, ExitWhenAppMgrDied001, TestSize.Level1) { @@ -622,7 +643,7 @@ HWTEST_F(SecCompManagerTest, ExitWhenAppMgrDied001, TestSize.Level1) * @tc.name: SendCheckInfoEnhanceSysEvent001 * @tc.desc: Test check SendCheckInfoEnhanceSysEvent * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompManagerTest, SendCheckInfoEnhanceSysEvent001, TestSize.Level1) { @@ -638,7 +659,7 @@ HWTEST_F(SecCompManagerTest, SendCheckInfoEnhanceSysEvent001, TestSize.Level1) * @tc.name: DumpSecComp001 * @tc.desc: Test check DumpSecComp * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompManagerTest, DumpSecComp001, TestSize.Level1) { @@ -660,7 +681,7 @@ HWTEST_F(SecCompManagerTest, DumpSecComp001, TestSize.Level1) * @tc.name: TransformCallBackResult001 * @tc.desc: Test check TransformCallBackResult * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompManagerTest, TransformCallBackResult001, TestSize.Level1) { diff --git a/services/security_component_service/sa/test/unittest/src/sec_comp_service_mock_test.cpp b/services/security_component_service/sa/test/unittest/src/sec_comp_service_mock_test.cpp index c66b058..3fa4bb1 100644 --- a/services/security_component_service/sa/test/unittest/src/sec_comp_service_mock_test.cpp +++ b/services/security_component_service/sa/test/unittest/src/sec_comp_service_mock_test.cpp @@ -75,7 +75,7 @@ void SecCompServiceMockTest::TearDown() * @tc.name: RegisterSecurityComponent001 * @tc.desc: Test register security component * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompServiceMockTest, RegisterSecurityComponent001, TestSize.Level1) { @@ -118,7 +118,7 @@ HWTEST_F(SecCompServiceMockTest, RegisterSecurityComponent001, TestSize.Level1) * @tc.name: RegisterSecurityComponent002 * @tc.desc: Test register security component check touch info failed * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompServiceMockTest, RegisterSecurityComponent002, TestSize.Level1) { @@ -153,7 +153,7 @@ HWTEST_F(SecCompServiceMockTest, RegisterSecurityComponent002, TestSize.Level1) * @tc.name: RegisterSecurityComponent003 * @tc.desc: Test register security component permission grant failed * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompServiceMockTest, RegisterSecurityComponent003, TestSize.Level1) { @@ -189,7 +189,7 @@ HWTEST_F(SecCompServiceMockTest, RegisterSecurityComponent003, TestSize.Level1) * @tc.name: ReportSecurityComponentClickEvent001 * @tc.desc: Test register security component * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompServiceMockTest, ReportSecurityComponentClickEvent001, TestSize.Level1) { @@ -242,7 +242,7 @@ HWTEST_F(SecCompServiceMockTest, ReportSecurityComponentClickEvent001, TestSize. * @tc.name: ReportSecurityComponentClickEvent002 * @tc.desc: Test verify location permission * @tc.type: FUNC - * @tc.require: AR000HO9IN + * @tc.require: */ HWTEST_F(SecCompServiceMockTest, ReportSecurityComponentClickEvent002, TestSize.Level1) { diff --git a/services/security_component_service/sa/test/unittest/src/sec_comp_service_test.cpp b/services/security_component_service/sa/test/unittest/src/sec_comp_service_test.cpp index 9fef594..1facbd2 100644 --- a/services/security_component_service/sa/test/unittest/src/sec_comp_service_test.cpp +++ b/services/security_component_service/sa/test/unittest/src/sec_comp_service_test.cpp @@ -77,7 +77,7 @@ void SecCompServiceTest::TearDown() * @tc.name: Onstart001 * @tc.desc: Test OnStart * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompServiceTest, OnStart001, TestSize.Level1) { @@ -99,7 +99,7 @@ HWTEST_F(SecCompServiceTest, OnStart001, TestSize.Level1) * @tc.name: RegisterAppStateObserver001 * @tc.desc: Test RegisterAppStateObserver * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompServiceTest, RegisterAppStateObserver001, TestSize.Level1) { @@ -162,7 +162,7 @@ HWTEST_F(SecCompServiceTest, RegisterAppStateObserver001, TestSize.Level1) * @tc.name: UnregisterAppStateObserver001 * @tc.desc: Test RegisterAppStateObserver * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompServiceTest, UnregisterAppStateObserver001, TestSize.Level1) { @@ -179,7 +179,7 @@ HWTEST_F(SecCompServiceTest, UnregisterAppStateObserver001, TestSize.Level1) * @tc.name: GetCallerInfo001 * @tc.desc: Test get caller info * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompServiceTest, GetCallerInfo001, TestSize.Level1) { @@ -204,7 +204,7 @@ HWTEST_F(SecCompServiceTest, GetCallerInfo001, TestSize.Level1) * @tc.name: UnregisterSecurityComponent001 * @tc.desc: Test unregister security component * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompServiceTest, UnregisterSecurityComponent001, TestSize.Level1) { @@ -217,7 +217,7 @@ HWTEST_F(SecCompServiceTest, UnregisterSecurityComponent001, TestSize.Level1) * @tc.name: UpdateSecurityComponent001 * @tc.desc: Test update security component * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompServiceTest, UpdateSecurityComponent001, TestSize.Level1) { @@ -238,7 +238,7 @@ HWTEST_F(SecCompServiceTest, UpdateSecurityComponent001, TestSize.Level1) * @tc.name: ReportSecurityComponentClickEvent001 * @tc.desc: Test report security component * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompServiceTest, ReportSecurityComponentClickEvent001, TestSize.Level1) { @@ -297,7 +297,7 @@ HWTEST_F(SecCompServiceTest, ReportSecurityComponentClickEvent001, TestSize.Leve * @tc.name: Dump001 * @tc.desc: Test dump * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompServiceTest, Dump001, TestSize.Level1) { @@ -340,7 +340,7 @@ HWTEST_F(SecCompServiceTest, Dump001, TestSize.Level1) * @tc.name: Onstart002 * @tc.desc: Test OnStart * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompServiceTest, OnStart002, TestSize.Level1) { @@ -360,7 +360,7 @@ HWTEST_F(SecCompServiceTest, OnStart002, TestSize.Level1) * @tc.name: GetCallerInfo002 * @tc.desc: Test get caller info * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompServiceTest, GetCallerInfo002, TestSize.Level1) { diff --git a/services/security_component_service/sa/test/unittest/src/sec_comp_stub_test.cpp b/services/security_component_service/sa/test/unittest/src/sec_comp_stub_test.cpp index 87bb4af..346daf9 100644 --- a/services/security_component_service/sa/test/unittest/src/sec_comp_stub_test.cpp +++ b/services/security_component_service/sa/test/unittest/src/sec_comp_stub_test.cpp @@ -55,7 +55,7 @@ void SecCompStubTest::TearDown() * @tc.name: OnRemoteRequest001 * @tc.desc: Test on remote request * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompStubTest, OnRemoteRequest001, TestSize.Level1) { @@ -79,7 +79,7 @@ HWTEST_F(SecCompStubTest, OnRemoteRequest001, TestSize.Level1) * @tc.name: RegisterSecurityComponentInner001 * @tc.desc: Test register security component * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompStubTest, RegisterSecurityComponentInner001, TestSize.Level1) { @@ -106,7 +106,7 @@ HWTEST_F(SecCompStubTest, RegisterSecurityComponentInner001, TestSize.Level1) * @tc.name: UpdateSecurityComponentInner001 * @tc.desc: Test update security component * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompStubTest, UpdateSecurityComponentInner001, TestSize.Level1) { @@ -130,7 +130,7 @@ HWTEST_F(SecCompStubTest, UpdateSecurityComponentInner001, TestSize.Level1) * @tc.name: UnregisterSecurityComponentInner001 * @tc.desc: Test unregister security component * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompStubTest, UnregisterSecurityComponentInner001, TestSize.Level1) { @@ -203,7 +203,7 @@ HWTEST_F(SecCompStubTest, VerifySavePermissionInner001, TestSize.Level1) * @tc.name: Marshalling001 * @tc.desc: Test SecCompClickEventParcel::Marshalling * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompStubTest, Marshalling001, TestSize.Level1) { @@ -229,7 +229,7 @@ HWTEST_F(SecCompStubTest, Marshalling001, TestSize.Level1) * @tc.name: Unmarshalling001 * @tc.desc: Test SecCompClickEventParcel::Unmarshalling * @tc.type: FUNC - * @tc.require: AR000HO9J7 + * @tc.require: */ HWTEST_F(SecCompStubTest, Unmarshalling001, TestSize.Level1) { -- Gitee