• 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 SMS scenarios
18"""
19
20import time
21from acts.test_decorators import test_tracker_info
22from acts_contrib.test_utils.tel.TelephonyBaseTest import TelephonyBaseTest
23from acts_contrib.test_utils.tel.tel_test_utils import ensure_phones_idle
24from acts_contrib.test_utils.tel.tel_5g_test_utils import disable_apm_mode_both_devices
25from acts_contrib.test_utils.tel.tel_5g_test_utils import provision_device_for_5g
26from acts_contrib.test_utils.tel.tel_5g_test_utils import provision_both_devices_for_volte
27from acts_contrib.test_utils.tel.tel_5g_test_utils import verify_5g_attach_for_both_devices
28from acts_contrib.test_utils.tel.tel_sms_utils import _sms_test_mo
29from acts_contrib.test_utils.tel.tel_sms_utils import _long_sms_test_mo
30
31
32class Sa5gSmsTest(TelephonyBaseTest):
33    def setup_class(self):
34        super().setup_class()
35
36    def setup_test(self):
37        TelephonyBaseTest.setup_test(self)
38
39    def teardown_test(self):
40        ensure_phones_idle(self.log, self.android_devices)
41
42
43    """ Tests Begin """
44
45
46    @test_tracker_info(uuid="8949d1c7-1719-4960-b79c-041b467fb5ef")
47    @TelephonyBaseTest.tel_test_wrap
48    def test_5g_sa_sms_mo_mt(self):
49        """Test SMS between two phones in 5g SA
50
51        Provision devices in 5g SA
52        Send and Verify SMS from PhoneA to PhoneB
53        Verify both devices are still on 5g SA
54
55        Returns:
56            True if success.
57            False if failed.
58        """
59        ads = self.android_devices
60        if not provision_device_for_5g(self.log, ads, sa_5g=True):
61            return False
62
63        if not _sms_test_mo(self.log, ads):
64            return False
65
66        if not verify_5g_attach_for_both_devices(self.log, ads, True):
67            return False
68
69        self.log.info("PASS - SMS test over 5G SA validated")
70        return True
71
72
73    @test_tracker_info(uuid="5c7a717b-1f98-44b7-95e7-0e83afb82a84")
74    @TelephonyBaseTest.tel_test_wrap
75    def test_5g_sa_sms_long_message_mo_mt(self):
76        """Test SMS basic function between two phone.
77
78        Phones in sa 5G network.
79        Airplane mode is off.
80        Send SMS from PhoneA to PhoneB.
81        Verify received message on PhoneB is correct.
82
83        Returns:
84            True if success.
85            False if failed.
86        """
87
88        ads = self.android_devices
89
90        if not disable_apm_mode_both_devices(self.log, ads):
91            return False
92
93        if not provision_device_for_5g(self.log, ads, sa_5g=True):
94            return False
95
96        return _long_sms_test_mo(self.log, ads)
97
98    """ Tests End """
99