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 MSA mmWave Activation scenarios 18""" 19 20from acts.test_decorators import test_tracker_info 21from acts_contrib.test_utils.tel.TelephonyBaseTest import TelephonyBaseTest 22from acts_contrib.test_utils.tel.tel_test_utils import reboot_device 23from acts_contrib.test_utils.tel.tel_test_utils import cycle_airplane_mode 24from acts_contrib.test_utils.tel.tel_5g_test_utils import test_activation_by_condition 25from acts_contrib.test_utils.tel.tel_test_utils import set_phone_silent_mode 26 27 28class Nsa5gMmwActivationTest(TelephonyBaseTest): 29 def setup_class(self): 30 super().setup_class() 31 for ad in self.android_devices: 32 set_phone_silent_mode(self.log, ad, True) 33 34 def setup_test(self): 35 TelephonyBaseTest.setup_test(self) 36 self.number_of_devices = 1 37 38 def teardown_class(self): 39 TelephonyBaseTest.teardown_class(self) 40 41 """ Tests Begin """ 42 43 @test_tracker_info(uuid="6831cf7f-349e-43ae-9a89-5e183a755671") 44 @TelephonyBaseTest.tel_test_wrap 45 def test_5g_nsa_mmw_activation_from_apm(self): 46 """ Verifies 5G NSA mmWave activation from Airplane Mode 47 48 Toggle Airplane mode on and off 49 Ensure phone attach, data on, LTE attach 50 Wait for 120 secs for ENDC attach 51 Verify is data network type is NR_NSA 52 53 Returns: 54 True if pass; False if fail. 55 """ 56 57 return test_activation_by_condition( 58 self.android_devices[0], 59 nr_type='mmwave', 60 precond_func=lambda: cycle_airplane_mode(self.android_devices[0])) 61 62 @test_tracker_info(uuid="21fb9b5c-40e8-4804-b05b-017395bb2e79") 63 @TelephonyBaseTest.tel_test_wrap 64 def test_5g_nsa_mmw_activation_from_reboot(self): 65 """ Verifies 5G NSA mmWave activation from Reboot 66 67 Reboot device 68 Ensure phone attach, data on, LTE attach 69 Wait for 120 secs for ENDC attach 70 Verify is data network type is NR_NSA 71 72 Returns: 73 True if pass; False if fail. 74 """ 75 76 return test_activation_by_condition( 77 self.android_devices[0], 78 nr_type='mmwave', 79 precond_func=lambda: reboot_device(self.android_devices[0])) 80 81 @test_tracker_info(uuid="2cef7ec0-ea74-458f-a98e-143d0be71f31") 82 @TelephonyBaseTest.tel_test_wrap 83 def test_5g_nsa_mmw_activation_from_3g(self): 84 """ Verifies 5G NSA mmWave activation from 3G Mode Pref 85 86 Change Mode to 3G and wait for 15 secs 87 Change Mode back to 5G 88 Ensure phone attach, data on, LTE attach 89 Wait for 120 secs for ENDC attach 90 Verify is data network type is NR_NSA 91 92 Returns: 93 True if pass; False if fail. 94 """ 95 96 return test_activation_by_condition(self.android_devices[0], 97 from_3g=True, 98 nr_type='mmwave') 99 100 """ Tests End """ 101