1 /*
2 * Copyright (C) 2023 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 "ril_network_test.h"
17 #include "ril_test_util.h"
18
19 namespace OHOS {
20 namespace Telephony {
21 using namespace OHOS::HDI::Ril::V1_2;
22 using namespace testing::ext;
23 namespace {
24 sptr<OHOS::HDI::Ril::V1_2::IRil> g_rilInterface = nullptr;
25 }
26
SetUpTestCase()27 void RILNetworkTest::SetUpTestCase()
28 {
29 TELEPHONY_LOGI("----------RilCallTest gtest start ------------");
30 RilTestUtil::GetInstance().Init();
31 g_rilInterface = RilTestUtil::GetRilInterface();
32 }
33
TearDownTestCase()34 void RILNetworkTest::TearDownTestCase() {}
35
SetUp()36 void RILNetworkTest::SetUp() {}
37
TearDown()38 void RILNetworkTest::TearDown() {}
39
40 /**
41 * @tc.number Telephony_DriverSystem_GetSignalStrength_V1_0100
42 * @tc.name Get signal strength
43 * @tc.desc Function test
44 */
45 HWTEST_F(RILNetworkTest, Telephony_DriverSystem_GetSignalStrength_V1_0100, Function | MediumTest | Level3)
46 {
47 if (!RilTestUtil::IsReady(SLOTID_1)) {
48 return;
49 }
50 int32_t ret = g_rilInterface->GetSignalStrength(SLOTID_1, RilTestUtil::GetSerialId());
51 RilTestUtil::WaitFor(WAIT_TIME_SECOND);
52 EXPECT_EQ(SUCCESS, ret);
53 ASSERT_TRUE(RilTestUtil::GetBoolResult(HdiId::HREQ_NETWORK_GET_SIGNAL_STRENGTH));
54 }
55
56 /**
57 * @tc.number Telephony_DriverSystem_GetSignalStrength_V1_0200
58 * @tc.name Get signal strength
59 * @tc.desc Function test
60 */
61 HWTEST_F(RILNetworkTest, Telephony_DriverSystem_GetSignalStrength_V1_0200, Function | MediumTest | Level3)
62 {
63 if (!RilTestUtil::IsReady(SLOTID_2)) {
64 return;
65 }
66 int32_t ret = g_rilInterface->GetSignalStrength(SLOTID_2, RilTestUtil::GetSerialId());
67 RilTestUtil::WaitFor(WAIT_TIME_SECOND);
68 EXPECT_EQ(SUCCESS, ret);
69 ASSERT_TRUE(RilTestUtil::GetBoolResult(HdiId::HREQ_NETWORK_GET_SIGNAL_STRENGTH));
70 }
71
72 /**
73 * @tc.number Telephony_DriverSystem_GetCsRegStatus_V1_0100
74 * @tc.name Get cs register status
75 * @tc.desc Function test
76 */
77 HWTEST_F(RILNetworkTest, Telephony_DriverSystem_GetCsRegStatus_V1_0100, Function | MediumTest | Level3)
78 {
79 if (!RilTestUtil::IsReady(SLOTID_1)) {
80 return;
81 }
82 int32_t ret = g_rilInterface->GetCsRegStatus(SLOTID_1, RilTestUtil::GetSerialId());
83 RilTestUtil::WaitFor(WAIT_TIME_SECOND);
84 EXPECT_EQ(SUCCESS, ret);
85 ASSERT_TRUE(RilTestUtil::GetBoolResult(HdiId::HREQ_NETWORK_GET_CS_REG_STATUS));
86 }
87
88 /**
89 * @tc.number Telephony_DriverSystem_GetCsRegStatus_V1_0200
90 * @tc.name Get cs register status
91 * @tc.desc Function test
92 */
93 HWTEST_F(RILNetworkTest, Telephony_DriverSystem_GetCsRegStatus_V1_0200, Function | MediumTest | Level3)
94 {
95 if (!RilTestUtil::IsReady(SLOTID_2)) {
96 return;
97 }
98 int32_t ret = g_rilInterface->GetCsRegStatus(SLOTID_2, RilTestUtil::GetSerialId());
99 RilTestUtil::WaitFor(WAIT_TIME_SECOND);
100 EXPECT_EQ(SUCCESS, ret);
101 ASSERT_TRUE(RilTestUtil::GetBoolResult(HdiId::HREQ_NETWORK_GET_CS_REG_STATUS));
102 }
103
104 /**
105 * @tc.number Telephony_DriverSystem_GetPsRegStatus_V1_0100
106 * @tc.name Get ps register status
107 * @tc.desc Function test
108 */
109 HWTEST_F(RILNetworkTest, Telephony_DriverSystem_GetPsRegStatus_V1_0100, Function | MediumTest | Level3)
110 {
111 if (!RilTestUtil::IsReady(SLOTID_1)) {
112 return;
113 }
114 int32_t ret = g_rilInterface->GetPsRegStatus(SLOTID_1, RilTestUtil::GetSerialId());
115 RilTestUtil::WaitFor(WAIT_TIME_SECOND);
116 EXPECT_EQ(SUCCESS, ret);
117 ASSERT_TRUE(RilTestUtil::GetBoolResult(HdiId::HREQ_NETWORK_GET_PS_REG_STATUS));
118 }
119
120 /**
121 * @tc.number Telephony_DriverSystem_GetPsRegStatus_V1_0200
122 * @tc.name Get ps register status
123 * @tc.desc Function test
124 */
125 HWTEST_F(RILNetworkTest, Telephony_DriverSystem_GetPsRegStatus_V1_0200, Function | MediumTest | Level3)
126 {
127 if (!RilTestUtil::IsReady(SLOTID_2)) {
128 return;
129 }
130 int32_t ret = g_rilInterface->GetPsRegStatus(SLOTID_2, RilTestUtil::GetSerialId());
131 RilTestUtil::WaitFor(WAIT_TIME_SECOND);
132 EXPECT_EQ(SUCCESS, ret);
133 ASSERT_TRUE(RilTestUtil::GetBoolResult(HdiId::HREQ_NETWORK_GET_PS_REG_STATUS));
134 }
135
136 /**
137 * @tc.number Telephony_DriverSystem_GetOperatorInfo_V1_0100
138 * @tc.name Get operator info
139 * @tc.desc Function test
140 */
141 HWTEST_F(RILNetworkTest, Telephony_DriverSystem_GetOperatorInfo_V1_0100, Function | MediumTest | Level3)
142 {
143 if (!RilTestUtil::IsReady(SLOTID_1)) {
144 return;
145 }
146 int32_t ret = g_rilInterface->GetOperatorInfo(SLOTID_1, RilTestUtil::GetSerialId());
147 RilTestUtil::WaitFor(WAIT_TIME_SECOND);
148 EXPECT_EQ(SUCCESS, ret);
149 ASSERT_TRUE(RilTestUtil::GetBoolResult(HdiId::HREQ_NETWORK_GET_OPERATOR_INFO));
150 }
151
152 /**
153 * @tc.number Telephony_DriverSystem_GetOperatorInfo_V1_0200
154 * @tc.name Get operator info
155 * @tc.desc Function test
156 */
157 HWTEST_F(RILNetworkTest, Telephony_DriverSystem_GetOperatorInfo_V1_0200, Function | MediumTest | Level3)
158 {
159 if (!RilTestUtil::IsReady(SLOTID_2)) {
160 return;
161 }
162 int32_t ret = g_rilInterface->GetOperatorInfo(SLOTID_2, RilTestUtil::GetSerialId());
163 RilTestUtil::WaitFor(WAIT_TIME_SECOND);
164 EXPECT_EQ(SUCCESS, ret);
165 ASSERT_TRUE(RilTestUtil::GetBoolResult(HdiId::HREQ_NETWORK_GET_OPERATOR_INFO));
166 }
167
168 /**
169 * @tc.number Telephony_DriverSystem_GetNetworkSearchInformation_V1_0100
170 * @tc.name Get network search information
171 * @tc.desc Function test
172 */
173 HWTEST_F(RILNetworkTest, Telephony_DriverSystem_GetNetworkSearchInformation_V1_0100, Function | MediumTest | Level3)
174 {
175 if (!RilTestUtil::IsReady(SLOTID_1)) {
176 return;
177 }
178 int32_t ret = g_rilInterface->GetNetworkSearchInformation(SLOTID_1, RilTestUtil::GetSerialId());
179 RilTestUtil::WaitFor(WAIT_TIME_SECOND);
180 EXPECT_EQ(SUCCESS, ret);
181 ASSERT_TRUE(RilTestUtil::GetBoolResult(HdiId::HREQ_NETWORK_GET_NETWORK_SEARCH_INFORMATION));
182 }
183
184 /**
185 * @tc.number Telephony_DriverSystem_GetNetworkSearchInformation_V1_0200
186 * @tc.name Get network search information
187 * @tc.desc Function test
188 */
189 HWTEST_F(RILNetworkTest, Telephony_DriverSystem_GetNetworkSearchInformation_V1_0200, Function | MediumTest | Level3)
190 {
191 if (!RilTestUtil::IsReady(SLOTID_2)) {
192 return;
193 }
194 int32_t ret = g_rilInterface->GetNetworkSearchInformation(SLOTID_2, RilTestUtil::GetSerialId());
195 RilTestUtil::WaitFor(WAIT_TIME_SECOND);
196 EXPECT_EQ(SUCCESS, ret);
197 ASSERT_TRUE(RilTestUtil::GetBoolResult(HdiId::HREQ_NETWORK_GET_NETWORK_SEARCH_INFORMATION));
198 }
199
200 /**
201 * @tc.number Telephony_DriverSystem_GetNetworkSelectionMode_V1_0100
202 * @tc.name Get network search selection mode
203 * @tc.desc Function test
204 */
205 HWTEST_F(RILNetworkTest, Telephony_DriverSystem_GetNetworkSelectionMode_V1_0100, Function | MediumTest | Level3)
206 {
207 if (!RilTestUtil::IsReady(SLOTID_1)) {
208 return;
209 }
210 int32_t ret = g_rilInterface->GetNetworkSelectionMode(SLOTID_1, RilTestUtil::GetSerialId());
211 RilTestUtil::WaitFor(WAIT_TIME_SECOND);
212 EXPECT_EQ(SUCCESS, ret);
213 ASSERT_TRUE(RilTestUtil::GetBoolResult(HdiId::HREQ_NETWORK_GET_NETWORK_SELECTION_MODE));
214 }
215
216 /**
217 * @tc.number Telephony_DriverSystem_GetNetworkSelectionMode_V1_0200
218 * @tc.name Get network search selection mode
219 * @tc.desc Function test
220 */
221 HWTEST_F(RILNetworkTest, Telephony_DriverSystem_GetNetworkSelectionMode_V1_0200, Function | MediumTest | Level3)
222 {
223 if (!RilTestUtil::IsReady(SLOTID_2)) {
224 return;
225 }
226 int32_t ret = g_rilInterface->GetNetworkSelectionMode(SLOTID_2, RilTestUtil::GetSerialId());
227 RilTestUtil::WaitFor(WAIT_TIME_SECOND);
228 EXPECT_EQ(SUCCESS, ret);
229 ASSERT_TRUE(RilTestUtil::GetBoolResult(HdiId::HREQ_NETWORK_GET_NETWORK_SELECTION_MODE));
230 }
231
232 /**
233 * @tc.number Telephony_DriverSystem_SetNetworkSelectionMode_V1_0100
234 * @tc.name Set network search selection mode
235 * @tc.desc Function test
236 */
237 HWTEST_F(RILNetworkTest, Telephony_DriverSystem_SetNetworkSelectionMode_V1_0100, Function | MediumTest | Level3)
238 {
239 if (!RilTestUtil::IsReady(SLOTID_1)) {
240 return;
241 }
242 SetNetworkModeInfo setNetworkModeInfo;
243 setNetworkModeInfo.selectMode = static_cast<int32_t>(SelectionMode::MODE_TYPE_AUTO);
244 setNetworkModeInfo.oper = "46000";
245 int32_t ret = g_rilInterface->SetNetworkSelectionMode(SLOTID_1, RilTestUtil::GetSerialId(), setNetworkModeInfo);
246 RilTestUtil::WaitFor(WAIT_TIME_SECOND);
247 EXPECT_EQ(SUCCESS, ret);
248 ASSERT_TRUE(RilTestUtil::GetBoolResult(HdiId::HREQ_NETWORK_SET_NETWORK_SELECTION_MODE));
249 }
250
251 /**
252 * @tc.number Telephony_DriverSystem_SetNetworkSelectionMode_V1_0200
253 * @tc.name Set network search selection mode
254 * @tc.desc Function test
255 */
256 HWTEST_F(RILNetworkTest, Telephony_DriverSystem_SetNetworkSelectionMode_V1_0200, Function | MediumTest | Level3)
257 {
258 if (!RilTestUtil::IsReady(SLOTID_2)) {
259 return;
260 }
261 SetNetworkModeInfo setNetworkModeInfo;
262 setNetworkModeInfo.selectMode = static_cast<int32_t>(SelectionMode::MODE_TYPE_AUTO);
263 setNetworkModeInfo.oper = "46000";
264 int32_t ret = g_rilInterface->SetNetworkSelectionMode(SLOTID_2, RilTestUtil::GetSerialId(), setNetworkModeInfo);
265 RilTestUtil::WaitFor(WAIT_TIME_SECOND);
266 EXPECT_EQ(SUCCESS, ret);
267 ASSERT_TRUE(RilTestUtil::GetBoolResult(HdiId::HREQ_NETWORK_SET_NETWORK_SELECTION_MODE));
268 }
269
270 /**
271 * @tc.number Telephony_DriverSystem_SetPreferredNetwork_V1_0100
272 * @tc.name Set preferred network
273 * @tc.desc Function test
274 */
275 HWTEST_F(RILNetworkTest, Telephony_DriverSystem_SetPreferredNetwork_V1_0100, Function | MediumTest | Level3)
276 {
277 if (!RilTestUtil::IsReady(SLOTID_1)) {
278 return;
279 }
280 int32_t ret = g_rilInterface->SetPreferredNetwork(
281 SLOTID_1, RilTestUtil::GetSerialId(), static_cast<int32_t>(PreferredNetworkMode::CORE_NETWORK_MODE_LTE));
282 RilTestUtil::WaitFor(WAIT_TIME_SECOND);
283 EXPECT_EQ(SUCCESS, ret);
284 ASSERT_TRUE(RilTestUtil::GetBoolResult(HdiId::HREQ_NETWORK_SET_PREFERRED_NETWORK));
285 }
286
287 /**
288 * @tc.number Telephony_DriverSystem_SetPreferredNetwork_V1_0200
289 * @tc.name Set preferred network
290 * @tc.desc Function test
291 */
292 HWTEST_F(RILNetworkTest, Telephony_DriverSystem_SetPreferredNetwork_V1_0200, Function | MediumTest | Level3)
293 {
294 if (!RilTestUtil::IsReady(SLOTID_2)) {
295 return;
296 }
297 int32_t ret = g_rilInterface->SetPreferredNetwork(
298 SLOTID_2, RilTestUtil::GetSerialId(), static_cast<int32_t>(PreferredNetworkMode::CORE_NETWORK_MODE_LTE));
299 RilTestUtil::WaitFor(WAIT_TIME_SECOND);
300 EXPECT_EQ(SUCCESS, ret);
301 ASSERT_TRUE(RilTestUtil::GetBoolResult(HdiId::HREQ_NETWORK_SET_PREFERRED_NETWORK));
302 }
303
304 /**
305 * @tc.number Telephony_DriverSystem_GetPreferredNetwork_V1_0100
306 * @tc.name Get preferred network
307 * @tc.desc Function test
308 */
309 HWTEST_F(RILNetworkTest, Telephony_DriverSystem_GetPreferredNetwork_V1_0100, Function | MediumTest | Level3)
310 {
311 if (!RilTestUtil::IsReady(SLOTID_1)) {
312 return;
313 }
314 int32_t ret = g_rilInterface->GetPreferredNetwork(SLOTID_1, RilTestUtil::GetSerialId());
315 RilTestUtil::WaitFor(WAIT_TIME_SECOND);
316 EXPECT_EQ(SUCCESS, ret);
317 ASSERT_TRUE(RilTestUtil::GetBoolResult(HdiId::HREQ_NETWORK_GET_PREFERRED_NETWORK));
318 }
319
320 /**
321 * @tc.number Telephony_DriverSystem_GetPreferredNetwork_V1_0200
322 * @tc.name Get preferred network
323 * @tc.desc Function test
324 */
325 HWTEST_F(RILNetworkTest, Telephony_DriverSystem_GetPreferredNetwork_V1_0200, Function | MediumTest | Level3)
326 {
327 if (!RilTestUtil::IsReady(SLOTID_2)) {
328 return;
329 }
330 int32_t ret = g_rilInterface->GetPreferredNetwork(SLOTID_2, RilTestUtil::GetSerialId());
331 RilTestUtil::WaitFor(WAIT_TIME_SECOND);
332 EXPECT_EQ(SUCCESS, ret);
333 ASSERT_TRUE(RilTestUtil::GetBoolResult(HdiId::HREQ_NETWORK_GET_PREFERRED_NETWORK));
334 }
335
336 /**
337 * @tc.number Telephony_DriverSystem_GetCellInfoList_V1_0100
338 * @tc.name Get cell information list
339 * @tc.desc Function test
340 */
341 HWTEST_F(RILNetworkTest, Telephony_DriverSystem_GetCellInfoList_V1_0100, Function | MediumTest | Level3)
342 {
343 if (!RilTestUtil::IsReady(SLOTID_1)) {
344 return;
345 }
346 int32_t ret = g_rilInterface->GetNeighboringCellInfoList(SLOTID_1, RilTestUtil::GetSerialId());
347 RilTestUtil::WaitFor(WAIT_TIME_SECOND);
348 EXPECT_EQ(SUCCESS, ret);
349 ASSERT_TRUE(RilTestUtil::GetBoolResult(HdiId::HREQ_NETWORK_GET_NEIGHBORING_CELLINFO_LIST));
350 }
351
352 /**
353 * @tc.number Telephony_DriverSystem_GetCellInfoList_V1_0200
354 * @tc.name Get cell information list
355 * @tc.desc Function test
356 */
357 HWTEST_F(RILNetworkTest, Telephony_DriverSystem_GetCellInfoList_V1_0200, Function | MediumTest | Level3)
358 {
359 if (!RilTestUtil::IsReady(SLOTID_2)) {
360 return;
361 }
362 int32_t ret = g_rilInterface->GetNeighboringCellInfoList(SLOTID_2, RilTestUtil::GetSerialId());
363 RilTestUtil::WaitFor(WAIT_TIME_SECOND);
364 EXPECT_EQ(SUCCESS, ret);
365 ASSERT_TRUE(RilTestUtil::GetBoolResult(HdiId::HREQ_NETWORK_GET_NEIGHBORING_CELLINFO_LIST));
366 }
367
368 /**
369 * @tc.number Telephony_DriverSystem_GetCurrentCellInfo_V1_0100
370 * @tc.name Get current cell information
371 * @tc.desc Function test
372 */
373 HWTEST_F(RILNetworkTest, Telephony_DriverSystem_GetCurrentCellInfo_V1_0100, Function | MediumTest | Level3)
374 {
375 if (!RilTestUtil::IsReady(SLOTID_1)) {
376 return;
377 }
378 int32_t ret = g_rilInterface->GetCurrentCellInfo(SLOTID_1, RilTestUtil::GetSerialId());
379 RilTestUtil::WaitFor(WAIT_TIME_SECOND);
380 EXPECT_EQ(SUCCESS, ret);
381 ASSERT_TRUE(RilTestUtil::GetBoolResult(HdiId::HREQ_NETWORK_GET_CURRENT_CELL_INFO));
382 }
383
384 /**
385 * @tc.number Telephony_DriverSystem_GetCurrentCellInfo_V1_0200
386 * @tc.name Get current cell information
387 * @tc.desc Function test
388 */
389 HWTEST_F(RILNetworkTest, Telephony_DriverSystem_GetCurrentCellInfo_V1_0200, Function | MediumTest | Level3)
390 {
391 if (!RilTestUtil::IsReady(SLOTID_2)) {
392 return;
393 }
394 int32_t ret = g_rilInterface->GetCurrentCellInfo(SLOTID_2, RilTestUtil::GetSerialId());
395 RilTestUtil::WaitFor(WAIT_TIME_SECOND);
396 EXPECT_EQ(SUCCESS, ret);
397 ASSERT_TRUE(RilTestUtil::GetBoolResult(HdiId::HREQ_NETWORK_GET_CURRENT_CELL_INFO));
398 }
399
400 /**
401 * @tc.number Telephony_DriverSystem_GetPhysicalChannelConfig_V1_0100
402 * @tc.name Get physical channel config
403 * @tc.desc Function test
404 */
405 HWTEST_F(RILNetworkTest, Telephony_DriverSystem_GetPhysicalChannelConfig_V1_0100, Function | MediumTest | Level3)
406 {
407 if (!RilTestUtil::IsReady(SLOTID_1)) {
408 return;
409 }
410 int32_t ret = g_rilInterface->GetPhysicalChannelConfig(SLOTID_1, RilTestUtil::GetSerialId());
411 RilTestUtil::WaitFor(WAIT_TIME_SECOND);
412 EXPECT_EQ(SUCCESS, ret);
413 ASSERT_TRUE(RilTestUtil::GetBoolResult(HdiId::HREQ_NETWORK_GET_PHYSICAL_CHANNEL_CONFIG));
414 }
415
416 /**
417 * @tc.number Telephony_DriverSystem_GetPhysicalChannelConfig_V1_0200
418 * @tc.name Get physical channel config
419 * @tc.desc Function test
420 */
421 HWTEST_F(RILNetworkTest, Telephony_DriverSystem_GetPhysicalChannelConfig_V1_0200, Function | MediumTest | Level3)
422 {
423 if (!RilTestUtil::IsReady(SLOTID_2)) {
424 return;
425 }
426 int32_t ret = g_rilInterface->GetPhysicalChannelConfig(SLOTID_2, RilTestUtil::GetSerialId());
427 RilTestUtil::WaitFor(WAIT_TIME_SECOND);
428 EXPECT_EQ(SUCCESS, ret);
429 ASSERT_TRUE(RilTestUtil::GetBoolResult(HdiId::HREQ_NETWORK_GET_PHYSICAL_CHANNEL_CONFIG));
430 }
431
432 /**
433 * @tc.number Telephony_DriverSystem_SetLocateUpdates_V1_0100
434 * @tc.name Set locate updates
435 * @tc.desc Function test
436 */
437 HWTEST_F(RILNetworkTest, Telephony_DriverSystem_SetLocateUpdates_V1_0100, Function | MediumTest | Level3)
438 {
439 if (!RilTestUtil::IsReady(SLOTID_1)) {
440 return;
441 }
442 int32_t ret =
443 g_rilInterface->SetLocateUpdates(SLOTID_1, RilTestUtil::GetSerialId(),
444 RilRegNotifyMode::REG_NOTIFY_STAT_LAC_CELLID);
445 RilTestUtil::WaitFor(WAIT_TIME_SECOND);
446 EXPECT_EQ(SUCCESS, ret);
447 ASSERT_TRUE(RilTestUtil::GetBoolResult(HdiId::HREQ_NETWORK_SET_LOCATE_UPDATES));
448 }
449
450 /**
451 * @tc.number Telephony_DriverSystem_SetLocateUpdates_V1_0200
452 * @tc.name Set locate updates
453 * @tc.desc Function test
454 */
455 HWTEST_F(RILNetworkTest, Telephony_DriverSystem_SetLocateUpdates_V1_0200, Function | MediumTest | Level3)
456 {
457 if (!RilTestUtil::IsReady(SLOTID_2)) {
458 return;
459 }
460 int32_t ret =
461 g_rilInterface->SetLocateUpdates(SLOTID_2, RilTestUtil::GetSerialId(),
462 RilRegNotifyMode::REG_NOTIFY_STAT_LAC_CELLID);
463 RilTestUtil::WaitFor(WAIT_TIME_SECOND);
464 EXPECT_EQ(SUCCESS, ret);
465 ASSERT_TRUE(RilTestUtil::GetBoolResult(HdiId::HREQ_NETWORK_SET_LOCATE_UPDATES));
466 }
467
468 /**
469 * @tc.number Telephony_DriverSystem_SetNotificationFilter_V1_0100
470 * @tc.name SetNotificationFilter
471 * @tc.desc Function test
472 */
473 HWTEST_F(RILNetworkTest, Telephony_DriverSystem_SetNotificationFilter_V1_0100, Function | MediumTest | Level3)
474 {
475 if (!RilTestUtil::IsReady(SLOTID_1)) {
476 return;
477 }
478 int32_t ret = g_rilInterface->SetNotificationFilter(
479 SLOTID_1, RilTestUtil::GetSerialId(), static_cast<int32_t>(NotificationFilter::NOTIFICATION_FILTER_ALL));
480 RilTestUtil::WaitFor(WAIT_TIME_SECOND);
481 EXPECT_EQ(SUCCESS, ret);
482 ASSERT_TRUE(RilTestUtil::GetBoolResult(HdiId::HREQ_NETWORK_SET_NOTIFICATION_FILTER));
483 }
484
485 /**
486 * @tc.number Telephony_DriverSystem_SetNotificationFilter_V1_0200
487 * @tc.name SetNotificationFilter
488 * @tc.desc Function test
489 */
490 HWTEST_F(RILNetworkTest, Telephony_DriverSystem_SetNotificationFilter_V1_0200, Function | MediumTest | Level3)
491 {
492 if (!RilTestUtil::IsReady(SLOTID_2)) {
493 return;
494 }
495 int32_t ret = g_rilInterface->SetNotificationFilter(
496 SLOTID_2, RilTestUtil::GetSerialId(), static_cast<int32_t>(NotificationFilter::NOTIFICATION_FILTER_ALL));
497 RilTestUtil::WaitFor(WAIT_TIME_SECOND);
498 EXPECT_EQ(SUCCESS, ret);
499 ASSERT_TRUE(RilTestUtil::GetBoolResult(HdiId::HREQ_NETWORK_SET_NOTIFICATION_FILTER));
500 }
501
502 /**
503 * @tc.number Telephony_DriverSystem_SetDeviceState_V1_0100
504 * @tc.name Set device state
505 * @tc.desc Function test
506 */
507 HWTEST_F(RILNetworkTest, Telephony_DriverSystem_SetDeviceState_V1_0100, Function | MediumTest | Level3)
508 {
509 if (!RilTestUtil::IsReady(SLOTID_1)) {
510 return;
511 }
512 int32_t ret = g_rilInterface->SetDeviceState(
513 SLOTID_1, RilTestUtil::GetSerialId(), static_cast<int32_t>(DeviceStateType::LOW_DATA_STATE), 0);
514 RilTestUtil::WaitFor(WAIT_TIME_SECOND);
515 EXPECT_EQ(SUCCESS, ret);
516 ASSERT_TRUE(RilTestUtil::GetBoolResult(HdiId::HREQ_NETWORK_SET_DEVICE_STATE));
517 }
518
519 /**
520 * @tc.number Telephony_DriverSystem_SetDeviceState_V1_0200
521 * @tc.name Set device state
522 * @tc.desc Function test
523 */
524 HWTEST_F(RILNetworkTest, Telephony_DriverSystem_SetDeviceState_V1_0200, Function | MediumTest | Level3)
525 {
526 if (!RilTestUtil::IsReady(SLOTID_2)) {
527 return;
528 }
529 int32_t ret = g_rilInterface->SetDeviceState(
530 SLOTID_2, RilTestUtil::GetSerialId(), static_cast<int32_t>(DeviceStateType::LOW_DATA_STATE), 0);
531 RilTestUtil::WaitFor(WAIT_TIME_SECOND);
532 EXPECT_EQ(SUCCESS, ret);
533 ASSERT_TRUE(RilTestUtil::GetBoolResult(HdiId::HREQ_NETWORK_SET_DEVICE_STATE));
534 }
535
536 /**
537 * @tc.number Telephony_DriverSystem_SetNrOptionMode_V1_0100
538 * @tc.name Set the option mode of NR.
539 * @tc.desc Function test
540 */
541 HWTEST_F(RILNetworkTest, Telephony_DriverSystem_SetNrOptionMode_V1_0100, Function | MediumTest | Level3)
542 {
543 if (!RilTestUtil::IsReady(SLOTID_1)) {
544 return;
545 }
546 int32_t ret = g_rilInterface->SetNrOptionMode(SLOTID_1, RilTestUtil::GetSerialId(), NR_OPTION_NSA_ONLY);
547 RilTestUtil::WaitFor(WAIT_TIME_SECOND);
548 EXPECT_EQ(SUCCESS, ret);
549 ASSERT_TRUE(RilTestUtil::GetBoolResult(HdiId::HREQ_NETWORK_SET_NR_OPTION_MODE));
550 }
551
552 /**
553 * @tc.number Telephony_DriverSystem_SetNrOptionMode_V1_0200
554 * @tc.name Set the option mode of NR.
555 * @tc.desc Function test
556 */
557 HWTEST_F(RILNetworkTest, Telephony_DriverSystem_SetNrOptionMode_V1_0200, Function | MediumTest | Level3)
558 {
559 if (!RilTestUtil::IsReady(SLOTID_2)) {
560 return;
561 }
562 int32_t ret = g_rilInterface->SetNrOptionMode(SLOTID_2, RilTestUtil::GetSerialId(), NR_OPTION_NSA_ONLY);
563 RilTestUtil::WaitFor(WAIT_TIME_SECOND);
564 EXPECT_EQ(SUCCESS, ret);
565 ASSERT_TRUE(RilTestUtil::GetBoolResult(HdiId::HREQ_NETWORK_SET_NR_OPTION_MODE));
566 }
567
568 /**
569 * @tc.number Telephony_DriverSystem_GetNrOptionMode_V1_0100
570 * @tc.name Get the option mode of NR.
571 * @tc.desc Function test
572 */
573 HWTEST_F(RILNetworkTest, Telephony_DriverSystem_GetNrOptionMode_V1_0100, Function | MediumTest | Level3)
574 {
575 if (!RilTestUtil::IsReady(SLOTID_1)) {
576 return;
577 }
578 int32_t ret = g_rilInterface->GetNrOptionMode(SLOTID_1, RilTestUtil::GetSerialId());
579 RilTestUtil::WaitFor(WAIT_TIME_SECOND);
580 EXPECT_EQ(SUCCESS, ret);
581 ASSERT_TRUE(RilTestUtil::GetBoolResult(HdiId::HREQ_NETWORK_GET_NR_OPTION_MODE));
582 }
583
584 /**
585 * @tc.number Telephony_DriverSystem_GetNrOptionMode_V1_0200
586 * @tc.name Get the option mode of NR.
587 * @tc.desc Function test
588 */
589 HWTEST_F(RILNetworkTest, Telephony_DriverSystem_GetNrOptionMode_V1_0200, Function | MediumTest | Level3)
590 {
591 if (!RilTestUtil::IsReady(SLOTID_2)) {
592 return;
593 }
594 int32_t ret = g_rilInterface->GetNrOptionMode(SLOTID_2, RilTestUtil::GetSerialId());
595 RilTestUtil::WaitFor(WAIT_TIME_SECOND);
596 EXPECT_EQ(SUCCESS, ret);
597 ASSERT_TRUE(RilTestUtil::GetBoolResult(HdiId::HREQ_NETWORK_GET_NR_OPTION_MODE));
598 }
599
600 /**
601 * @tc.number Telephony_DriverSystem_GetRrcConnectionState_V1_0100
602 * @tc.name Get the rrc connection state
603 * @tc.desc Function test
604 */
605 HWTEST_F(RILNetworkTest, Telephony_DriverSystem_GetRrcConnectionState_V1_0100, Function | MediumTest | Level3)
606 {
607 if (!RilTestUtil::IsReady(SLOTID_1)) {
608 return;
609 }
610 int32_t ret = g_rilInterface->GetRrcConnectionState(SLOTID_1, RilTestUtil::GetSerialId());
611 RilTestUtil::WaitFor(WAIT_TIME_SECOND);
612 EXPECT_EQ(SUCCESS, ret);
613 ASSERT_TRUE(RilTestUtil::GetBoolResult(HdiId::HREQ_NETWORK_GET_RRC_CONNECTION_STATE));
614 }
615
616 /**
617 * @tc.number Telephony_DriverSystem_GetRrcConnectionState_V1_0200
618 * @tc.name Get the rrc connection state
619 * @tc.desc Function test
620 */
621 HWTEST_F(RILNetworkTest, Telephony_DriverSystem_GetRrcConnectionState_V1_0200, Function | MediumTest | Level3)
622 {
623 if (!RilTestUtil::IsReady(SLOTID_2)) {
624 return;
625 }
626 int32_t ret = g_rilInterface->GetRrcConnectionState(SLOTID_2, RilTestUtil::GetSerialId());
627 RilTestUtil::WaitFor(WAIT_TIME_SECOND);
628 EXPECT_EQ(SUCCESS, ret);
629 ASSERT_TRUE(RilTestUtil::GetBoolResult(HdiId::HREQ_NETWORK_GET_RRC_CONNECTION_STATE));
630 }
631
632 /**
633 * @tc.number Telephony_DriverSystem_GetNrSsbId_V1_0100
634 * @tc.name Get the nr ssb Id information
635 * @tc.desc Function test
636 */
637 HWTEST_F(RILNetworkTest, Telephony_DriverSystem_GetNrSsbId_V1_0100, Function | MediumTest | Level3)
638 {
639 if (!RilTestUtil::IsReady(SLOTID_1)) {
640 return;
641 }
642 int32_t ret = g_rilInterface->GetNrSsbId(SLOTID_1, RilTestUtil::GetSerialId());
643 RilTestUtil::WaitFor(WAIT_TIME_SECOND);
644 EXPECT_EQ(SUCCESS, ret);
645 ASSERT_TRUE(RilTestUtil::GetBoolResult(HdiId::HREQ_NETWORK_GET_NR_SSBID_INFO));
646 }
647
648 /**
649 * @tc.number Telephony_DriverSystem_GetNrSsbId_V1_0200
650 * @tc.name Get the nr ssb Id information
651 * @tc.desc Function test
652 */
653 HWTEST_F(RILNetworkTest, Telephony_DriverSystem_GetNrSsbId_V1_0200, Function | MediumTest | Level3)
654 {
655 if (!RilTestUtil::IsReady(SLOTID_2)) {
656 return;
657 }
658 int32_t ret = g_rilInterface->GetNrSsbId(SLOTID_2, RilTestUtil::GetSerialId());
659 RilTestUtil::WaitFor(WAIT_TIME_SECOND);
660 EXPECT_EQ(SUCCESS, ret);
661 ASSERT_TRUE(RilTestUtil::GetBoolResult(HdiId::HREQ_NETWORK_GET_NR_SSBID_INFO));
662 }
663 } // namespace Telephony
664 } // namespace OHOS
665