• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env python3.4
2#
3#   Copyright 2021 - 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 5G SA MMS scenarios
18"""
19
20import time
21
22from acts.test_decorators import test_tracker_info
23from acts_contrib.test_utils.tel.TelephonyBaseTest import TelephonyBaseTest
24from acts_contrib.test_utils.tel.tel_test_utils import ensure_phones_idle
25from acts_contrib.test_utils.tel.tel_test_utils import ensure_wifi_connected
26from acts_contrib.test_utils.tel.tel_5g_test_utils import disable_apm_mode_both_devices
27from acts_contrib.test_utils.tel.tel_5g_test_utils import provision_device_for_5g
28from acts_contrib.test_utils.tel.tel_5g_test_utils import verify_5g_attach_for_both_devices
29from acts_contrib.test_utils.tel.tel_mms_utils import _mms_test_mo
30from acts_contrib.test_utils.tel.tel_mms_utils import _long_mms_test_mo
31
32
33class Sa5gMmsTest(TelephonyBaseTest):
34    def setup_class(self):
35        super().setup_class()
36        self.number_of_devices = 2
37
38    def setup_test(self):
39        TelephonyBaseTest.setup_test(self)
40
41    def teardown_test(self):
42        ensure_phones_idle(self.log, self.android_devices)
43
44
45    """ Tests Begin """
46
47
48    @test_tracker_info(uuid="74e2ae79-aee4-46e0-9326-fcd3b7f19128")
49    @TelephonyBaseTest.tel_test_wrap
50    def test_5g_sa_mms_mo_mt(self):
51        """Test MMS between two phones in 5g SA
52
53        Provision devices in 5g SA
54        Send and Verify MMS from PhoneA to PhoneB
55        Verify both devices are still on 5g SA
56
57        Returns:
58            True if success.
59            False if failed.
60        """
61        ads = self.android_devices
62        if not provision_device_for_5g(self.log, ads, sa_5g=True):
63            return False
64
65        if not _mms_test_mo(self.log, ads):
66            return False
67
68        if not verify_5g_attach_for_both_devices(self.log, ads, True):
69            return False
70
71        self.log.info("PASS - mms test over 5g sa validated")
72        return True
73
74
75    @test_tracker_info(uuid="6cd173f5-bd1d-44bb-aac2-ac63f37b9a62")
76    @TelephonyBaseTest.tel_test_wrap
77    def test_5g_sa_mms_long_message_mo_mt(self):
78        """Test MMS basic function between two phone. Phones in sa 5G network.
79
80        Airplane mode is off. Phone in 5G SA.
81        Send MMS from PhoneA to PhoneB.
82        Verify received message on PhoneB is correct.
83
84        Returns:
85            True if success.
86            False if failed.
87        """
88
89        ads = self.android_devices
90
91        if not disable_apm_mode_both_devices(self.log, ads):
92            return False
93
94        if not provision_device_for_5g(self.log, ads, sa_5g=True):
95            return False
96
97        return _long_mms_test_mo(self.log, ads)
98
99
100    @test_tracker_info(uuid="83d24fb5-1ebd-42e0-a3d1-b85b607234e2")
101    @TelephonyBaseTest.tel_test_wrap
102    def test_5g_sa_mms_mo_mt_wifi(self):
103        """Test MMS basic function between two phone. Phones in sa 5g network.
104
105        Airplane mode is off. Phone in sa 5G.
106        Connect to Wifi.
107        Send MMS from PhoneA to PhoneB.
108        Verify received message on PhoneB is correct.
109
110        Returns:
111            True if success.
112            False if failed.
113        """
114
115        ads = self.android_devices
116
117        if not disable_apm_mode_both_devices(self.log, ads):
118            return False
119
120        if not provision_device_for_5g(self.log, ads, sa_5g=True):
121            return False
122
123        ensure_wifi_connected(self.log, ads[0], self.wifi_network_ssid,
124                              self.wifi_network_pass)
125
126        return _mms_test_mo(self.log, ads)
127
128
129    """ Tests End """
130