1 /*
2 * Copyright (c) 2023-2024 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 #include <gtest/gtest.h>
17 #include "accesstoken_kit.h"
18 #include "nativetoken_kit.h"
19 #include "token_setproc.h"
20
21 #define private public
22 #define protected public
23 #include "distributed_device_profile_service_new.h"
24 #include "system_ability_definition.h"
25 #include "profile_cache.h"
26 #include "distributed_device_profile_errors.h"
27 #include "trust_profile_manager.h"
28 #include "permission_manager.h"
29 #include "subscribe_profile_manager.h"
30 #include "event_handler_factory.h"
31 #include "distributed_device_profile_constants.h"
32 #include "dp_inited_callback_stub.h"
33 #include "i_dp_inited_callback.h"
34 #undef private
35 #undef protected
36
37
38 namespace OHOS {
39 namespace DistributedDeviceProfile {
40 using namespace testing;
41 using namespace testing::ext;
42 namespace {
43 const std::string PERMISSION_JSON_PATH = "/system/etc/deviceprofile/permission.json";
44 const int32_t PERMS_NUM = 2;
45 }
46 class DpProfileServiceTest : public testing::Test {
47 public:
48 static void SetUpTestCase();
49 static void TearDownTestCase();
50 void SetUp();
51 void TearDown();
52 };
53
SetUpTestCase()54 void DpProfileServiceTest::SetUpTestCase()
55 {
56 }
57
TearDownTestCase()58 void DpProfileServiceTest::TearDownTestCase()
59 {
60 }
61
SetUp()62 void DpProfileServiceTest::SetUp()
63 {
64 const char *perms[PERMS_NUM] = {
65 "ohos.permission.DISTRIBUTED_DATASYNC",
66 "ohos.permission.DISTRIBUTED_SOFTBUS_CENTER"
67 };
68 uint64_t tokenId;
69 NativeTokenInfoParams infoInstance = {
70 .dcapsNum = 0,
71 .permsNum = PERMS_NUM,
72 .aclsNum = 0,
73 .dcaps = nullptr,
74 .perms = perms,
75 .acls = nullptr,
76 .processName = "deviceprofile",
77 .aplStr = "system_core",
78 };
79 tokenId = GetAccessTokenId(&infoInstance);
80 SetSelfTokenID(tokenId);
81 OHOS::Security::AccessToken::AccessTokenKit::ReloadNativeTokenInfo();
82 }
83
TearDown()84 void DpProfileServiceTest::TearDown()
85 {
86 }
87
88 class DpInitedCallback : public DpInitedCallbackStub {
89 public:
DpInitedCallback()90 DpInitedCallback()
91 {
92 }
~DpInitedCallback()93 ~DpInitedCallback()
94 {
95 }
OnDpInited()96 int32_t OnDpInited()
97 {
98 return 0;
99 }
100 };
101
102 HWTEST_F(DpProfileServiceTest, Init_001, TestSize.Level1)
103 {
104 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().Init();
105 EXPECT_EQ(DP_SUCCESS, ret);
106 }
107
108 HWTEST_F(DpProfileServiceTest, UnInit_001, TestSize.Level1)
109 {
110 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().UnInit();
111 EXPECT_EQ(DP_DEVICE_PROFILE_MANAGER_UNINIT_FAIL, ret);
112 }
113
114 HWTEST_F(DpProfileServiceTest, CreateUnloadHandler_001, TestSize.Level1)
115 {
116 DistributedDeviceProfileServiceNew::GetInstance().unloadHandler_ = nullptr;
117 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().CreateUnloadHandler();
118 EXPECT_EQ(DP_SUCCESS, ret);
119
120 ret = DistributedDeviceProfileServiceNew::GetInstance().DestroyUnloadHandler();
121 EXPECT_EQ(DP_SUCCESS, ret);
122
123 EventHandlerFactory::GetInstance().Init();
124 ret = DistributedDeviceProfileServiceNew::GetInstance().CreateUnloadHandler();
125 EXPECT_EQ(DP_SUCCESS, ret);
126
127 ret = DistributedDeviceProfileServiceNew::GetInstance().DestroyUnloadHandler();
128 EXPECT_EQ(DP_SUCCESS, ret);
129 }
130
131 HWTEST_F(DpProfileServiceTest, PutAccessControlProfile_001, TestSize.Level1)
132 {
133 AccessControlProfile accessControlProfile;
134 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().PutAccessControlProfile(accessControlProfile);
135 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
136 DistributedDeviceProfileServiceNew::GetInstance().DelayUnloadTask();
137 }
138
139 HWTEST_F(DpProfileServiceTest, UpdateAccessControlProfile_001, TestSize.Level1)
140 {
141 AccessControlProfile accessControlProfile;
142 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().UpdateAccessControlProfile(accessControlProfile);
143 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
144 }
145
146 HWTEST_F(DpProfileServiceTest, PutProductInfoBatch_001, TestSize.Level1)
147 {
148 std::vector<ProductInfo> productInfos;
149 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().PutProductInfoBatch(productInfos);
150 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
151 }
152
153 HWTEST_F(DpProfileServiceTest, PutDeviceIconInfoBatch_001, TestSize.Level1)
154 {
155 std::vector<DeviceIconInfo> deviceIconInfos;
156 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().PutDeviceIconInfoBatch(deviceIconInfos);
157 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
158 }
159
160 HWTEST_F(DpProfileServiceTest, GetDeviceIconInfos_001, TestSize.Level1)
161 {
162 DeviceIconInfoFilterOptions filterOptions;
163 std::vector<DeviceIconInfo> deviceIconInfos;
164 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().GetDeviceIconInfos(filterOptions, deviceIconInfos);
165 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
166 }
167
168 HWTEST_F(DpProfileServiceTest, DeleteDeviceProfileBatch_001, TestSize.Level1)
169 {
170 std::vector<DeviceProfile> deviceProfiles;
171 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().DeleteDeviceProfileBatch(deviceProfiles);
172 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
173 }
174
175 HWTEST_F(DpProfileServiceTest, GetTrustDeviceProfile_001, TestSize.Level1)
176 {
177 std::string devid;
178 TrustDeviceProfile trustDeviceProfile;
179 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().GetTrustDeviceProfile(devid, trustDeviceProfile);
180 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
181 }
182
183 HWTEST_F(DpProfileServiceTest, GetAllTrustDeviceProfile_001, TestSize.Level1)
184 {
185 std::vector<TrustDeviceProfile> trustDeviceProfiles;
186 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().GetAllTrustDeviceProfile(trustDeviceProfiles);
187 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
188 }
189
190 HWTEST_F(DpProfileServiceTest, GetAccessControlProfile_001, TestSize.Level1)
191 {
192 std::map<std::string, std::string> queryParams;
193 std::vector<AccessControlProfile> accessControlProfiles;
194 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().GetAccessControlProfile(queryParams,
195 accessControlProfiles);
196 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
197 }
198
199 HWTEST_F(DpProfileServiceTest, GetAllAccessControlProfile_001, TestSize.Level1)
200 {
201 std::vector<AccessControlProfile> accessControlProfiles;
202 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().GetAllAccessControlProfile(accessControlProfiles);
203 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
204 }
205
206 HWTEST_F(DpProfileServiceTest, DeleteAccessControlProfile_001, TestSize.Level1)
207 {
208 int32_t accessControlId = 0;
209 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().DeleteAccessControlProfile(accessControlId);
210 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
211 }
212
213 HWTEST_F(DpProfileServiceTest, PutSessionKey_001, TestSize.Level1)
214 {
215 uint32_t userId = 0;
216 std::vector<uint8_t> sessionKey;
217 int32_t sessionKeyId = 0;
218 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().PutSessionKey(userId, sessionKey, sessionKeyId);
219 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
220 }
221
222 HWTEST_F(DpProfileServiceTest, GetSessionKey_001, TestSize.Level1)
223 {
224 uint32_t userId = 0;
225 std::vector<uint8_t> sessionKey;
226 int32_t sessionKeyId = 0;
227 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().GetSessionKey(userId, sessionKeyId, sessionKey);
228 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
229 }
230
231 HWTEST_F(DpProfileServiceTest, UpdateSessionKey_001, TestSize.Level1)
232 {
233 uint32_t userId = 0;
234 std::vector<uint8_t> sessionKey;
235 int32_t sessionKeyId = 0;
236 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().UpdateSessionKey(userId, sessionKeyId, sessionKey);
237 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
238 }
239
240 HWTEST_F(DpProfileServiceTest, DeleteSessionKey_001, TestSize.Level1)
241 {
242 uint32_t userId = 0;
243 int32_t sessionKeyId = 0;
244 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().DeleteSessionKey(userId, sessionKeyId);
245 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
246 }
247
248 HWTEST_F(DpProfileServiceTest, PutServiceProfile_001, TestSize.Level1)
249 {
250 std::string devid = "";
251 std::string serName = "serName_test";
252 std::string serviceType = "serviceType_test";
253 ServiceProfile serviceProfile(devid, serName, serviceType);
254 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().PutServiceProfile(serviceProfile);
255 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
256 }
257
258 HWTEST_F(DpProfileServiceTest, PutServiceProfileBatch_001, TestSize.Level1)
259 {
260 std::vector<ServiceProfile> serviceProfiles;
261 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().PutServiceProfileBatch(serviceProfiles);
262 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
263 }
264
265 HWTEST_F(DpProfileServiceTest, PutCharacteristicProfile_001, TestSize.Level1)
266 {
267 CharacteristicProfile charProfile;
268 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().PutCharacteristicProfile(charProfile);
269 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
270 }
271
272 HWTEST_F(DpProfileServiceTest, PutServiceInfoProfile_001, TestSize.Level1)
273 {
274 ServiceInfoProfile serviceInfoProfile;
275 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().PutServiceInfoProfile(serviceInfoProfile);
276 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
277 }
278
279 HWTEST_F(DpProfileServiceTest, DeleteServiceInfoProfile_001, TestSize.Level1)
280 {
281 ServiceInfoUniqueKey key;
282 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().DeleteServiceInfoProfile(key);
283 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
284 }
285
286 HWTEST_F(DpProfileServiceTest, UpdateServiceInfoProfile_001, TestSize.Level1)
287 {
288 ServiceInfoProfile serviceInfoProfile;
289 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().UpdateServiceInfoProfile(serviceInfoProfile);
290 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
291 }
292
293 HWTEST_F(DpProfileServiceTest, GetServiceInfoProfileByUniqueKey_001, TestSize.Level1)
294 {
295 ServiceInfoUniqueKey key;
296 ServiceInfoProfile serviceInfoProfile;
297 int32_t ret =
298 DistributedDeviceProfileServiceNew::GetInstance().GetServiceInfoProfileByUniqueKey(key, serviceInfoProfile);
299 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
300 }
301
302 HWTEST_F(DpProfileServiceTest, GetServiceInfoProfileListByTokenId_001, TestSize.Level1)
303 {
304 ServiceInfoUniqueKey key;
305 std::vector<ServiceInfoProfile> serviceInfoProfiles;
306 int32_t ret =
307 DistributedDeviceProfileServiceNew::GetInstance().GetServiceInfoProfileListByTokenId(key, serviceInfoProfiles);
308 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
309 }
310
311 HWTEST_F(DpProfileServiceTest, GetAllServiceInfoProfileList_001, TestSize.Level1)
312 {
313 std::vector<ServiceInfoProfile> serviceInfoProfiles;
314 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().GetAllServiceInfoProfileList(serviceInfoProfiles);
315 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
316 }
317
318 HWTEST_F(DpProfileServiceTest, GetServiceInfoProfileListByBundleName_001, TestSize.Level1)
319 {
320 ServiceInfoUniqueKey key;
321 std::vector<ServiceInfoProfile> serviceInfoProfiles;
322 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().GetServiceInfoProfileListByBundleName(
323 key, serviceInfoProfiles);
324 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
325 }
326
327 HWTEST_F(DpProfileServiceTest, PutCharacteristicProfileBatch_001, TestSize.Level1)
328 {
329 std::string devid = "";
330 std::string serName = "serName_test";
331 std::string charKey = "charKey_test";
332 std::string characteristicValue = "characteristicValue_test";
333 CharacteristicProfile charProfile(devid, serName, charKey, characteristicValue);
334 std::vector<CharacteristicProfile> charProfiles;
335 charProfiles.push_back(charProfile);
336 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().PutCharacteristicProfileBatch(charProfiles);
337 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
338 }
339
340 HWTEST_F(DpProfileServiceTest, GetDeviceProfile_001, TestSize.Level1)
341 {
342 std::string devid = "";
343 DeviceProfile deviceProfile;
344 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().GetDeviceProfile(devid, deviceProfile);
345 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
346 }
347
348 HWTEST_F(DpProfileServiceTest, GetDeviceProfiles_001, TestSize.Level1)
349 {
350 DeviceProfileFilterOptions options;
351 std::vector<DeviceProfile> deviceProfiles;
352 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().GetDeviceProfiles(options, deviceProfiles);
353 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
354 }
355
356 HWTEST_F(DpProfileServiceTest, GetServiceProfile_001, TestSize.Level1)
357 {
358 std::string devid = "";
359 std::string serName = "";
360 ServiceProfile serviceProfile;
361 int32_t ret =
362 DistributedDeviceProfileServiceNew::GetInstance().GetServiceProfile(devid, serName, serviceProfile);
363 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
364 }
365
366 HWTEST_F(DpProfileServiceTest, GetCharacteristicProfile_001, TestSize.Level1)
367 {
368 std::string devid = "";
369 std::string serName = "";
370 std::string charKey = "";
371 CharacteristicProfile charProfile;
372 int32_t ret =
373 DistributedDeviceProfileServiceNew::GetInstance().GetCharacteristicProfile(devid,
374 serName, charKey, charProfile);
375 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
376 }
377
378 HWTEST_F(DpProfileServiceTest, DeleteServiceProfile_001, TestSize.Level1)
379 {
380 std::string devid = "";
381 std::string serName = "";
382 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().DeleteServiceProfile(devid, serName);
383 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
384 }
385
386 HWTEST_F(DpProfileServiceTest, DeleteCharacteristicProfile_001, TestSize.Level1)
387 {
388 std::string devid = "";
389 std::string serName = "";
390 std::string charKey = "";
391 int32_t ret =
392 DistributedDeviceProfileServiceNew::GetInstance().DeleteCharacteristicProfile(devid, serName, charKey);
393 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
394 }
395
396 HWTEST_F(DpProfileServiceTest, PutLocalServiceInfo_001, TestSize.Level1)
397 {
398 LocalServiceInfo localServiceInfo;
399 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().PutLocalServiceInfo(localServiceInfo);
400 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
401 }
402
403 HWTEST_F(DpProfileServiceTest, UpdateLocalServiceInfo_001, TestSize.Level1)
404 {
405 LocalServiceInfo localServiceInfo;
406 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().UpdateLocalServiceInfo(localServiceInfo);
407 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
408 }
409
410 HWTEST_F(DpProfileServiceTest, GetLocalServiceInfoByBundleAndPinType_001, TestSize.Level1)
411 {
412 std::string bundleName;
413 int32_t pinExchangeType = 0;
414 LocalServiceInfo localServiceInfo;
415 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().GetLocalServiceInfoByBundleAndPinType(
416 bundleName, pinExchangeType, localServiceInfo);
417 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
418 }
419
420 HWTEST_F(DpProfileServiceTest, DeleteLocalServiceInfo_001, TestSize.Level1)
421 {
422 std::string bundleName;
423 int32_t pinExchangeType = 0;
424 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().DeleteLocalServiceInfo(bundleName, pinExchangeType);
425 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
426 }
427
428 HWTEST_F(DpProfileServiceTest, SubscribeDeviceProfile_001, TestSize.Level1)
429 {
430 SubscribeInfo subscriberInfo;
431 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().SubscribeDeviceProfile(subscriberInfo);
432 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
433 }
434
435 HWTEST_F(DpProfileServiceTest, UnSubscribeDeviceProfile_001, TestSize.Level1)
436 {
437 SubscribeInfo subscriberInfo;
438 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().UnSubscribeDeviceProfile(subscriberInfo);
439 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
440 }
441
442 HWTEST_F(DpProfileServiceTest, SyncDeviceProfile_001, TestSize.Level1)
443 {
444 DistributedDeviceProfile::DpSyncOptions syncOptions;
445 sptr<IRemoteObject> syncCallback = nullptr;
446 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().SyncDeviceProfile(syncOptions, syncCallback);
447 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
448 }
449
450 HWTEST_F(DpProfileServiceTest, Dump_001, TestSize.Level1)
451 {
452 int32_t fd = -1;
453 std::vector<std::u16string> args;
454 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().Dump(fd, args);
455 EXPECT_EQ(DP_INVALID_PARAMS, ret);
456 }
457
458 HWTEST_F(DpProfileServiceTest, SubscribeDeviceProfileInited_001, TestSize.Level1)
459 {
460 int32_t saId = 1000;
461 OHOS::sptr<IRemoteObject> initedCb = sptr<IRemoteObject>(new DpInitedCallback());
462 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().SubscribeDeviceProfileInited(saId, initedCb);
463 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
464 }
465
466 HWTEST_F(DpProfileServiceTest, UnSubscribeDeviceProfileInited_001, TestSize.Level1)
467 {
468 int32_t saId = 1000;
469 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().UnSubscribeDeviceProfileInited(saId);
470 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
471 }
472
473 HWTEST_F(DpProfileServiceTest, SubscribePinCodeInvalid_001, TestSize.Level1)
474 {
475 SystemAbilityOnDemandReason startReason;
476 DistributedDeviceProfileServiceNew::GetInstance().OnStart(startReason);
477 DistributedDeviceProfileServiceNew::GetInstance().OnStop();
478 std::string bundleName;
479 int32_t pinExchangeType = 0;
480 sptr<IRemoteObject> pinCodeCallback;
481 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().SubscribePinCodeInvalid(
482 bundleName, pinExchangeType, pinCodeCallback);
483 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
484 }
485
486 HWTEST_F(DpProfileServiceTest, UnSubscribePinCodeInvalid_001, TestSize.Level1)
487 {
488 std::string bundleName;
489 int32_t pinExchangeType = 0;
490 int32_t ret =
491 DistributedDeviceProfileServiceNew::GetInstance().UnSubscribePinCodeInvalid(bundleName, pinExchangeType);
492 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
493 }
494
495 HWTEST_F(DpProfileServiceTest, NotifyPinCodeInvalid_001, TestSize.Level1)
496 {
497 LocalServiceInfo localServiceInfo;
498 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().NotifyPinCodeInvalid(localServiceInfo);
499 EXPECT_EQ(DP_SUCCESS, ret);
500 }
501
502 HWTEST_F(DpProfileServiceTest, NotifyPinCodeInvalid_002, TestSize.Level1)
503 {
504 LocalServiceInfo localServiceInfo;
505 localServiceInfo.SetBundleName("aaa");
506 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().NotifyPinCodeInvalid(localServiceInfo);
507 EXPECT_EQ(0, ret);
508 }
509
510 HWTEST_F(DpProfileServiceTest, PutAllTrustedDevices_001, TestSize.Level1)
511 {
512 std::vector<TrustedDeviceInfo> deviceInfos;
513 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().PutAllTrustedDevices(deviceInfos);
514 EXPECT_EQ(DP_PERMISSION_DENIED, ret);
515 }
516
517 HWTEST_F(DpProfileServiceTest, UnInitNext_001, TestSize.Level1)
518 {
519 int32_t ret = DistributedDeviceProfileServiceNew::GetInstance().UnInitNext();
520 EXPECT_EQ(DP_SUCCESS, ret);
521 }
522 }
523 }
524