Esempio n. 1
0
 def tear_down(self):
     """
     Closing the test.
     """
     # Turn off the CLIP.
     self._ns_voice_call_2g.include_calling_party_number("OFF")
     # Release all possible ongoing calls.
     self._ns_voice_call_2g.voice_call_network_release()
     # Call GSM VoiceCall base tear_down function
     LabGsmVcBase.tear_down(self)
     return Global.SUCCESS, "No errors"
    def tear_down(self):
        """
        End and dispose the test
        """

        # Disable flight mode in the first place in any case
        self._networking_api.set_flight_mode("off")

        self._logger.info("Restore initial emergency numbers in ril.ecclist list")
        # Restore the list of emergency number in UE Command categories
        # if we changed it in the beginning of the Use Case
        if self._is_emergency_number:
            UECmdTypes.EMERGENCY_NUMBERS_LIST = self._initial_ue_command_em_number

            # Restore the list of emergency numbers
            self._device.set_property_value(
                LabGsmFlightmodeEmVc.EMERGENCY_NUMBER_PROPERTY_NAME,
                self._initial_emergency_numbers)

        # Call power measurement base tear_down function
        LabGsmVcBase.tear_down(self)
        if self.modem_available and (self._at_set_nvm_em is not None):
            self._logger.info("Restore initial emergency numbers in "
                               "NVM:cust.emergency list at index %s" % self._index)
            response, msg = self._serial_handler.send_at_command_and_get_result(self.command_to_rest_em_in_nvm,
                                                           self._command_timeout)
            if msg == "OK":
                self._logger.info("Response to AT command %s is: %s" % (
                                     self.command_to_rest_em_in_nvm, msg))
            else:
                raise DeviceException(DeviceException.OPERATION_SET_ERROR,
                                      "Response to AT command %s is: %s" % (
                                          self.command_to_rest_em_in_nvm, msg))
        #Stop AT Proxy
        self._logger.info("Stop AT Proxy")
        self._modem_flashing_api.stop_at_proxy_from_mos()

        #Close the serial connection
        self._logger.info("Close the serial connection")
        self._logger.info("Disconnecting from the port " +
                            str(self._serial_handler.get_port()))
        self._serial_handler.disconnect()

        return Global.SUCCESS, "No errors"