Beispiel #1
0
    def run_test(self):
        """
        Runs the test.
        """

        # Call inherited run_test method which will ensure IMS
        # IMS registration on device 1
        LiveLteImsVcDualBase.run_test(self)

        # Perform the IMS call procedure
        (verdict, message) = self._perform_ims_call(self._call_direction)

        # Because in case of failure the IMS stack may have crashed
        # we need to double-check the IMS registration status.
        in_service_status = ImsRegistrationStatus.in_service()
        registration_status = self._get_registration_status()
        self._logger.info(
            "Registration status: %s (%d)" %
            (str(registration_status), registration_status.as_int()))
        # Compute the verdict
        if registration_status != in_service_status:
            message = "IMS stack has crashed or IMS registration is lost."
            self._logger.error(message)
            verdict = Global.FAILURE

        # Return the test result
        return (verdict, message)
Beispiel #2
0
 def __init__(self, tc_name, global_config):
     """
     Initializes this instance.
     """
     # Call inherited initializer
     LiveLteImsVcDualBase.__init__(self, tc_name, global_config)
     # Retrieve ringing time parameter
     self._ringing_time = \
         int(self._tc_parameters.get_param_value("RINGING_TIME", 15))
Beispiel #3
0
    def tear_down(self):
        """
        Disposes this test.
        """
        # Write informative log message because some logs may appear
        # before the "tear down" log message from the framwork
        self._logger.info("Tear down: starting tear down operations.")
        # Release the call for both phones (Robustness only)
        self._voice_call_api.release()
        self._voice_call_api2.release()

        # Call the inherited tear_down method
        LiveLteImsVcDualBase.tear_down(self)

        # End of tear_down
        return (Global.SUCCESS, "No errors")
    def run_test(self):
        """
        Runs the test.
        """
        # Call inherited run_test method which will ensure IMS
        # IMS registration on device 1
        self._logger.info("")
        self._logger.info("Calling inherited run_test step.")
        self._logger.info("")
        LiveLteImsVcDualBase.run_test(self)

        # Initialize verdict variables
        verdict = Global.SUCCESS
        message = "No error."

        # Proceed with the scenario based on the Supplementary service
        self._logger.info("")
        self._logger.info("Executing requested tests.")
        self._logger.info("")
        if self._ims_ss_feature == "CALL_FORWARDING":
            (verdict, message) = self._check_call_forwarding()
        elif self._ims_ss_feature == "CALL_BARRING":
            (verdict, message) = self._perform_call_barring()

        if verdict == Global.FAILURE:
            # Because in case of failure the IMS stack may have crashed
            # we need to double-check the IMS registration status.
            in_service_status = ImsRegistrationStatus.in_service()
            registration_status = self._get_registration_status()
            self._logger.info(
                "Registration status: %s (%d)" %
                (str(registration_status), registration_status.as_int()))
            # Compute the verdict
            if registration_status != in_service_status:
                message = "IMS stack has crashed or IMS registration is lost."
                self._logger.error(message)
                verdict = Global.FAILURE

        # Return the test result
        return (verdict, message)
    def __init__(self, tc_name, global_config):
        """
        Initializes this instance.
        """
        # Call inherited initializer
        LiveLteImsVcDualBase.__init__(self, tc_name, global_config)

        # Read the Supplementary Service parameter
        self._ims_ss_feature = self._tc_parameters.get_param_value(
            "SS_FEATURE")

        # For call barring, retrieve the call barring activation code
        if "CALL_BARRING" in self._ims_ss_feature:
            self._cb_activation_code = self._tc_parameters.get_param_value(
                "CB_ACTIVATION_CODE", "")
        else:
            self._cb_activation_code = None
            self._logcat_extract = None

        # Read the Supplementary Service Mode parameter
        self._ims_ss_mode = self._tc_parameters.get_param_value("SS_MODE")

        # Read the Phone Number for Supplementary Service
        self._ims_ss_phone_number = self._tc_parameters.get_param_value(
            "SS_PHONE_NUMBER")

        # Delay introduced for the Supplementary Service activation or de-activation
        self._wait_ss_response = 30

        # Modify the call setup time in case the Supplementary Service is active
        self._call_setup_time = 30

        # Initialize the instances used for logcat parsing procedure
        self._at_cmd_parser = None
        self.logcat_extras = None
        if self._ims_ss_feature == "CALL_BARRING":
            self._parse_utils = LogcatParserUtils(self._device)
        else:
            self._parse_utils = None
    def tear_down(self):
        """
        Disposes this test.
        """
        # Initialize some local variables
        message = ""
        verdict = Global.SUCCESS

        # Log a message indicating that we are enterint the tear down step
        self._logger.info("Starting tear down operations")
        # Release the call for secondary DUT (Robustness only)
        try:
            self._voice_call_api2.release()
        except DeviceException as device_ex:
            self._logger.warning("Error in tear down step: %s" %
                                 str(device_ex))

        # Supplementary Service de-activation
        try:
            (verdict, message) = self._deactivate_ss_feature()
        except DeviceException as device_ex:
            self._logger.warning("Error in tear down step: %s" %
                                 str(device_ex))

        # Delete the logcat file
        if self._ims_ss_feature == "CALL_BARRING":
            try:
                self._parse_utils.delete_logcat_file()
            except AcsConfigException as excp:
                self._logger.debug(excp)

        # Call the inherited tear_down method
        LiveLteImsVcDualBase.tear_down(self)

        # End of tear_down
        return (verdict, message)
    def set_up(self):
        """
        Initializes the test.
        """
        LiveLteImsVcDualBase.set_up(self)

        # Check the parameter with the Supplementary Services feature
        if self._ims_ss_feature is None or \
            self._ims_ss_feature not in LiveLteImsVcSSDual.SS_FEATURES:

            message = "%s '%s' %s '%s'" % (
                "Invalid parameter value (or missing parameter)",
                str(self._ims_ss_feature), "for parameter", "SS_FEATURE")
            raise AcsConfigException(AcsConfigException.INVALID_PARAMETER,
                                     message)

        # Check the digest password in all cases too because it is used
        # for the XCAP requests
        if not self._digest_password:
            message = "%s %s" % (
                "Invalid parameter value: '%s'." % str(self._digest_password),
                "Parameter IMS_DIGEST_PASSWORD is mandatory for XCAP tests.")
            raise AcsConfigException(AcsConfigException.INVALID_PARAMETER,
                                     message)

        # Check the parameter related with Supplementary Services Mode
        if self._ims_ss_mode is None or \
            str(self._ims_ss_mode) not in LiveLteImsVcSSDual.SS_FEATURES[self._ims_ss_feature]:

            message = "%s '%s' %s '%s'" % (
                "Invalid parameter value (or missing parameter)",
                str(self._ims_ss_mode), "for parameter", "SS_MODE")
            raise AcsConfigException(AcsConfigException.INVALID_PARAMETER,
                                     message)

        # Use case limitation - only call forwarding and call barring supported for the moment
        if self._ims_ss_feature not in ("CALL_FORWARDING", "CALL_BARRING"):
            message = "For the moment, only '%s' and '%s' is supported by this use case" % (
                "CALL_FORWARDING", "CALL_BARRING")
            raise AcsConfigException(
                AcsConfigException.FEATURE_NOT_IMPLEMENTED, message)

        # Check the phone Number parameter in case of SS check/activation
        if self._ims_ss_phone_number is None:
            message = "%s '%s' %s '%s'" % (
                "Invalid parameter value (or missing parameter)",
                str(self._ims_ss_phone_number), "for parameter",
                "SS_PHONE_NUMBER")
            raise AcsConfigException(AcsConfigException.INVALID_PARAMETER,
                                     message)

        # For call barring check that activation code is present in the TC file
        if ("CALL_BARRING" in self._ims_ss_feature) and \
            (self._cb_activation_code is None):

            message = "%s '%s' %s '%s'" % (
                "Invalid parameter value (or missing parameter)",
                str(self._cb_activation_code), "for parameter",
                "CB_ACTIVATION_CODE")

        # Specific set up for XCAP
        self._logger.info("Applying configuration for XCAP")
        if self._ims_configure_modem_procedure == "IMS_ANDROID":
            self._apply_configurations("xcap")
        else:
            self._apply_configurations("xcap-at")

        # Force the reading of XCAP parameters from the modem NVM.
        self._logger.info(
            "Flight mode ON/OFF cycle in order to take XCAP parameters into account."
        )
        self._networking_api.set_flight_mode("on")
        # Wait arbitrary time
        time.sleep(30)
        self._networking_api.set_flight_mode("off")
        # Wait arbitrary time
        time.sleep(10)
        # Set up is done correctly
        return (Global.SUCCESS, "No errors")