blob: 1dc5373e673a2d40ebf5188dab4c8290c111a8fe [file] [log] [blame]
Betty Zhou59f18532017-05-01 15:06:11 -07001#!/usr/bin/env python3.4
2#
3# Copyright 2017 - Google
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16"""
17 Test Script for Telephony Stress Call Test
18"""
19
20import collections
Betty Zhou9aa68ad2018-01-12 12:39:23 -080021import json
22import os
Betty Zhou59f18532017-05-01 15:06:11 -070023import random
24import time
Betty Zhou53f1d0e2018-01-26 20:08:27 -080025
Betty Zhou3468a8b2018-02-14 14:34:56 -080026from acts import utils
Betty Zhou49744692018-04-24 11:00:38 -070027from acts.libs.proc import job
Betty Zhoucf456cf2017-05-10 19:15:09 -070028from acts.test_decorators import test_tracker_info
Betty Zhou59f18532017-05-01 15:06:11 -070029from acts.test_utils.tel.TelephonyBaseTest import TelephonyBaseTest
Betty Zhou1ffbc832018-05-08 19:02:56 -070030from acts.test_utils.tel.tel_defines import INCALL_UI_DISPLAY_BACKGROUND
Betty Zhou632793c2018-02-09 18:45:39 -080031from acts.test_utils.tel.tel_defines import MAX_WAIT_TIME_SMS_RECEIVE
Jaineelcd748202017-08-10 12:23:42 -070032from acts.test_utils.tel.tel_defines import NETWORK_MODE_WCDMA_ONLY
33from acts.test_utils.tel.tel_defines import NETWORK_MODE_GLOBAL
34from acts.test_utils.tel.tel_defines import NETWORK_MODE_CDMA
35from acts.test_utils.tel.tel_defines import NETWORK_MODE_GSM_ONLY
36from acts.test_utils.tel.tel_defines import NETWORK_MODE_TDSCDMA_GSM_WCDMA
37from acts.test_utils.tel.tel_defines import NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA
38from acts.test_utils.tel.tel_defines import WAIT_TIME_AFTER_MODE_CHANGE
Betty Zhou632793c2018-02-09 18:45:39 -080039from acts.test_utils.tel.tel_defines import WFC_MODE_WIFI_PREFERRED
Betty Zhouc86784b2018-02-28 16:42:53 -080040from acts.test_utils.tel.tel_test_utils import STORY_LINE
Betty Zhou86671922017-05-10 15:32:10 -070041from acts.test_utils.tel.tel_test_utils import active_file_download_test
Betty Zhou5e3f68a2017-12-14 15:50:47 -080042from acts.test_utils.tel.tel_test_utils import is_phone_in_call
Betty Zhou59f18532017-05-01 15:06:11 -070043from acts.test_utils.tel.tel_test_utils import call_setup_teardown
Betty Zhou59f18532017-05-01 15:06:11 -070044from acts.test_utils.tel.tel_test_utils import ensure_wifi_connected
45from acts.test_utils.tel.tel_test_utils import hangup_call
Betty Zhoucbda4122018-01-16 19:15:42 -080046from acts.test_utils.tel.tel_test_utils import hangup_call_by_adb
Betty Zhou377f72b2018-01-12 19:43:26 -080047from acts.test_utils.tel.tel_test_utils import initiate_call
Betty Zhou16e8e662018-05-08 18:26:18 -070048from acts.test_utils.tel.tel_test_utils import last_call_drop_reason
Betty Zhou59f18532017-05-01 15:06:11 -070049from acts.test_utils.tel.tel_test_utils import run_multithread_func
50from acts.test_utils.tel.tel_test_utils import set_wfc_mode
51from acts.test_utils.tel.tel_test_utils import sms_send_receive_verify
Betty Zhou550fd372017-10-16 17:22:47 -070052from acts.test_utils.tel.tel_test_utils import start_qxdm_loggers
Betty Zhou2bb11682018-04-19 17:05:30 -070053from acts.test_utils.tel.tel_test_utils import start_tcpdumps
Betty Zhou59f18532017-05-01 15:06:11 -070054from acts.test_utils.tel.tel_test_utils import mms_send_receive_verify
Jaineelcd748202017-08-10 12:23:42 -070055from acts.test_utils.tel.tel_test_utils import set_preferred_network_mode_pref
Betty Zhoufe64cd82018-03-26 14:14:07 -070056from acts.test_utils.tel.tel_test_utils import verify_internet_connection
Betty Zhoucf048542018-02-22 17:14:08 -080057from acts.test_utils.tel.tel_test_utils import wait_for_in_call_active
Betty Zhou59f18532017-05-01 15:06:11 -070058from acts.test_utils.tel.tel_voice_utils import is_phone_in_call_3g
59from acts.test_utils.tel.tel_voice_utils import is_phone_in_call_2g
60from acts.test_utils.tel.tel_voice_utils import is_phone_in_call_csfb
61from acts.test_utils.tel.tel_voice_utils import is_phone_in_call_iwlan
62from acts.test_utils.tel.tel_voice_utils import is_phone_in_call_volte
63from acts.test_utils.tel.tel_voice_utils import phone_setup_csfb
Betty Zhou042a56e2018-03-30 17:18:04 -070064from acts.test_utils.tel.tel_voice_utils import phone_setup_iwlan
Betty Zhou59f18532017-05-01 15:06:11 -070065from acts.test_utils.tel.tel_voice_utils import phone_setup_voice_3g
66from acts.test_utils.tel.tel_voice_utils import phone_setup_voice_2g
67from acts.test_utils.tel.tel_voice_utils import phone_setup_volte
Jaineel65ebd262017-07-20 11:40:17 -070068from acts.test_utils.tel.tel_voice_utils import phone_idle_iwlan
Jaineelcd748202017-08-10 12:23:42 -070069from acts.test_utils.tel.tel_voice_utils import get_current_voice_rat
Betty Zhou7b9dd3d2017-07-14 18:57:06 -070070from acts.utils import get_current_epoch_time
Betty Zhou59f18532017-05-01 15:06:11 -070071from acts.utils import rand_ascii_str
Betty Zhoub2d1c6d2017-07-17 11:40:27 -070072
Betty Zhoucf048542018-02-22 17:14:08 -080073EXCEPTION_TOLERANCE = 5
Betty Zhoue57ab692018-03-09 18:39:30 -080074BINDER_LOGS = ["/sys/kernel/debug/binder"]
Betty Zhou59f18532017-05-01 15:06:11 -070075
76
77class TelLiveStressTest(TelephonyBaseTest):
78 def setup_class(self):
79 super(TelLiveStressTest, self).setup_class()
80 self.dut = self.android_devices[0]
Betty Zhouc6685ad2018-02-21 18:33:38 -080081 self.single_phone_test = self.user_params.get("single_phone_test",
82 False)
Betty Zhouc133f8c2018-03-02 15:40:13 -080083 # supported file download methods: chrome, sl4a, curl
84 self.file_download_method = self.user_params.get(
Betty Zhoue57ab692018-03-09 18:39:30 -080085 "file_download_method", "curl")
Betty Zhou4bc31fc2018-03-12 18:28:50 -070086 self.get_binder_logs = self.user_params.get("get_binder_logs", False)
Betty Zhou377f72b2018-01-12 19:43:26 -080087 if len(self.android_devices) == 1:
88 self.single_phone_test = True
89 if self.single_phone_test:
90 self.android_devices = self.android_devices[:1]
91 self.call_server_number = self.user_params.get(
Betty Zhouc86784b2018-02-28 16:42:53 -080092 "call_server_number", STORY_LINE)
Betty Zhouc133f8c2018-03-02 15:40:13 -080093 if self.file_download_method == "sl4a":
94 # with single device, do not use sl4a file download
95 # due to stability issue
Betty Zhoue57ab692018-03-09 18:39:30 -080096 self.file_download_method = "curl"
Betty Zhou377f72b2018-01-12 19:43:26 -080097 else:
98 self.android_devices = self.android_devices[:2]
Betty Zhoufd85e392018-03-27 21:15:10 -070099 self.user_params["telephony_auto_rerun"] = 0
Betty Zhou59f18532017-05-01 15:06:11 -0700100 self.phone_call_iteration = int(
101 self.user_params.get("phone_call_iteration", 500))
102 self.max_phone_call_duration = int(
Betty Zhou93c0abb2017-11-14 19:32:17 -0800103 self.user_params.get("max_phone_call_duration", 600))
Jaineel7e50fee2017-10-27 11:02:42 -0700104 self.min_sleep_time = int(self.user_params.get("min_sleep_time", 10))
Betty Zhouc4dfad12018-04-11 18:36:49 -0700105 self.max_sleep_time = int(self.user_params.get("max_sleep_time", 60))
Betty Zhoucb2052e2017-10-10 17:46:55 -0700106 self.max_run_time = int(self.user_params.get("max_run_time", 14400))
Betty Zhou59f18532017-05-01 15:06:11 -0700107 self.max_sms_length = int(self.user_params.get("max_sms_length", 1000))
108 self.max_mms_length = int(self.user_params.get("max_mms_length", 160))
Betty Zhouf27f5482017-07-24 18:56:17 -0700109 self.min_sms_length = int(self.user_params.get("min_sms_length", 1))
110 self.min_mms_length = int(self.user_params.get("min_mms_length", 1))
111 self.min_phone_call_duration = int(
112 self.user_params.get("min_phone_call_duration", 10))
Betty Zhou56a54612017-05-09 18:54:45 -0700113 self.crash_check_interval = int(
114 self.user_params.get("crash_check_interval", 300))
Betty Zhou59f18532017-05-01 15:06:11 -0700115
116 return True
117
Betty Zhou61646502018-01-12 13:02:48 -0800118 def setup_test(self):
119 super(TelLiveStressTest, self).setup_test()
120 self.result_info = collections.defaultdict(int)
121 self._init_perf_json()
122
Betty Zhou103a9592017-10-20 18:57:16 -0700123 def on_fail(self, test_name, begin_time):
124 pass
125
Betty Zhou59f18532017-05-01 15:06:11 -0700126 def _setup_wfc(self):
127 for ad in self.android_devices:
128 if not ensure_wifi_connected(
Betty Zhou69c712b2017-05-23 19:28:23 -0700129 self.log,
Betty Zhou59f18532017-05-01 15:06:11 -0700130 ad,
131 self.wifi_network_ssid,
132 self.wifi_network_pass,
Jaineel65ebd262017-07-20 11:40:17 -0700133 retries=3):
Betty Zhou5dd53c02018-03-22 20:08:33 -0700134 ad.log.error("Bringing up Wifi connection fails.")
Betty Zhou59f18532017-05-01 15:06:11 -0700135 return False
136 ad.log.info("Phone WIFI is connected successfully.")
137 if not set_wfc_mode(self.log, ad, WFC_MODE_WIFI_PREFERRED):
138 ad.log.error("Phone failed to enable Wifi-Calling.")
139 return False
140 ad.log.info("Phone is set in Wifi-Calling successfully.")
Betty Zhou69c712b2017-05-23 19:28:23 -0700141 if not phone_idle_iwlan(self.log, ad):
Betty Zhou59f18532017-05-01 15:06:11 -0700142 ad.log.error("Phone is not in WFC enabled state.")
143 return False
144 ad.log.info("Phone is in WFC enabled state.")
145 return True
146
Betty Zhou042a56e2018-03-30 17:18:04 -0700147 def _setup_wfc_apm(self):
148 for ad in self.android_devices:
149 if not phone_setup_iwlan(
150 self.log, ad, True, WFC_MODE_WIFI_PREFERRED,
151 self.wifi_network_ssid, self.wifi_network_pass):
152 ad.log.error("Failed to setup WFC.")
153 return False
154 return True
155
Betty Zhou59f18532017-05-01 15:06:11 -0700156 def _setup_lte_volte_enabled(self):
157 for ad in self.android_devices:
158 if not phone_setup_volte(self.log, ad):
159 ad.log.error("Phone failed to enable VoLTE.")
160 return False
161 ad.log.info("Phone VOLTE is enabled successfully.")
162 return True
163
164 def _setup_lte_volte_disabled(self):
165 for ad in self.android_devices:
166 if not phone_setup_csfb(self.log, ad):
167 ad.log.error("Phone failed to setup CSFB.")
168 return False
169 ad.log.info("Phone VOLTE is disabled successfully.")
170 return True
171
172 def _setup_3g(self):
173 for ad in self.android_devices:
174 if not phone_setup_voice_3g(self.log, ad):
175 ad.log.error("Phone failed to setup 3g.")
176 return False
177 ad.log.info("Phone RAT 3G is enabled successfully.")
178 return True
179
180 def _setup_2g(self):
181 for ad in self.android_devices:
182 if not phone_setup_voice_2g(self.log, ad):
183 ad.log.error("Phone failed to setup 2g.")
184 return False
185 ad.log.info("RAT 2G is enabled successfully.")
186 return True
187
Betty Zhouc6685ad2018-02-21 18:33:38 -0800188 def _send_message(self, max_wait_time=2 * MAX_WAIT_TIME_SMS_RECEIVE):
Betty Zhou377f72b2018-01-12 19:43:26 -0800189 if self.single_phone_test:
190 ads = [self.dut, self.dut]
191 else:
192 ads = self.android_devices[:]
193 random.shuffle(ads)
Betty Zhou59f18532017-05-01 15:06:11 -0700194 selection = random.randrange(0, 2)
195 message_type_map = {0: "SMS", 1: "MMS"}
196 max_length_map = {0: self.max_sms_length, 1: self.max_mms_length}
Betty Zhouf27f5482017-07-24 18:56:17 -0700197 min_length_map = {0: self.min_sms_length, 1: self.min_mms_length}
198 length = random.randrange(min_length_map[selection],
199 max_length_map[selection] + 1)
Betty Zhou59f18532017-05-01 15:06:11 -0700200 message_func_map = {
201 0: sms_send_receive_verify,
202 1: mms_send_receive_verify
203 }
Betty Zhou103a9592017-10-20 18:57:16 -0700204 message_type = message_type_map[selection]
Betty Zhoue31c27d2018-02-12 19:58:12 -0800205 the_number = self.result_info["%s Total" % message_type] + 1
Betty Zhou92626a22017-12-12 20:07:12 -0800206 begin_time = get_current_epoch_time()
Betty Zhou3db27a32018-04-23 14:31:25 -0700207 test_name = "%s_No_%s_%s" % (self.test_name, the_number, message_type)
Betty Zhouc3eedd72017-11-09 17:50:01 -0800208 start_qxdm_loggers(self.log, self.android_devices)
Betty Zhou3db27a32018-04-23 14:31:25 -0700209 log_msg = "[Test Case] %s" % test_name
210 self.log.info("%s begin", log_msg)
Betty Zhou377f72b2018-01-12 19:43:26 -0800211 for ad in self.android_devices:
Betty Zhou4bc31fc2018-03-12 18:28:50 -0700212 if not getattr(ad, "messaging_droid", None):
213 ad.messaging_droid, ad.messaging_ed = ad.get_droid()
214 ad.messaging_ed.start()
215 else:
Betty Zhou06219032018-01-11 12:40:49 -0800216 try:
Betty Zhou4bc31fc2018-03-12 18:28:50 -0700217 if not ad.messaging_droid.is_live:
218 ad.messaging_droid, ad.messaging_ed = ad.get_droid()
219 ad.messaging_ed.start()
220 else:
221 ad.messaging_ed.clear_all_events()
222 except Exception:
223 ad.log.info("Create new sl4a session for messaging")
224 ad.messaging_droid, ad.messaging_ed = ad.get_droid()
225 ad.messaging_ed.start()
Betty Zhoue26fe892018-04-23 15:29:53 -0700226 ad.messaging_droid.logI("%s begin" % log_msg)
Betty Zhou1095ee42018-05-07 09:53:28 -0700227 text = "%s: " % test_name
Betty Zhou38028b72017-12-20 17:54:12 -0800228 text_length = len(text)
229 if length < text_length:
230 text = text[:length]
231 else:
232 text += rand_ascii_str(length - text_length)
Betty Zhou1095ee42018-05-07 09:53:28 -0700233 message_content_map = {0: [text], 1: [(test_name, text, None)]}
Betty Zhou4c1c4b12017-12-21 17:06:13 -0800234 incall_non_ims = False
Betty Zhou377f72b2018-01-12 19:43:26 -0800235 for ad in self.android_devices:
Betty Zhou4c1c4b12017-12-21 17:06:13 -0800236 if ad.droid.telecomIsInCall() and (
237 not ad.droid.telephonyIsImsRegistered()):
238 incall_non_ims = True
239 break
240
Betty Zhou3db27a32018-04-23 14:31:25 -0700241 result = message_func_map[selection](self.log, ads[0], ads[1],
242 message_content_map[selection],
243 max_wait_time)
244 self.log.info("%s end", log_msg)
245 for ad in self.android_devices:
Betty Zhoue26fe892018-04-23 15:29:53 -0700246 ad.messaging_droid.logI("%s end" % log_msg)
Betty Zhou3db27a32018-04-23 14:31:25 -0700247 if not result:
Betty Zhoue31c27d2018-02-12 19:58:12 -0800248 self.result_info["%s Total" % message_type] += 1
Betty Zhou82d7a722017-11-08 15:56:04 -0800249 if message_type == "SMS":
Betty Zhou8802ec62017-12-18 19:44:29 -0800250 self.log.error("%s fails", log_msg)
Betty Zhoue31c27d2018-02-12 19:58:12 -0800251 self.result_info["%s Failure" % message_type] += 1
Betty Zhou82d7a722017-11-08 15:56:04 -0800252 else:
Betty Zhou4c1c4b12017-12-21 17:06:13 -0800253 if incall_non_ims:
Betty Zhou82d7a722017-11-08 15:56:04 -0800254 self.log.info(
255 "Device not in IMS, MMS in call is not support")
Betty Zhou377f72b2018-01-12 19:43:26 -0800256 self.result_info["Expected In-call MMS failure"] += 1
Betty Zhou82d7a722017-11-08 15:56:04 -0800257 return True
258 else:
Betty Zhou8802ec62017-12-18 19:44:29 -0800259 self.log.error("%s fails", log_msg)
Betty Zhouc133f8c2018-03-02 15:40:13 -0800260 self.result_info["MMS Failure"] += 1
Betty Zhou3db27a32018-04-23 14:31:25 -0700261 try:
262 self._take_bug_report(test_name, begin_time)
263 except Exception as e:
264 self.log.exception(e)
Betty Zhou59f18532017-05-01 15:06:11 -0700265 return False
266 else:
Betty Zhoue31c27d2018-02-12 19:58:12 -0800267 self.result_info["%s Total" % message_type] += 1
Betty Zhou8802ec62017-12-18 19:44:29 -0800268 self.log.info("%s succeed", log_msg)
Jaineel5bee17c2018-01-05 11:55:17 -0800269 self.result_info["%s Success" % message_type] += 1
Betty Zhou33c05292017-05-24 15:12:43 -0700270 return True
Betty Zhou59f18532017-05-01 15:06:11 -0700271
Betty Zhou377f72b2018-01-12 19:43:26 -0800272 def _make_phone_call(self, call_verification_func=None):
273 ads = self.android_devices[:]
274 if not self.single_phone_test:
275 random.shuffle(ads)
Jaineelec050902018-01-04 14:29:19 -0800276 for ad in ads:
Betty Zhoucbda4122018-01-16 19:15:42 -0800277 hangup_call_by_adb(ad)
Betty Zhoue31c27d2018-02-12 19:58:12 -0800278 the_number = self.result_info["Call Total"] + 1
Betty Zhou628b98e2018-01-08 15:45:25 -0800279 duration = random.randrange(self.min_phone_call_duration,
280 self.max_phone_call_duration)
Betty Zhoue31c27d2018-02-12 19:58:12 -0800281 result = True
Betty Zhou3db27a32018-04-23 14:31:25 -0700282 test_name = "%s_No_%s_phone_call" % (self.test_name, the_number)
283 log_msg = "[Test Case] %s" % test_name
284 self.log.info("%s begin", log_msg)
Betty Zhou4bc31fc2018-03-12 18:28:50 -0700285 for ad in self.android_devices:
286 if not getattr(ad, "droid", None):
287 ad.droid, ad.ed = ad.get_droid()
288 ad.ed.start()
289 else:
290 try:
291 if not ad.droid.is_live:
292 ad.droid, ad.ed = ad.get_droid()
293 ad.ed.start()
294 else:
295 ad.ed.clear_all_events()
296 except Exception:
297 ad.log.info("Create new sl4a session for phone call")
298 ad.droid, ad.ed = ad.get_droid()
299 ad.ed.start()
Betty Zhou3db27a32018-04-23 14:31:25 -0700300 ad.droid.logI("%s begin" % log_msg)
Betty Zhou92626a22017-12-12 20:07:12 -0800301 begin_time = get_current_epoch_time()
Betty Zhou2bb11682018-04-19 17:05:30 -0700302 if "wfc" in self.test_name:
303 start_tcpdumps(
304 self.android_devices,
305 "%s_call_No_%s" % (self.test_name, the_number),
306 begin_time,
307 interface="wlan0",
308 mask=None)
Betty Zhou628b98e2018-01-08 15:45:25 -0800309 start_qxdm_loggers(self.log, self.android_devices, begin_time)
Betty Zhou5676e812018-03-20 16:57:58 -0700310 failure_reasons = set()
Betty Zhou377f72b2018-01-12 19:43:26 -0800311 if self.single_phone_test:
312 call_setup_result = initiate_call(
Betty Zhou1ffbc832018-05-08 19:02:56 -0700313 self.log, self.dut, self.call_server_number,
314 incall_ui_display=INCALL_UI_DISPLAY_BACKGROUND
315 ) and wait_for_in_call_active(self.dut, 60, 3)
Betty Zhou377f72b2018-01-12 19:43:26 -0800316 else:
317 call_setup_result = call_setup_teardown(
Betty Zhou74481722018-04-13 16:19:25 -0700318 self.log,
319 ads[0],
320 ads[1],
321 ad_hangup=None,
322 verify_caller_func=call_verification_func,
323 verify_callee_func=call_verification_func,
Betty Zhou1ffbc832018-05-08 19:02:56 -0700324 wait_time_in_call=0,
325 incall_ui_display=INCALL_UI_DISPLAY_BACKGROUND)
Betty Zhou377f72b2018-01-12 19:43:26 -0800326 if not call_setup_result:
Betty Zhou8802ec62017-12-18 19:44:29 -0800327 self.log.error("%s: Setup Call failed.", log_msg)
Betty Zhou5676e812018-03-20 16:57:58 -0700328 failure_reasons.add("Setup")
Betty Zhoue31c27d2018-02-12 19:58:12 -0800329 result = False
330 else:
331 elapsed_time = 0
332 check_interval = 5
333 while (elapsed_time < duration):
334 check_interval = min(check_interval, duration - elapsed_time)
335 time.sleep(check_interval)
336 elapsed_time += check_interval
Betty Zhouc6685ad2018-02-21 18:33:38 -0800337 time_message = "at <%s>/<%s> second." % (elapsed_time,
338 duration)
Betty Zhoue31c27d2018-02-12 19:58:12 -0800339 for ad in ads:
340 if not call_verification_func(self.log, ad):
Betty Zhou88f1ec82018-04-09 18:51:31 -0700341 ad.log.warning("Call is NOT in correct %s state at %s",
342 call_verification_func.__name__,
343 time_message)
Betty Zhouc4dfad12018-04-11 18:36:49 -0700344 if call_verification_func.__name__ == "is_phone_in_call_iwlan":
Betty Zhou88f1ec82018-04-09 18:51:31 -0700345 if is_phone_in_call(self.log, ad):
Betty Zhouc4dfad12018-04-11 18:36:49 -0700346 if getattr(ad, "data_rat_state_error_count",
347 0) < 1:
348 setattr(ad, "data_rat_state_error_count",
349 1)
350 continue
Betty Zhou5676e812018-03-20 16:57:58 -0700351 failure_reasons.add("Maintenance")
Betty Zhou16e8e662018-05-08 18:26:18 -0700352 last_call_drop_reason(ad, begin_time)
Betty Zhoue31c27d2018-02-12 19:58:12 -0800353 hangup_call(self.log, ads[0])
Betty Zhouc6685ad2018-02-21 18:33:38 -0800354 result = False
Betty Zhoue31c27d2018-02-12 19:58:12 -0800355 else:
Betty Zhouc6685ad2018-02-21 18:33:38 -0800356 ad.log.info("Call is in correct %s state at %s",
357 call_verification_func.__name__,
358 time_message)
Betty Zhoua301c202018-02-13 15:11:47 -0800359 if not result:
360 break
Betty Zhou6b91ab22017-12-21 18:16:36 -0800361 if not hangup_call(self.log, ads[0]):
362 time.sleep(10)
363 for ad in ads:
364 if ad.droid.telecomIsInCall():
365 ad.log.error("Still in call after hungup")
Betty Zhou5676e812018-03-20 16:57:58 -0700366 failure_reasons.add("Teardown")
Betty Zhoue31c27d2018-02-12 19:58:12 -0800367 result = False
Betty Zhoue31c27d2018-02-12 19:58:12 -0800368 self.result_info["Call Total"] += 1
Betty Zhou3db27a32018-04-23 14:31:25 -0700369 for ad in self.android_devices:
370 try:
371 ad.droid.logI("%s end" % log_msg)
372 except:
373 pass
374 self.log.info("%s end", log_msg)
Betty Zhoua301c202018-02-13 15:11:47 -0800375 if not result:
Betty Zhou3db27a32018-04-23 14:31:25 -0700376 self.log.info("%s failed", log_msg)
Betty Zhoucc4e8442018-04-25 11:07:45 -0700377 if self.user_params.get("gps_log_file", None):
378 gps_info = job.run(
379 "tail %s" % self.user_params["gps_log_file"],
380 ignore_status=True)
Betty Zhou49744692018-04-24 11:00:38 -0700381 if gps_info.stdout:
382 self.log.info("gps log:\n%s", gps_info.stdout)
383 else:
384 self.log.warning("Fail to get gps log %s",
385 self.user_params["gps_log_file"])
Betty Zhou5676e812018-03-20 16:57:58 -0700386 for reason in failure_reasons:
387 self.result_info["Call %s Failure" % reason] += 1
Betty Zhou3468a8b2018-02-14 14:34:56 -0800388 for ad in ads:
Betty Zhouc6685ad2018-02-21 18:33:38 -0800389 log_path = os.path.join(self.log_path, test_name,
Betty Zhoue57ab692018-03-09 18:39:30 -0800390 "%s_binder_logs" % ad.serial)
Betty Zhou3468a8b2018-02-14 14:34:56 -0800391 utils.create_dir(log_path)
Betty Zhoue57ab692018-03-09 18:39:30 -0800392 ad.pull_files(BINDER_LOGS, log_path)
Betty Zhouccfd8ef2018-03-19 17:52:01 -0700393 try:
394 self._take_bug_report(test_name, begin_time)
395 except Exception as e:
396 self.log.exception(e)
Betty Zhou3468a8b2018-02-14 14:34:56 -0800397 else:
398 self.log.info("%s test succeed", log_msg)
399 self.result_info["Call Success"] += 1
Betty Zhou4bc31fc2018-03-12 18:28:50 -0700400 if self.get_binder_logs and self.result_info["Call Total"] % 50 == 0:
Betty Zhouc6685ad2018-02-21 18:33:38 -0800401 for ad in ads:
Betty Zhou3db27a32018-04-23 14:31:25 -0700402 log_path = os.path.join(self.log_path,
403 "%s_binder_logs" % test_name,
Betty Zhoue57ab692018-03-09 18:39:30 -0800404 "%s_binder_logs" % ad.serial)
Betty Zhouc6685ad2018-02-21 18:33:38 -0800405 utils.create_dir(log_path)
Betty Zhoue57ab692018-03-09 18:39:30 -0800406 ad.pull_files(BINDER_LOGS, log_path)
Betty Zhoue31c27d2018-02-12 19:58:12 -0800407 return result
Betty Zhou59f18532017-05-01 15:06:11 -0700408
Betty Zhou103a9592017-10-20 18:57:16 -0700409 def _prefnetwork_mode_change(self, sub_id):
410 # ModePref change to non-LTE
Betty Zhou92626a22017-12-12 20:07:12 -0800411 begin_time = get_current_epoch_time()
Betty Zhou628b98e2018-01-08 15:45:25 -0800412 start_qxdm_loggers(self.log, self.android_devices)
Betty Zhou103a9592017-10-20 18:57:16 -0700413 network_preference_list = [
414 NETWORK_MODE_TDSCDMA_GSM_WCDMA, NETWORK_MODE_WCDMA_ONLY,
415 NETWORK_MODE_GLOBAL, NETWORK_MODE_CDMA, NETWORK_MODE_GSM_ONLY
416 ]
417 network_preference = random.choice(network_preference_list)
418 set_preferred_network_mode_pref(self.log, self.dut, sub_id,
419 network_preference)
420 time.sleep(WAIT_TIME_AFTER_MODE_CHANGE)
421 self.dut.log.info("Current Voice RAT is %s",
422 get_current_voice_rat(self.log, self.dut))
423
424 # ModePref change back to with LTE
425 set_preferred_network_mode_pref(self.log, self.dut, sub_id,
426 NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA)
427 time.sleep(WAIT_TIME_AFTER_MODE_CHANGE)
428 rat = get_current_voice_rat(self.log, self.dut)
429 self.dut.log.info("Current Voice RAT is %s", rat)
Betty Zhoue31c27d2018-02-12 19:58:12 -0800430 self.result_info["RAT Change Total"] += 1
Betty Zhou103a9592017-10-20 18:57:16 -0700431 if rat != "LTE":
Betty Zhoue31c27d2018-02-12 19:58:12 -0800432 self.result_info["RAT Change Failure"] += 1
Betty Zhouccfd8ef2018-03-19 17:52:01 -0700433 try:
434 self._take_bug_report("%s_rat_change_failure" % self.test_name,
435 begin_time)
436 except Exception as e:
437 self.log.exception(e)
Jaineelcd748202017-08-10 12:23:42 -0700438 return False
Betty Zhoue31c27d2018-02-12 19:58:12 -0800439 else:
440 self.result_info["RAT Change Success"] += 1
441 return True
Jaineelcd748202017-08-10 12:23:42 -0700442
Betty Zhou9aa68ad2018-01-12 12:39:23 -0800443 def _get_result_message(self):
Betty Zhouc6685ad2018-02-21 18:33:38 -0800444 msg_list = [
445 "%s: %s" % (count, self.result_info[count])
446 for count in sorted(self.result_info.keys())
447 ]
Betty Zhou9aa68ad2018-01-12 12:39:23 -0800448 return ", ".join(msg_list)
449
Betty Zhou61646502018-01-12 13:02:48 -0800450 def _write_perf_json(self):
451 json_str = json.dumps(self.perf_data, indent=4, sort_keys=True)
452 with open(self.perf_file, 'w') as f:
453 f.write(json_str)
454
Betty Zhou9aa68ad2018-01-12 12:39:23 -0800455 def _init_perf_json(self):
Betty Zhouc6685ad2018-02-21 18:33:38 -0800456 self.perf_file = os.path.join(self.log_path, "%s_perf_data_%s.json" %
457 (self.test_name, self.begin_time))
Betty Zhou9aa68ad2018-01-12 12:39:23 -0800458 self.perf_data = self.android_devices[0].build_info.copy()
459 self.perf_data["model"] = self.android_devices[0].model
Betty Zhou61646502018-01-12 13:02:48 -0800460 self._write_perf_json()
Betty Zhou9aa68ad2018-01-12 12:39:23 -0800461
462 def _update_perf_json(self):
463 for result_key, result_value in self.result_info.items():
464 self.perf_data[result_key] = result_value
Betty Zhou61646502018-01-12 13:02:48 -0800465 self._write_perf_json()
Betty Zhou9aa68ad2018-01-12 12:39:23 -0800466
Betty Zhou56a54612017-05-09 18:54:45 -0700467 def crash_check_test(self):
468 failure = 0
469 while time.time() < self.finishing_time:
Betty Zhou7b9dd3d2017-07-14 18:57:06 -0700470 try:
Betty Zhou06219032018-01-11 12:40:49 -0800471 self.log.info(dict(self.result_info))
Betty Zhou9aa68ad2018-01-12 12:39:23 -0800472 self._update_perf_json()
Betty Zhou92626a22017-12-12 20:07:12 -0800473 begin_time = get_current_epoch_time()
Betty Zhouccfd8ef2018-03-19 17:52:01 -0700474 run_time_in_seconds = (begin_time - self.begin_time) / 1000
475 test_name = "%s_crash_%s_seconds_after_start" % (
476 self.test_name, run_time_in_seconds)
Betty Zhou7b9dd3d2017-07-14 18:57:06 -0700477 time.sleep(self.crash_check_interval)
Betty Zhouf52dee32018-01-08 13:07:42 -0800478 for ad in self.android_devices:
Betty Zhou4c1c4b12017-12-21 17:06:13 -0800479 crash_report = ad.check_crash_report(
Betty Zhou4bc31fc2018-03-12 18:28:50 -0700480 test_name, begin_time, log_crash_report=True)
Betty Zhou4c1c4b12017-12-21 17:06:13 -0800481 if crash_report:
482 ad.log.error("Find new crash reports %s", crash_report)
483 failure += 1
484 self.result_info["Crashes"] += 1
Betty Zhou27080b12018-03-01 15:06:13 -0800485 for crash in crash_report:
486 if "ramdump_modem" in crash:
487 self.result_info["Crashes-Modem"] += 1
Betty Zhouccfd8ef2018-03-19 17:52:01 -0700488 try:
489 ad.take_bug_report(test_name, begin_time)
490 except Exception as e:
491 self.log.exception(e)
Betty Zhoucf048542018-02-22 17:14:08 -0800492 except Exception as e:
Betty Zhou7b9dd3d2017-07-14 18:57:06 -0700493 self.log.error("Exception error %s", str(e))
494 self.result_info["Exception Errors"] += 1
Betty Zhou4c1c4b12017-12-21 17:06:13 -0800495 self.log.info("Crashes found: %s", failure)
Betty Zhoucf048542018-02-22 17:14:08 -0800496 if self.result_info["Exception Errors"] >= EXCEPTION_TOLERANCE:
497 self.log.error("Too many exception errors, quit test")
Betty Zhou53f1d0e2018-01-26 20:08:27 -0800498 return False
Betty Zhou8c0fc692017-07-20 18:49:19 -0700499 if failure:
Betty Zhoua1296402017-10-23 17:32:40 -0700500 return False
Betty Zhou8c0fc692017-07-20 18:49:19 -0700501 else:
Betty Zhoua1296402017-10-23 17:32:40 -0700502 return True
Betty Zhou56a54612017-05-09 18:54:45 -0700503
Betty Zhou82d7a722017-11-08 15:56:04 -0800504 def call_test(self, call_verification_func=None):
Betty Zhou59f18532017-05-01 15:06:11 -0700505 while time.time() < self.finishing_time:
Betty Zhou7b9dd3d2017-07-14 18:57:06 -0700506 try:
Betty Zhou377f72b2018-01-12 19:43:26 -0800507 self._make_phone_call(call_verification_func)
Betty Zhoucf048542018-02-22 17:14:08 -0800508 except Exception as e:
Betty Zhou7b9dd3d2017-07-14 18:57:06 -0700509 self.log.error("Exception error %s", str(e))
510 self.result_info["Exception Errors"] += 1
Betty Zhoucf048542018-02-22 17:14:08 -0800511 if self.result_info["Exception Errors"] >= EXCEPTION_TOLERANCE:
512 self.log.error("Too many exception errors, quit test")
Betty Zhou628b98e2018-01-08 15:45:25 -0800513 return False
Betty Zhou75cbbbe2017-11-06 14:09:20 -0800514 self.log.info("%s", dict(self.result_info))
Betty Zhoucf048542018-02-22 17:14:08 -0800515 time.sleep(
516 random.randrange(self.min_sleep_time, self.max_sleep_time))
Betty Zhouc6685ad2018-02-21 18:33:38 -0800517 if any([
518 self.result_info["Call Setup Failure"],
Betty Zhou5e3f68a2017-12-14 15:50:47 -0800519 self.result_info["Call Maintenance Failure"],
Betty Zhouc6685ad2018-02-21 18:33:38 -0800520 self.result_info["Call Teardown Failure"]
521 ]):
Betty Zhou103a9592017-10-20 18:57:16 -0700522 return False
Jaineelcd748202017-08-10 12:23:42 -0700523 else:
Betty Zhou103a9592017-10-20 18:57:16 -0700524 return True
Jaineelcd748202017-08-10 12:23:42 -0700525
Betty Zhou632793c2018-02-09 18:45:39 -0800526 def message_test(self, max_wait_time=MAX_WAIT_TIME_SMS_RECEIVE):
Betty Zhou59f18532017-05-01 15:06:11 -0700527 while time.time() < self.finishing_time:
Betty Zhou7b9dd3d2017-07-14 18:57:06 -0700528 try:
Betty Zhou632793c2018-02-09 18:45:39 -0800529 self._send_message(max_wait_time=max_wait_time)
Betty Zhoucf048542018-02-22 17:14:08 -0800530 except Exception as e:
Betty Zhou7b9dd3d2017-07-14 18:57:06 -0700531 self.log.error("Exception error %s", str(e))
532 self.result_info["Exception Errors"] += 1
Betty Zhou4c1c4b12017-12-21 17:06:13 -0800533 self.log.info(dict(self.result_info))
Betty Zhoucf048542018-02-22 17:14:08 -0800534 if self.result_info["Exception Errors"] >= EXCEPTION_TOLERANCE:
535 self.log.error("Too many exception errors, quit test")
Betty Zhou53f1d0e2018-01-26 20:08:27 -0800536 return False
Betty Zhoucf048542018-02-22 17:14:08 -0800537 time.sleep(
538 random.randrange(self.min_sleep_time, self.max_sleep_time))
Betty Zhoue31c27d2018-02-12 19:58:12 -0800539 if self.result_info["SMS Failure"] or (
540 self.result_info["MMS Failure"] / self.result_info["MMS Total"]
Betty Zhou75cbbbe2017-11-06 14:09:20 -0800541 > 0.3):
Betty Zhou103a9592017-10-20 18:57:16 -0700542 return False
Betty Zhou8c0fc692017-07-20 18:49:19 -0700543 else:
Betty Zhou103a9592017-10-20 18:57:16 -0700544 return True
Betty Zhou59f18532017-05-01 15:06:11 -0700545
Betty Zhou80f136a2018-04-23 16:37:36 -0700546 def _data_download(self,
547 file_names=["5MB", "10MB", "20MB", "50MB", "200MB"]):
Betty Zhou8c0fc692017-07-20 18:49:19 -0700548 #file_names = ["5MB", "10MB", "20MB", "50MB", "200MB", "512MB", "1GB"]
Betty Zhoue31c27d2018-02-12 19:58:12 -0800549 begin_time = get_current_epoch_time()
550 start_qxdm_loggers(self.log, self.android_devices)
Betty Zhoue31c27d2018-02-12 19:58:12 -0800551 self.dut.log.info(dict(self.result_info))
552 selection = random.randrange(0, len(file_names))
553 file_name = file_names[selection]
Betty Zhoufe64cd82018-03-26 14:14:07 -0700554 self.result_info["Internet Connection Check Total"] += 1
555 if not verify_internet_connection(self.log, self.dut):
556 self.result_info["Internet Connection Check Failure"] += 1
557 test_name = "%s_internet_connection_No_%s_failure" % (
558 self.test_name,
559 self.result_info["Internet Connection Check Failure"])
560 try:
Betty Zhou042a56e2018-03-30 17:18:04 -0700561 self._ad_take_extra_logs(self.dut, test_name, begin_time)
562 self._ad_take_bugreport(self.dut, test_name, begin_time)
Betty Zhoufe64cd82018-03-26 14:14:07 -0700563 except Exception as e:
564 self.log.exception(e)
565 return False
566 else:
567 self.result_info["Internet Connection Check Success"] += 1
568
Betty Zhoue31c27d2018-02-12 19:58:12 -0800569 self.result_info["File Download Total"] += 1
Betty Zhouc86784b2018-02-28 16:42:53 -0800570 if not active_file_download_test(
Betty Zhouc133f8c2018-03-02 15:40:13 -0800571 self.log, self.dut, file_name,
572 method=self.file_download_method):
Betty Zhou200031e2018-02-14 15:21:24 -0800573 self.result_info["File Download Failure"] += 1
574 if self.result_info["File Download Failure"] == 1:
Betty Zhouccfd8ef2018-03-19 17:52:01 -0700575 try:
576 self._ad_take_extra_logs(
577 self.dut, "%s_file_download_failure" % self.test_name,
578 begin_time)
Betty Zhoufe64cd82018-03-26 14:14:07 -0700579 self._ad_take_bugreport(
Betty Zhouccfd8ef2018-03-19 17:52:01 -0700580 self.dut, "%s_file_download_failure" % self.test_name,
581 begin_time)
582 except Exception as e:
583 self.log.exception(e)
Betty Zhoue31c27d2018-02-12 19:58:12 -0800584 return False
585 else:
586 self.result_info["File Download Success"] += 1
Betty Zhoue31c27d2018-02-12 19:58:12 -0800587 return True
588
589 def data_test(self):
Betty Zhou59f18532017-05-01 15:06:11 -0700590 while time.time() < self.finishing_time:
Betty Zhou7b9dd3d2017-07-14 18:57:06 -0700591 try:
Betty Zhoue31c27d2018-02-12 19:58:12 -0800592 self._data_download()
Betty Zhoucf048542018-02-22 17:14:08 -0800593 except Exception as e:
Betty Zhou7b9dd3d2017-07-14 18:57:06 -0700594 self.log.error("Exception error %s", str(e))
595 self.result_info["Exception Errors"] += 1
Betty Zhou75cbbbe2017-11-06 14:09:20 -0800596 self.log.info("%s", dict(self.result_info))
Betty Zhoucf048542018-02-22 17:14:08 -0800597 if self.result_info["Exception Errors"] >= EXCEPTION_TOLERANCE:
598 self.log.error("Too many exception errors, quit test")
Betty Zhou53f1d0e2018-01-26 20:08:27 -0800599 return False
Betty Zhoucf048542018-02-22 17:14:08 -0800600 time.sleep(
601 random.randrange(self.min_sleep_time, self.max_sleep_time))
Betty Zhoufe64cd82018-03-26 14:14:07 -0700602 if self.result_info["Internet Connection Check Failure"]:
Betty Zhou103a9592017-10-20 18:57:16 -0700603 return False
Betty Zhou8c0fc692017-07-20 18:49:19 -0700604 else:
Betty Zhou103a9592017-10-20 18:57:16 -0700605 return True
Betty Zhou59f18532017-05-01 15:06:11 -0700606
Betty Zhou82d7a722017-11-08 15:56:04 -0800607 def parallel_tests(self, setup_func=None, call_verification_func=None):
Betty Zhou61646502018-01-12 13:02:48 -0800608 self.log.info(self._get_result_message())
Betty Zhou59f18532017-05-01 15:06:11 -0700609 if setup_func and not setup_func():
Betty Zhoue26fe892018-04-23 15:29:53 -0700610 msg = "%s setup %s failed" % (self.test_name, setup_func.__name__)
Betty Zhou103a9592017-10-20 18:57:16 -0700611 self.log.error(msg)
Betty Zhou2bb11682018-04-19 17:05:30 -0700612 self._take_bug_report("%s%s" % (self.test_name,
613 setup_func.__name__),
614 self.begin_time)
615 return False
Betty Zhou8802ec62017-12-18 19:44:29 -0800616 if not call_verification_func:
617 call_verification_func = is_phone_in_call
Betty Zhou59f18532017-05-01 15:06:11 -0700618 self.finishing_time = time.time() + self.max_run_time
Betty Zhou82d7a722017-11-08 15:56:04 -0800619 results = run_multithread_func(
Betty Zhou8802ec62017-12-18 19:44:29 -0800620 self.log, [(self.call_test, [call_verification_func]),
621 (self.message_test, []), (self.data_test, []),
622 (self.crash_check_test, [])])
Betty Zhou9aa68ad2018-01-12 12:39:23 -0800623 result_message = self._get_result_message()
Betty Zhou551ebb52017-10-24 12:59:24 -0700624 self.log.info(result_message)
Betty Zhoucbda4122018-01-16 19:15:42 -0800625 self._update_perf_json()
Betty Zhou53f1d0e2018-01-26 20:08:27 -0800626 self.result_detail = result_message
627 return all(results)
Betty Zhou59f18532017-05-01 15:06:11 -0700628
Betty Zhoue31c27d2018-02-12 19:58:12 -0800629 def volte_modechange_volte_test(self):
630 sub_id = self.dut.droid.subscriptionGetDefaultSubId()
631 while time.time() < self.finishing_time:
632 try:
633 run_multithread_func(
634 self.log,
Betty Zhou80f136a2018-04-23 16:37:36 -0700635 [(self._data_download, [["5MB"]]),
Betty Zhoue31c27d2018-02-12 19:58:12 -0800636 (self._make_phone_call, [is_phone_in_call_volte]),
637 (self._send_message, [])])
638 self._prefnetwork_mode_change(sub_id)
Betty Zhoucf048542018-02-22 17:14:08 -0800639 except Exception as e:
Betty Zhoue31c27d2018-02-12 19:58:12 -0800640 self.log.error("Exception error %s", str(e))
641 self.result_info["Exception Errors"] += 1
Betty Zhoue31c27d2018-02-12 19:58:12 -0800642 self.log.info(dict(self.result_info))
Betty Zhoucf048542018-02-22 17:14:08 -0800643 if self.result_info["Exception Errors"] >= EXCEPTION_TOLERANCE:
644 self.log.error("Too many exception errors, quit test")
Betty Zhoue31c27d2018-02-12 19:58:12 -0800645 return False
Betty Zhouc6685ad2018-02-21 18:33:38 -0800646 if self.result_info["Call Failure"] or self.result_info["RAT Change Failure"] or self.result_info["SMS Failure"]:
Betty Zhoue31c27d2018-02-12 19:58:12 -0800647 return False
648 else:
649 return True
Betty Zhou61646502018-01-12 13:02:48 -0800650
Betty Zhou632793c2018-02-09 18:45:39 -0800651 def parallel_with_network_change_tests(self, setup_func=None):
Jaineelcd748202017-08-10 12:23:42 -0700652 if setup_func and not setup_func():
653 self.log.error("Test setup %s failed", setup_func.__name__)
654 return False
Jaineelcd748202017-08-10 12:23:42 -0700655 self.finishing_time = time.time() + self.max_run_time
Jaineel664316b2017-12-04 15:16:48 -0800656 results = run_multithread_func(self.log,
657 [(self.volte_modechange_volte_test, []),
658 (self.crash_check_test, [])])
Betty Zhoue31c27d2018-02-12 19:58:12 -0800659 result_message = self._get_result_message()
Betty Zhou61646502018-01-12 13:02:48 -0800660 self.log.info(result_message)
Betty Zhoucbda4122018-01-16 19:15:42 -0800661 self._update_perf_json()
Betty Zhou53f1d0e2018-01-26 20:08:27 -0800662 self.result_detail = result_message
663 return all(results)
Jaineelcd748202017-08-10 12:23:42 -0700664
Betty Zhou59f18532017-05-01 15:06:11 -0700665 """ Tests Begin """
666
Betty Zhoucf456cf2017-05-10 19:15:09 -0700667 @test_tracker_info(uuid="d035e5b9-476a-4e3d-b4e9-6fd86c51a68d")
Betty Zhou59f18532017-05-01 15:06:11 -0700668 @TelephonyBaseTest.tel_test_wrap
669 def test_default_parallel_stress(self):
670 """ Default state stress test"""
671 return self.parallel_tests()
672
Betty Zhoucf456cf2017-05-10 19:15:09 -0700673 @test_tracker_info(uuid="c21e1f17-3282-4f0b-b527-19f048798098")
Betty Zhou59f18532017-05-01 15:06:11 -0700674 @TelephonyBaseTest.tel_test_wrap
Betty Zhoucf456cf2017-05-10 19:15:09 -0700675 def test_lte_volte_parallel_stress(self):
Betty Zhou59f18532017-05-01 15:06:11 -0700676 """ VoLTE on stress test"""
Betty Zhou82d7a722017-11-08 15:56:04 -0800677 return self.parallel_tests(
678 setup_func=self._setup_lte_volte_enabled,
679 call_verification_func=is_phone_in_call_volte)
Betty Zhou59f18532017-05-01 15:06:11 -0700680
Betty Zhoucf456cf2017-05-10 19:15:09 -0700681 @test_tracker_info(uuid="a317c23a-41e0-4ef8-af67-661451cfefcf")
Betty Zhou59f18532017-05-01 15:06:11 -0700682 @TelephonyBaseTest.tel_test_wrap
Betty Zhoucf456cf2017-05-10 19:15:09 -0700683 def test_csfb_parallel_stress(self):
Betty Zhou59f18532017-05-01 15:06:11 -0700684 """ LTE non-VoLTE stress test"""
Betty Zhou82d7a722017-11-08 15:56:04 -0800685 return self.parallel_tests(
686 setup_func=self._setup_lte_volte_disabled,
687 call_verification_func=is_phone_in_call_csfb)
Betty Zhou59f18532017-05-01 15:06:11 -0700688
Betty Zhoucf456cf2017-05-10 19:15:09 -0700689 @test_tracker_info(uuid="fdb791bf-c414-4333-9fa3-cc18c9b3b234")
Betty Zhou59f18532017-05-01 15:06:11 -0700690 @TelephonyBaseTest.tel_test_wrap
Betty Zhoucf456cf2017-05-10 19:15:09 -0700691 def test_wfc_parallel_stress(self):
Betty Zhou042a56e2018-03-30 17:18:04 -0700692 """ Wifi calling APM mode off stress test"""
Betty Zhou82d7a722017-11-08 15:56:04 -0800693 return self.parallel_tests(
694 setup_func=self._setup_wfc,
695 call_verification_func=is_phone_in_call_iwlan)
Betty Zhou59f18532017-05-01 15:06:11 -0700696
Betty Zhou042a56e2018-03-30 17:18:04 -0700697 @test_tracker_info(uuid="e334c1b3-4378-49bb-bf57-1573fa1b23fa")
698 @TelephonyBaseTest.tel_test_wrap
699 def test_wfc_apm_parallel_stress(self):
700 """ Wifi calling in APM mode on stress test"""
701 return self.parallel_tests(
702 setup_func=self._setup_wfc_apm,
703 call_verification_func=is_phone_in_call_iwlan)
704
Betty Zhoucf456cf2017-05-10 19:15:09 -0700705 @test_tracker_info(uuid="4566eef6-55de-4ac8-87ee-58f2ef41a3e8")
Betty Zhou59f18532017-05-01 15:06:11 -0700706 @TelephonyBaseTest.tel_test_wrap
Betty Zhoucf456cf2017-05-10 19:15:09 -0700707 def test_3g_parallel_stress(self):
Betty Zhou59f18532017-05-01 15:06:11 -0700708 """ 3G stress test"""
Betty Zhou82d7a722017-11-08 15:56:04 -0800709 return self.parallel_tests(
710 setup_func=self._setup_3g,
711 call_verification_func=is_phone_in_call_3g)
Betty Zhou59f18532017-05-01 15:06:11 -0700712
Betty Zhoucf456cf2017-05-10 19:15:09 -0700713 @test_tracker_info(uuid="f34f1a31-3948-4675-8698-372a83b8088d")
Betty Zhou59f18532017-05-01 15:06:11 -0700714 @TelephonyBaseTest.tel_test_wrap
Betty Zhoucf456cf2017-05-10 19:15:09 -0700715 def test_call_2g_parallel_stress(self):
Betty Zhou59f18532017-05-01 15:06:11 -0700716 """ 2G call stress test"""
Betty Zhou82d7a722017-11-08 15:56:04 -0800717 return self.parallel_tests(
718 setup_func=self._setup_2g,
719 call_verification_func=is_phone_in_call_2g)
Betty Zhou59f18532017-05-01 15:06:11 -0700720
Jaineelcd748202017-08-10 12:23:42 -0700721 @test_tracker_info(uuid="af580fca-fea6-4ca5-b981-b8c710302d37")
722 @TelephonyBaseTest.tel_test_wrap
723 def test_volte_modeprefchange_parallel_stress(self):
724 """ VoLTE Mode Pref call stress test"""
Betty Zhou632793c2018-02-09 18:45:39 -0800725 return self.parallel_with_network_change_tests(
Jaineelcd748202017-08-10 12:23:42 -0700726 setup_func=self._setup_lte_volte_enabled)
727
Betty Zhou59f18532017-05-01 15:06:11 -0700728 """ Tests End """