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