Home | History | Annotate | Download | only in live
      1 #!/usr/bin/env python3.4
      2 #
      3 #   Copyright 2016 - 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 VT Data test
     18 """
     19 from acts.test_utils.tel.TelephonyBaseTest import TelephonyBaseTest
     20 from acts.test_utils.tel.tel_defines import VT_STATE_BIDIRECTIONAL
     21 from acts.test_utils.tel.tel_test_utils import hangup_call
     22 from acts.test_utils.tel.tel_test_utils import multithread_func
     23 from acts.test_utils.tel.tel_test_utils import verify_http_connection
     24 from acts.test_utils.tel.tel_video_utils import \
     25     is_phone_in_call_video_bidirectional
     26 from acts.test_utils.tel.tel_video_utils import phone_setup_video
     27 from acts.test_utils.tel.tel_video_utils import video_call_setup_teardown
     28 
     29 
     30 class TelLiveVideoDataTest(TelephonyBaseTest):
     31     def __init__(self, controllers):
     32         TelephonyBaseTest.__init__(self, controllers)
     33 
     34         self.stress_test_number = self.get_stress_test_number()
     35         self.wifi_network_ssid = self.user_params["wifi_network_ssid"]
     36 
     37         try:
     38             self.wifi_network_pass = self.user_params["wifi_network_pass"]
     39         except KeyError:
     40             self.wifi_network_pass = None
     41 
     42     """ Tests Begin """
     43 
     44     @TelephonyBaseTest.tel_test_wrap
     45     def test_internet_access_during_video_call(self):
     46         """ Test Internet access during VT<->VT call.
     47 
     48         Make Sure PhoneA is in LTE mode (with Video Calling).
     49         Make Sure PhoneB is in LTE mode (with Video Calling).
     50         Call from PhoneA to PhoneB as Bi-Directional Video,
     51         Accept on PhoneB as video call.
     52         Verify PhoneA have Internet access.
     53         Hang up on PhoneA.
     54 
     55         Returns:
     56             True if pass; False if fail.
     57         """
     58         ads = self.android_devices
     59         tasks = [(phone_setup_video, (self.log, ads[0])), (phone_setup_video,
     60                                                            (self.log, ads[1]))]
     61         if not multithread_func(self.log, tasks):
     62             self.log.error("Phone Failed to Set Up Properly.")
     63             return False
     64 
     65         self.log.info("Step1: Make MO VT call.")
     66         if not video_call_setup_teardown(
     67                 self.log,
     68                 ads[0],
     69                 ads[1],
     70                 None,
     71                 video_state=VT_STATE_BIDIRECTIONAL,
     72                 verify_caller_func=is_phone_in_call_video_bidirectional,
     73                 verify_callee_func=is_phone_in_call_video_bidirectional):
     74             self.log.error("Failed to setup+teardown a call")
     75             return False
     76 
     77         self.log.info("Step2: Verify Internet on PhoneA.")
     78         if not verify_http_connection(self.log, ads[0]):
     79             self.log.error("Verify Internet on PhoneA failed.")
     80             return False
     81 
     82         return hangup_call(self.log, ads[0])
     83 
     84 
     85 """ Tests End """
     86