diff --git a/test/unittest/enterprise_device_mgr_ability/enterprise_device_mgr_ability_test/enterprise_device_mgr_ability_test.cpp b/test/unittest/enterprise_device_mgr_ability/enterprise_device_mgr_ability_test/enterprise_device_mgr_ability_test.cpp index 0893256abf2655f17a26aa2ac80db7997707854f..e9b61f74fa1f65ad0b0c9b27194ec720bc922ae1 100644 --- a/test/unittest/enterprise_device_mgr_ability/enterprise_device_mgr_ability_test/enterprise_device_mgr_ability_test.cpp +++ b/test/unittest/enterprise_device_mgr_ability/enterprise_device_mgr_ability_test/enterprise_device_mgr_ability_test.cpp @@ -455,6 +455,7 @@ HWTEST_F(EnterpriseDeviceMgrAbilityTest, TestDisableSuperAdminIpcFail, TestSize. // the same edmMgr_->adminMgr_ two super admin res = edmMgr_->adminMgr_->DeleteAdmin(bundleName, DEFAULT_USER_ID); + Utils::SetEdmServiceDisable(); EXPECT_TRUE(res == ERR_OK); } @@ -570,6 +571,7 @@ HWTEST_F(EnterpriseDeviceMgrAbilityTest, TestSetEnterpriseInfoNoSame, TestSize.L // the same edmMgr_->adminMgr_ two super admin res = edmMgr_->adminMgr_->DeleteAdmin(bundleName, DEFAULT_USER_ID); + Utils::SetEdmServiceDisable(); EXPECT_TRUE(res == ERR_OK); } @@ -837,6 +839,8 @@ HWTEST_F(EnterpriseDeviceMgrAbilityTest, TestSubscribeManagedEventIpcFail, TestS EXPECT_TRUE(res == ERR_OK); res = edmMgr_->SubscribeManagedEvent(admin, event); EXPECT_TRUE(res == EdmReturnErrCode::PERMISSION_DENIED); + res = edmMgr_->DisableAdmin(admin, DEFAULT_USER_ID); + EXPECT_TRUE(res == ERR_OK); Utils::ResetTokenTypeAndUid(); } diff --git a/test/unittest/enterprise_device_mgr_proxy/BUILD.gn b/test/unittest/enterprise_device_mgr_proxy/BUILD.gn index 1a7d911ccecd86d03062b179ce0c53a619706855..e783e5caacc73188484943a097efed6306d3cb63 100644 --- a/test/unittest/enterprise_device_mgr_proxy/BUILD.gn +++ b/test/unittest/enterprise_device_mgr_proxy/BUILD.gn @@ -57,6 +57,7 @@ ohos_unittest("EdmDeviceMgrProxyUnitTest") { "bundle_framework:appexecfwk_core", "c_utils:utils", "common_event_service:cesfwk_innerkits", + "init:libbegetutil", "ipc:ipc_core", "safwk:system_ability_fwk", "samgr:samgr_proxy", diff --git a/test/unittest/enterprise_device_mgr_proxy/enterprise_device_mgr_proxy_test/enterprise_device_mgr_proxy_test.cpp b/test/unittest/enterprise_device_mgr_proxy/enterprise_device_mgr_proxy_test/enterprise_device_mgr_proxy_test.cpp index 0eb8f87f3a6c6e9f8559088a11d3e55cfa3cd7ac..7cef4be3d1ddeee2d5d0b91f0075a14a6f645b75 100644 --- a/test/unittest/enterprise_device_mgr_proxy/enterprise_device_mgr_proxy_test/enterprise_device_mgr_proxy_test.cpp +++ b/test/unittest/enterprise_device_mgr_proxy/enterprise_device_mgr_proxy_test/enterprise_device_mgr_proxy_test.cpp @@ -54,6 +54,7 @@ void EnterpriseDeviceMgrProxyTest::SetUp() edmSysManager_ = std::make_shared(); object_ = new (std::nothrow) EnterpriseDeviceMgrStubMock(); edmSysManager_->RegisterSystemAbilityOfRemoteObject(ENTERPRISE_DEVICE_MANAGER_SA_ID, object_); + Utils::SetEdmServiceEnable(); } void EnterpriseDeviceMgrProxyTest::TearDown() @@ -61,6 +62,7 @@ void EnterpriseDeviceMgrProxyTest::TearDown() EnterpriseDeviceMgrProxy::DestroyInstance(); edmSysManager_->UnregisterSystemAbilityOfRemoteObject(ENTERPRISE_DEVICE_MANAGER_SA_ID); object_ = nullptr; + Utils::SetEdmServiceDisable(); } /**