Exemplo n.º 1
0
    def run_test(self):
        """
        Execute the test
        """
        # Call GSM VoiceCall base run_test function
        LabGsmVcBase.run_test(self)

        # Release any previous call (Robustness)
        self._voicecall_api.release()

        # Check PDP is active
        self._ns_data_2g.check_data_connection_state("PDP_ACTIVE", self._call_setup_time)

        # Mobile Terminated originate call
        self._ns_voice_call_2g.mt_originate_call()

        # pylint: disable=E1101
        # Wait for state "incoming" before callSetupTimeout seconds
        self._voicecall_api.wait_for_state(
            self._uecmd_types.VOICE_CALL_STATE.INCOMING,
            self._call_setup_time)

        # Answer call
        self._voicecall_api.answer()

        # Check call state "CONNECTED" before callSetupTimeout seconds
        self._ns_voice_call_2g.check_call_connected(self._call_setup_time,
                                                    blocking=False)

        # Wait for state "active" before callSetupTimeout seconds
        self._voicecall_api.wait_for_state(
            self._uecmd_types.VOICE_CALL_STATE.ACTIVE,
            self._call_setup_time)

        # Check Data is suspended
        self._ns_data_2g.check_data_connection_state("SUSPENDED", self._call_setup_time)

        # Check call is connected for CALL_DURATION seconds
        self._ns_voice_call_2g.is_voice_call_connected(self._call_duration)

        # Network Release call
        self._ns_voice_call_2g.voice_call_network_release()

        # Check voice call state is "IDLE" (8960)
        self._ns_voice_call_2g.check_call_state("IDLE", self._call_setup_time, blocking=False)

        # Check voice call state is "no_call" (CDK)
        self._voicecall_api.wait_for_state(
            self._uecmd_types.VOICE_CALL_STATE.NOCALL,
            self._call_setup_time)

        # Check PDP is active
        self._ns_data_2g.check_data_connection_state("PDP_ACTIVE", self._call_setup_time)

        # pylint: enable=E1101
        return Global.SUCCESS, "No errors"
Exemplo n.º 2
0
    def run_test(self):
        """
        Execute the test
        """
        # pylint: disable=E1101
        # Disable this pylint error due to Enum class VOICE_CALL_STATE

        # Call GSM VoiceCall base run_test function
        LabGsmVcBase.run_test(self)

        # Release any previous call (Robustness)
        self._voicecall_api.release()

        # Check PDP is active
        self._ns_data_2g.check_data_connection_state("PDP_ACTIVE",
                                                     self._call_setup_time)

        # Dial using PHONE_NUMBER parameter
        self._voicecall_api.dial(self._phone_number)

        # Check call state "CONNECTED" before callSetupTimeout seconds
        self._ns_voice_call_2g.check_call_connected(self._call_setup_time,
                                                    blocking=False)

        # Wait for state "active" before callSetupTimeout seconds
        self._voicecall_api.wait_for_state(
            self._uecmd_types.VOICE_CALL_STATE.ACTIVE, self._call_setup_time)

        # Check Data is suspended
        self._ns_data_2g.check_data_connection_state("SUSPENDED",
                                                     self._call_setup_time)

        # Check call is connected for CALL_DURATION seconds
        self._ns_voice_call_2g.is_voice_call_connected(self._call_duration)

        # Mobile Release call
        self._voicecall_api.release()

        # Check voice call state is "IDLE" (8960)
        self._ns_voice_call_2g.check_call_state("IDLE",
                                                self._call_setup_time,
                                                blocking=False)

        # Check voice call state is "no_call" (CDK)
        time.sleep(self._wait_btwn_cmd)
        self._voicecall_api.wait_for_state(
            self._uecmd_types.VOICE_CALL_STATE.NOCALL, self._call_setup_time)

        # Check PDP is active
        self._ns_data_2g.check_data_connection_state("PDP_ACTIVE",
                                                     self._call_setup_time)

        # pylint: enable=E1101
        return Global.SUCCESS, "No errors"
Exemplo n.º 3
0
 def run_test(self):
     """
     Execute the test
     """
     # Call GSM VoiceCall base run_test function
     LabGsmVcBase.run_test(self)
     # Release any previous call (Robustness)
     self._voicecall_api.release()
     # Turn off the CLIP.
     self._ns_voice_call_2g.include_calling_party_number("OFF")
     # Calling the DUT from the network simulator.
     self._ns_voice_call_2g.mt_originate_call()
     # Waiting for the phone to receive the call, not need to answer the
     # call.
     # pylint: disable=E1101
     # As pylint is not able to resolve enum types
     self._voicecall_api.wait_for_state(
         self._uecmd_types.VOICE_CALL_STATE.INCOMING, self._call_setup_time)
     # pylint: enable=E1101
     # Once the alerting state has been reached release the call on the
     # network simulator.
     self._ns_voice_call_2g.voice_call_network_release()
     time.sleep(self._wait_btwn_cmd)
     # Getting the last call information from DUT.
     (number, call_type, _sim) = self._voicecall_api.get_last_call_details()
     # Checking the last call type is missed.
     self._logger.info("Checking last call type is MISSED.")
     # pylint: disable=E1101
     # As pylint is not able to resolve enum types
     if call_type != str(self._uecmd_types.VOICE_CALL_TYPE.MISSED):
         # pylint: enable=E1101
         return (Global.FAILURE,
                 "Last call should be MISSED, is: %s" % call_type)
     # Checking the last call number not displayed on the DUT.
     self._logger.info("Checking last call number is private")
     # "" is the phone number returned when the number is unknown
     if number != "":
         return (Global.FAILURE, "The CLIP is not included but the phone"
                 " number was shown. Incoming number: %s" % number)
     time.sleep(self._wait_btwn_cmd)
     # Turn the CLIP on.
     self._ns_voice_call_2g.include_calling_party_number("ON")
     self._ns_voice_call_2g.set_calling_party_pi("ALLOWED")
     # Set the phone number the network simulator will use to call the DUT.
     self._ns_voice_call_2g.set_calling_party_number(self._phone_number)
     # Calling the DUT from the network simulator.
     self._ns_voice_call_2g.mt_originate_call()
     # Waiting for the phone to receive the call, not need to answer the
     # call.
     # pylint: disable=E1101
     # As pylint is not able to resolve enum types
     self._voicecall_api.wait_for_state(
         self._uecmd_types.VOICE_CALL_STATE.INCOMING, self._call_setup_time)
     # pylint: enable=E1101
     self._ns_voice_call_2g.voice_call_network_release()
     time.sleep(self._wait_btwn_cmd)
     # Getting the last call information from DUT.
     (number, call_type, _sim) = self._voicecall_api.get_last_call_details()
     # Checking the last call type is missed.
     self._logger.info("Checking last call type is MISSED.")
     # pylint: disable=E1101
     # As pylint is not able to resolve enum types
     if call_type != str(self._uecmd_types.VOICE_CALL_TYPE.MISSED):
         # pylint: enable=E1101
         return (Global.FAILURE,
                 "Last call should be MISSED, is: %s" % call_type)
     # Checking the last call number is the expected one.
     self._logger.info("Checking last call number is displayed on DUT and"
                       " is the same as the one given as parameter.")
     if number != self._phone_number:
         return (Global.FAILURE, "The CLIP is included but the phone"
                 " number shown on the DUT is not the same"
                 " as the  one set on the network"
                 " simulator. Incoming number: %s" % number)
     return Global.SUCCESS, "No errors"
    def run_test(self):
        """
        Execute the test
        """
        # pylint: disable=E1101
        # Disable this pylint error due to Enum class VOICE_CALL_STATE

        # Call GSM VoiceCall base run_test function
        LabGsmVcBase.run_test(self)

        # Update the list of RIL Emergency Numbers on the DUT
        # This imperatively has to be done after settting the Flight Mode
        self._logger.info("Add Emergency Number in ril.ecclist list")
        if self._is_emergency_number:
            # Update the property holding the Emergency Numbers list.
            self._device.set_property_value(
                LabGsmFlightmodeEmVc.EMERGENCY_NUMBER_PROPERTY_NAME,
                self._phone_number)

        self._logger.info("Add Emergency Number in NVM:cust.emergency list "
                           "at index %s" % self._index)
        #Start up the proxy for sending AT commands
        self.at_proxy_com_port = self._modem_flashing_api.start_at_proxy_from_mos(
                                                                        int(self._launch_mode))
        #check serial connection
        self._serial_handler.set_data_analyser(
            ATCommandAnalyser(self._expected_result))
        self._serial_handler.set_default_timeout(self._command_timeout)
        self._logger.info("Connecting to the port " + str(self.at_proxy_com_port))

        # Connect to the at proxy
        self._serial_handler.connect(self.at_proxy_com_port)

        # Check that the modem is available
        modem_status = self._modem_flashing_api.ping_modem_from_serial(
            self._serial_handler.get_serial())

        if modem_status:
            self._logger.info("AT Proxy correctly respond to ping command")
            self.modem_available = True
        else:
            raise TestEquipmentException(TestEquipmentException.CONNECTION_ERROR,
                                         "Connection to AT proxy failed")
        #Send AT@NVM to get initial parameters stored at index "self.index" for restore at
        #finalize
        self._logger.info("Read NVM:cust.emergency list at index %s" % self._index)
        inerrogate_at_nvm_command = self._command + "[" + \
                                    str(self.index) + "]" + "?"
        self._logger.info("Send AT command: %s" % inerrogate_at_nvm_command)
        self._at_inter_nvm_em_verdict, at_nvm_params_to_be_rest_raw =\
                self._serial_handler.send_at_command_and_get_result(inerrogate_at_nvm_command, self._command_timeout)
        at_nvm_params_to_be_rest = re.match("{*.*}", at_nvm_params_to_be_rest_raw)
        at_nvm_params_to_be_rest = at_nvm_params_to_be_rest.group(0)
        self._logger.info("Data read from NVM:cust.emergency list at index %s are: %s" % (
                          self._index, at_nvm_params_to_be_rest))
        self.command_to_rest_em_in_nvm = "%s[%s]=%s" % (str(self._command),
                                                        str(self._index),
                                                        str(at_nvm_params_to_be_rest))
        #Send AT@NVM to add an emergency number to NNV emergency number list
        self._logger.info("Add NVM:cust.emergency number \"%s\" "
                           "at index %s" % (self._phone_number, self._index))
        self._at_set_nvm_em, msg = self._serial_handler.send_at_command_and_get_result(
                                            self.command_to_add_em_in_nvm, self._command_timeout)
        if msg == "OK":
            self._logger.info("Response to AT command %s "
                               "is: %s" % (self.command_to_add_em_in_nvm, msg))
        else:
            raise DeviceException(DeviceException.OPERATION_SET_ERROR,
                                  "Response to AT command %s is: %s" % (
                                        self.command_to_add_em_in_nvm, msg))

        self._logger.info("Start the Emergency Call when DUT is in Flight Mode")
        # Release any previous call (Robustness)
        self._voicecall_api.release()

        # Enable flight mode
        self._networking_api.set_flight_mode("on")

        # Wait 30 seconds to be sure that modem is down before dialing
        time.sleep(30)

        # Wake the screen otherwise the Voice Call will not be established
        self._phone_system.wake_screen()
        self._phone_system.set_phone_lock(0)

        # Dial using PHONE_NUMBER parameter
        self._voicecall_api.dial(self._phone_number)

        # Check call state "CONNECTED" before callSetupTimeout seconds
        self._ns_voice_call_2g.check_call_connected(self._call_setup_time,
                                                    blocking=False)

        # Wait for state "active" before callSetupTimeout seconds
        self._voicecall_api.wait_for_state(
            self._uecmd_types.VOICE_CALL_STATE.ACTIVE,
            self._call_setup_time)

        # Check call is connected for CALL_DURATION seconds
        self._ns_voice_call_2g.is_voice_call_connected(self._call_duration)

        # Mobile Release call
        self._voicecall_api.release()

        # Check voice call state is "IDLE" (8960)
        self._ns_voice_call_2g.check_call_state("IDLE",
                                                self._call_setup_time,
                                                blocking=False)

        # pylint: disable=E1101
        # Disable this pylint error due to Enum class VOICE_CALL_STATE
        # Check voice call state is "no_call" (CDK)
        time.sleep(self._wait_btwn_cmd)
        self._voicecall_api.wait_for_state(
            self._uecmd_types.VOICE_CALL_STATE.NOCALL,
            self._call_setup_time)
        # pylint: enable=E1101

        # Disable flight mode
        self._networking_api.set_flight_mode("off")

        return Global.SUCCESS, "No errors"