Beispiel #1
0
 def run_once(self, family):
     test_env = test_environment.CellularPseudoMMTestEnvironment(
         pseudomm_args=({
             'family': family
         }, ))
     self._chrome_testing = cntc.ChromeNetworkingTestContext()
     with test_env, self._chrome_testing:
         self._family = family
         self._run_once_internal()
 def _test_cdma(self):
     """ Checks the service name for a CDMA network. """
     logging.info('Testing service name for CDMA')
     self.test_env = test_environment.CellularPseudoMMTestEnvironment(
         pseudomm_args=({
             'family': 'CDMA',
             'test-module': TEST_MODEMS_MODULE_PATH,
             'test-modem-class': 'TestCdmaModem'
         }, ))
     with self.test_env:
         self._verify_service_name(TEST_CDMA_CARRIER)
Beispiel #3
0
    def run_once(self):
        tests = [
            ActivationStateTest(self),
            ActivationSuccessTest(self),
            ActivationFailureRetryTest(self)
        ]

        for test in tests:
            self.test_env = test_environment.CellularPseudoMMTestEnvironment(
                pseudomm_args=(test.pseudomodem_flags(), ))
            with self.test_env:
                test.run()
Beispiel #4
0
    def Run(self):
        """
        Runs the test.

        @raises test.TestFail, if |test_modem| hasn't been initialized.

        """
        self.test_env = test_environment.CellularPseudoMMTestEnvironment(
                pseudomm_args=(
                        {'test-module' : __file__,
                         'test-modem-class' : self._GetTestModemFunctorName(),
                         'test-modem-arg' : [self._pseudomodem_family]},))
        with self.test_env:
            self._RunTest()
Beispiel #5
0
    def run_once(self):
        """Calls by autotest to run this test."""
        self.test_env = test_environment.CellularPseudoMMTestEnvironment(
            pseudomm_args=({
                'family': '3GPP'
            }, ))
        with self.test_env, shill_context.ServiceAutoConnectContext(
                self.test_env.shill.wait_for_cellular_service_object, False):
            self.pseudomm = pm_proxy.PseudoMMProxy.get_proxy()
            self.modem = self.pseudomm.get_modem()

            self._test_provisioned()
            self._test_out_of_credits_at_start()
            self._test_out_of_credits_while_connected()
    def _test_3gpp_no_roaming(self):
        """
        Checks the service name when the SIM and the network is the same
        carrier.

        """
        logging.info('Testing service name for 3GPP no roaming')
        self.test_env = test_environment.CellularPseudoMMTestEnvironment(
            pseudomm_args=({
                'family': '3GPP',
                'test-module': TEST_MODEMS_MODULE_PATH,
                'test-sim-class': 'TestSIM'
            }, ))
        with self.test_env:
            self._verify_service_name(TEST_3GPP_HOME_CARRIER)
Beispiel #7
0
    def run_once(self):
        """Called by autotest to run this test."""

        with test_environment.CellularPseudoMMTestEnvironment(
                pseudomm_args=({
                    'family': '3GPP'
                }, )) as self.test_env:
            self._init()

            tests = [
                self._test_temporary_registration_loss,
                self._test_permanent_registration_loss
            ]

            for test in tests:
                test()
Beispiel #8
0
    def run_once(self):
        """Entry function into the test."""
        random.seed()
        test_list = [self.test_unsuccessful_enable_lock,
                     self.test_cause_sim_pin_lock,
                     self.test_unlock_sim_pin_lock,
                     self.test_cause_sim_puk_lock,
                     self.test_unlock_sim_puk_lock,
                     self.test_brick_sim,
                     self.test_change_pin]

        # Some of these tests render the modem unusable, so run each test
        # with a fresh pseudomodem.
        for test in test_list:
            self.test_env = test_environment.CellularPseudoMMTestEnvironment(
                    pseudomm_args=({'family': '3GPP'},))
            with self.test_env:
                self._run_internal(test)
Beispiel #9
0
    def run_once(self):
        tests = [
            ActivationResetTest(self),
            ActivationCompleteTest(self),
            ActivationDueToMdnTest(self),
        ]

        for test in tests:
            self.test_env = test_environment.CellularPseudoMMTestEnvironment(
                    pseudomm_args = ({'family' : '3GPP',
                                      'test-module' : TEST_MODEMS_MODULE_PATH,
                                      'test-modem-class' : test.TestModemClass(),
                                      'test-sim-class' : 'TestSIM'},))
            with self.test_env:
                self.pseudomm = pm_proxy.PseudoMMProxy.get_proxy()
                # Set the reset flag to False explicitly before each test
                # sequence starts to ignore the reset as a part of the test init
                self.SetResetCalled(False)
                test.Run()
    def _test_3gpp_roaming(self):
        """
        Checks the service name when roaming.

        The service name while roaming should be (per 3GPP TS 31.102 and
        annex A of 122.101):
                <home provider> | <serving operator>

        """
        logging.info('Testing service name for 3GPP roaming')
        self.test_env = test_environment.CellularPseudoMMTestEnvironment(
            pseudomm_args=({
                'family': '3GPP',
                'test-module': TEST_MODEMS_MODULE_PATH,
                'test-modem-class': 'TestModemRoaming',
                'test-sim-class': 'TestSIM'
            }, ))
        with self.test_env:
            expected_name = (TEST_3GPP_HOME_CARRIER + ' | ' +
                             TEST_3GPP_ROAMING_CARRIER)
            self._verify_service_name(expected_name)
    def run_once(self, mask_points):
        # Emulate a modem on the device.
        test_env = test_environment.CellularPseudoMMTestEnvironment(
            pseudomm_args=({
                'family': '3GPP'
            }, ),
            use_backchannel=False,
            shutdown_other_devices=False)

        with test_env:
            self.mask_points = mask_points

            # Check if we should find mobile data in settings
            # This should always return true now, since the modem is software
            # emulated.
            modem_status = utils.system_output('modem status')
            if modem_status:
                logging.info('Modem found')
                logging.info(modem_status)
                self.tagged_testname += '.mobile'
            else:
                logging.info('Modem not found')
            self.run_screenshot_comparison_test()