Esempio n. 1
0
    def run_test(self):
        """
        Execute the test
        """

        # Call LabMobilityLte3gsmBase run_test function
        LabMobilityLte3gsmBase.run_test(self)

        # Clear old SMS on phone
        self._messaging_api.delete_all_sms()

        # Clear old SMS on Network Simulator
        self._ns_3gsm_messaging.clear_message_data()

        self._sms.send_sms()

        self._sms.get_sms()

        return Global.SUCCESS, "No errors"
    def run_test(self):
        """
        Execute the test
        """

        # Call LabMobilityLte3gsmBase run_test function
        LabMobilityLte3gsmBase.run_test(self)

        # Check Data Connection State => CON before timeout
        self._ns_3gsm_data.check_data_connection_state(
            "PDP_ACTIVE", self._registration_timeout, blocking=True)

        # Check registration state is connected using
        # registrationTimeout from Device_Catalog.xml
        self._logger.info("Check network registration status is %s on DUT" %
                          self._wanted_reg_state)
        self._modem_api.check_cdk_state_bfor_timeout(
            self._wanted_reg_state, self._registration_timeout)
        # Check that DUT is registered on the good RAT
        self._modem_api.check_network_type_before_timeout(
            self._ns_3gsm_data.get_network_type(), self._registration_timeout)
        if self._ns_3gsm_cell_tech == "3G":
            # transition the DUT to RRC_Idle if the UE is on a PDP Context in CELL_DCH or CELL_FACH state
            self._ns_3gsm_cell.set_rrc_state_transition("IDLE")
        # set the resel power
        self._ns_lte_cell.set_cell_power(self._cresel_power)

        msg = "Begin to decrease Camped cell power from %.2f dBm "
        msg += "to %.2f dBm each %d seconds by step of %.2f dBm while "
        msg += "cell reselection isn't performed."
        self._logger.info(msg, self._ns_camped_power, self._cresel_limit_power,
                          self._decrementation_step_timer,
                          self._decrementation_step_power)

        # Decrease cell power on 3GSM and wait for DUT to be camped on LTE
        # and log the result in msg
        msg = self.decrease_cell_power_while_idle(
            self._ns_3gsm_cell, self._ns_camped_power, self._ns_lte_cell,
            self._ns_lte_data, self._ns_lte_cell_service,
            self._decrementation_step_power, self._decrementation_step_timer,
            self._cresel_limit_power, self._cresel_power, self._ns1_model)

        self._ns_neighbour_power = self._cresel_limit_power
        self._ns_camped_power = self._cresel_power

        # Display Cell reselection result
        self._logger.info(msg)

        # Check Data Connection State => CON before timeout
        self._ns_lte_data.check_data_connection_state(
            "CON",
            self._registration_timeout,
            blocking=True,
            cell_id=self._ns_lte_cell_id)
        # Display Cell reselection result
        self._logger.info(msg)

        self._logger.info("wait 10 sec after registering on LTE Cell")
        time.sleep(10)

        # in all other cell reselection cases a ping is performed
        packet_loss = self._networking_api.ping(self._server_ip_address,
                                                self._packet_size,
                                                self._nb_pings)

        # Compute verdict depending on % of packet loss
        if packet_loss.value > self._target_ping_packet_loss_rate:
            result_verdict = Global.FAILURE
        else:
            result_verdict = Global.SUCCESS

        message = "Measured Packet Loss: %.0f%s (Target: %.0f%s)"\
            % (packet_loss.value,
               packet_loss.units,
               self._target_ping_packet_loss_rate,
               packet_loss.units)
        self._logger.info(message)

        result_message = "cell reselection is done"

        # if we want to do a return cell reselection (go back)
        if self._back_and_forth:
            msg = "Begin to decrease Camped cell power from %.2f dBm "
            msg += "to %.2f dBm each %d seconds by step of %.2f dBm while "
            msg += "cell reselection isn't performed."
            self._logger.info(msg, self._ns_camped_power,
                              self._cresel_limit_power,
                              self._decrementation_step_timer,
                              self._decrementation_step_power)

            # Decrease cell power on NS1 and wait for DUT to be camped on NS2
            # and log the result in msg
            msg = self.decrease_cell_power_while_idle(
                self._ns_lte_cell, self._ns_camped_power, self._ns_3gsm_cell,
                self._ns_3gsm_data, self._ns_3gsm_cell_service,
                self._decrementation_step_power,
                self._decrementation_step_timer, self._cresel_limit_power,
                self._cresel_power, self._ns2_model)

            self._ns_neighbour_power = self._cresel_limit_power
            self._ns_camped_power = self._cresel_power

            # Display Cell reselection result
            self._logger.info(msg)

            # Check Data Connection State => CON before timeout
            self._ns_3gsm_data.check_data_connection_state(
                "ATTACHED",
                self._registration_timeout,
                blocking=True,
                cell_id=self._ns_lte_cell_id)
            self._logger.info("wait 10 sec after registering on 3GSM Cell")
            time.sleep(10)

            # in all other cell reselection cases a ping is performed
            packet_loss = self._networking_api.\
                ping(self._server_ip_address,
                     self._packet_size,
                     self._nb_pings)

            # Compute verdict depending on % of packet loss
            if packet_loss.value > self._target_ping_packet_loss_rate:
                result_verdict = Global.FAILURE
                message = "Ping after cell reselection failed & Measured Packet Loss: %.0f%s (Target: %.0f%s)"\
                % (packet_loss.value,
                   packet_loss.units,
                   self._target_ping_packet_loss_rate,
                   packet_loss.units)
                return (result_verdict, message)
            else:
                result_verdict = Global.SUCCESS
                result_message = "cell reselection is done"

            message = "Measured Packet Loss: %.0f%s (Target: %.0f%s)"\
                % (packet_loss.value,
                   packet_loss.units,
                   self._target_ping_packet_loss_rate,
                   packet_loss.units)
            self._logger.info(message)

        return result_verdict, result_message
    def run_test(self):
        """
        Execute the test
        """

        # Call LabMobilityLte3gsmBase run_test function
        LabMobilityLte3gsmBase.run_test(self)

        # Set Network Simulator 3GSM cell off
        self._ns_3gsm_cell.set_cell_off()
        # Check Data Connection State => CON before timeout
        self._ns_lte_data.check_data_connection_state(
            "CON",
            self._registration_timeout,
            blocking=True,
            cell_id=self._ns_lte_cell_id)
        # Check registration state is connected using
        # registrationTimeout from Device_Catalog.xml
        self._logger.info("Check network registration status is %s on DUT" %
                          self._wanted_reg_state)
        self._modem_api.check_cdk_state_bfor_timeout(
            self._wanted_reg_state, self._registration_timeout)
        # Check that DUT is registered on the good RAT
        self._modem_api.check_network_type_before_timeout(
            self._ns_lte_data.get_network_type(), self._registration_timeout)
        # Set Network Simulator 3GSM cell on
        self._ns_3gsm_cell.set_cell_on()

        # Disconnect from external EPC
        self._ns_3gsm.disconnect_from_external_epc()
        #  Set External EPC connection
        self._ns_3gsm_cell.set_external_epc_connection(self._ns_lte_ip_lan1,
                                                       self._ns_lte_dl_earfcn)

        msg = "Begin to decrease Camped cell power from %.2f dBm "
        msg += "to %.2f dBm each %d seconds by step of %.2f dBm while "
        msg += "cell reselection isn't performed."
        self._logger.info(msg, self._ns_camped_power, self._cresel_limit_power,
                          self._decrementation_step_timer,
                          self._decrementation_step_power)

        # Decrease cell power on NS1 and wait for DUT to be camped on NS2
        # and log the result in msg
        msg = self.decrease_cell_power_while_idle(
            self._ns_lte_cell, self._ns_camped_power, self._ns_3gsm_cell,
            self._ns_3gsm_data, self._ns_3gsm_cell_service,
            self._decrementation_step_power, self._decrementation_step_timer,
            self._cresel_limit_power, self._cresel_power, self._ns2_model)
        self._ns_neighbour_power = self._cresel_limit_power
        self._ns_camped_power = self._cresel_power

        # Display Cell reselection result
        self._logger.info(msg)

        # Case LTE to GSM
        # if the reselection is performed to GSM cell, send an MO SMS
        if self._ns_3gsm_cell_service == "GSM":
            # Send MO SMS
            self._messaging_api.send_sms(self.sms.sender, self.sms.message)
            # Check the MO SMS received On Network Simulator
            (result_verdict, result_message) = \
                self._ns_3gsm_messaging.check_sms_delivery_state(self.sms, 1, self._registration_timeout)
            # Test LTE to GSM cell reselection is finished
            return result_verdict, result_message

        # Case LTE to EGPRS or UTRA
        else:
            # Activate PDP context
            self._logger.info("Active PDP Context...")
            self._networking_api.activate_pdp_context(self._ssid)
            # Check Data Connection State => PDP Active before timeout
            self._ns_3gsm_data.check_data_connection_state(
                "PDP_ACTIVE", self._registration_timeout)
            self._logger.info("wait 10 sec after PDP activation")
            time.sleep(10)

            # in all other cell reselection cases a ping is performed
            packet_loss = self._networking_api.\
                ping(self._server_ip_address,
                     self._packet_size,
                     self._nb_pings)

            # Compute verdict depending on % of packet loss
            if packet_loss.value > self._target_ping_packet_loss_rate:
                result_verdict = Global.FAILURE
                message = "Ping after cell reselection failed & Measured Packet Loss: %.0f%s (Target: %.0f%s)"\
                % (packet_loss.value,
                   packet_loss.units,
                   self._target_ping_packet_loss_rate,
                   packet_loss.units)
                return (result_verdict, message)
            else:
                result_verdict = Global.SUCCESS

            message = "Measured Packet Loss: %.0f%s (Target: %.0f%s)"\
                % (packet_loss.value,
                   packet_loss.units,
                   self._target_ping_packet_loss_rate,
                   packet_loss.units)
            self._logger.info(message)
            result_message = "cell reselection is done"

        # if we want to do a return cell reselection (go back)
        if self._back_and_forth:
            msg = "Begin to decrease Camped cell power from %.2f dBm "
            msg += "to %.2f dBm each %d seconds by step of %.2f dBm while "
            msg += "cell reselection isn't performed."
            self._logger.info(msg, self._ns_camped_power,
                              self._cresel_limit_power,
                              self._decrementation_step_timer,
                              self._decrementation_step_power)

            if self._ns_3gsm_cell_tech == "3G":
                if self._ns_3gsm_data.get_rrc_states() not in "IDLE":
                    self._logger.info(
                        "RRC state is %s , in order to be able to do cell reselection DUT must be in IDLE state"
                        % self._ns_3gsm_data.get_rrc_states())
                    # Make sure that RRC state is IDLE in order to perform cell reselection
                    self._ns_3gsm_cell.set_rrc_state_transition("IDLE")

            # Decrease cell power on 3GSM and wait for DUT to be camped on LTE
            # and log the result in msg
            msg = self.decrease_cell_power_while_idle(
                self._ns_3gsm_cell, self._ns_camped_power, self._ns_lte_cell,
                self._ns_lte_data, self._ns_lte_cell_service,
                self._decrementation_step_power,
                self._decrementation_step_timer, self._cresel_limit_power,
                self._cresel_power, self._ns1_model)
            self._ns_neighbour_power = self._cresel_limit_power
            self._ns_camped_power = self._cresel_power

            # Display Cell reselection result
            self._logger.info(msg)

            # Check Data Connection State => CON before timeout
            self._ns_lte_data.check_data_connection_state(
                "CON",
                self._registration_timeout,
                blocking=True,
                cell_id=self._ns_lte_cell_id)
            self._logger.info("wait 10 sec after registering on LTE Cell")
            time.sleep(10)

            # in all other cell reselection cases a ping is performed
            packet_loss = self._networking_api.\
                ping(self._server_ip_address,
                     self._packet_size,
                     self._nb_pings)

            # Compute verdict depending on % of packet loss
            if packet_loss.value > self._target_ping_packet_loss_rate:
                result_verdict = Global.FAILURE
                message = "Ping after second cell reselection failed & Measured Packet Loss: %.0f%s (Target: %.0f%s)"\
                % (packet_loss.value,
                   packet_loss.units,
                   self._target_ping_packet_loss_rate,
                   packet_loss.units)
                return (result_verdict, message)
            else:
                result_verdict = Global.SUCCESS

            message = "Measured Packet Loss: %.0f%s (Target: %.0f%s)"\
                % (packet_loss.value,
                   packet_loss.units,
                   self._target_ping_packet_loss_rate,
                   packet_loss.units)
            self._logger.info(message)
            result_message = "cell reselection is done"

        return result_verdict, result_message
Esempio n. 4
0
    def run_test(self):
        """
        Execute the test
        """

        # Call LabMobilityLte3gsmBase run_test function
        LabMobilityLte3gsmBase.run_test(self)

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

        # Check registration state is connected using
        # registrationTimeout from Device_Catalog.xml
        self._modem_api.check_cdk_registration_bfor_timeout(
            self._registration_timeout)

        # Set the APN
        time.sleep(self._wait_btwn_cmd)
        self._logger.info("Setting APN " + str(self._apn) + "...")
        self._networking_api.set_apn(self._ssid, self._apn)

        # Activate PDP context
        time.sleep(self._wait_btwn_cmd)
        self._logger.info("Active PDP Context...")
        self._networking_api.activate_pdp_context(self._ssid, check=False)

        # Check Data Connection State => CON before timeout
        self._ns_lte_data.check_data_connection_state(
            "CON",
            self._registration_timeout,
            blocking=True,
            cell_id=self._ns_lte_cell_id)

        # Check that DUT is registered on the good RAT
        self._modem_api.check_network_type_before_timeout(
            self._ns_lte_data.get_network_type(), self._registration_timeout)

        # in all other cell reselection cases a ping is performed
        packet_loss = self._networking_api.ping(self._server_ip_address,
                                                self._packet_size,
                                                self._nb_pings)

        # Compute verdict depending on % of packet loss
        if packet_loss.value > self._target_ping_packet_loss_rate:
            result_verdict = Global.FAILURE
            message = "Ping after cell camp failed & Measured Packet Loss: %.0f%s (Target: %.0f%s)"\
                      % (packet_loss.value,
                         packet_loss.units,
                         self._target_ping_packet_loss_rate,
                         packet_loss.units)
            return (result_verdict, message)
        else:
            result_verdict = Global.SUCCESS

        message = "Measured Packet Loss: %.0f%s (Target: %.0f%s)"\
            % (packet_loss.value,
               packet_loss.units,
               self._target_ping_packet_loss_rate,
               packet_loss.units)
        self._logger.info(message)
        result_message = "cell camp is done"

        return result_verdict, result_message
    def run_test(self):
        """
        Execute the test
        """

        # Call LabMobilityLte3gsmBase run_test function
        LabMobilityLte3gsmBase.run_test(self)

        # Set Network Simulator 3GSM cell off
        self._ns_3gsm_cell.set_cell_off()
        # Check Data Connection State => CON before timeout
        self._ns_lte_data.check_data_connection_state(
            "CON",
            self._registration_timeout,
            blocking=True,
            cell_id=self._ns_lte_cell_id)
        # Check registration state is connected using
        # registrationTimeout from Device_Catalog.xml
        self._logger.info("Check network registration status is %s on DUT" %
                          self._wanted_reg_state)
        self._modem_api.check_cdk_state_bfor_timeout(
            self._wanted_reg_state, self._registration_timeout)
        # Check that DUT is registered on the good RAT
        self._modem_api.check_network_type_before_timeout(
            self._ns_lte_data.get_network_type(), self._registration_timeout)

        # Set Network Simulator 3GSM cell on
        self._ns_3gsm_cell.set_cell_on()

        # Disconnect from external EPC
        self._ns_3gsm.disconnect_from_external_epc()
        #  Set External EPC connection
        self._ns_3gsm_cell.set_external_epc_connection(self._ns_lte_ip_lan1,
                                                       self._ns_lte_dl_earfcn)

        # Wait 5 seconds
        time.sleep(5)

        # Set primary cell to first cell
        self._cell_in_use = 1
        cell_parms = self._1_to_2_cell_parms
        self._logger.info("Go out of coverage then switch to cell %d",
                          self._cell_in_use)
        self.go_out_of_coverage_and_cresel(*cell_parms)
        self._logger.info("End out of coverage procedure")

        # Case LTE to GSM
        # if the reselection is performed to GSM cell, send an MO SMS
        if self._ns_3gsm_cell_service == "GSM":
            # Send MO SMS
            self._messaging_api.send_sms(self.sms.sender, self.sms.message)
            # Check the MO SMS received On Network Simulator
            (result_verdict, result_message) = \
                self._ns_3gsm_messaging.check_sms_delivery_state(self.sms, 1, self._registration_timeout)
            # Test LTE to GSM cell reselection is finished
            return result_verdict, result_message

        # Case LTE to EGPRS or UTRA
        else:
            # Activate PDP context
            self._logger.info("Active PDP Context...")
            self._networking_api.activate_pdp_context(self._ssid)
            # Check Data Connection State => PDP Active before timeout
            if (self._ns_3gsm_data.check_data_connection_state(
                    "PDP_ACTIVE", self._registration_timeout)) == False:
                #PDP not activated in time, return error
                message = "Exit - PDP NOT activated"
                self._logger.error(message)
                return Global.FAILURE, message

            # in all other cell reselection cases a ping is performed
            packet_loss = self._networking_api.\
                ping(self._server_ip_address,
                     self._packet_size,
                     self._nb_pings)

            # Compute verdict depending on % of packet loss
            if packet_loss.value > self._target_ping_packet_loss_rate:
                result_verdict = Global.FAILURE
                message = "Ping after cell reselection failed & Measured Packet Loss: %.0f%s (Target: %.0f%s)"\
                % (packet_loss.value,
                   packet_loss.units,
                   self._target_ping_packet_loss_rate,
                   packet_loss.units)
                return (result_verdict, message)
            else:
                result_verdict = Global.SUCCESS

            message = "Measured Packet Loss: %.0f%s (Target: %.0f%s)"\
                % (packet_loss.value,
                   packet_loss.units,
                   self._target_ping_packet_loss_rate,
                   packet_loss.units)
            self._logger.info(message)
            result_message = "cell reselection is done"

        # -------------------------------------------------------------------

        # if we want to do a return cell reselection (go back)
        if self._back_and_forth:

            message = "---- BACK and FORTH ---- Going from 3G cell to 4G cell"
            self._logger.info(message)

            # Set primary cell to first cell
            if self._cell_in_use == 1:
                self._cell_in_use = 2
                cell_parms = self._2_to_1_cell_parms

            self._logger.info("Go out of coverage then switch to cell %d",
                              self._cell_in_use)
            self.go_out_of_coverage_and_cresel(*cell_parms)

            self._logger.info("End out of coverage procedure")

            # Check Data Connection State => CON before timeout
            self._ns_lte_data.check_data_connection_state(
                "CON",
                self._registration_timeout,
                blocking=True,
                cell_id=self._ns_lte_cell_id)
            self._logger.info("wait 10 sec after registering on LTE Cell")
            time.sleep(10)

            # in all other cell reselection cases a ping is performed
            packet_loss = self._networking_api.\
                ping(self._server_ip_address,
                     self._packet_size,
                     self._nb_pings)

            # Compute verdict depending on % of packet loss
            if packet_loss.value > self._target_ping_packet_loss_rate:
                result_verdict = Global.FAILURE
                message = "Ping after second cell reselection failed & Measured Packet Loss: %.0f%s (Target: %.0f%s)"\
                % (packet_loss.value,
                   packet_loss.units,
                   self._target_ping_packet_loss_rate,
                   packet_loss.units)
                return (result_verdict, message)
            else:
                result_verdict = Global.SUCCESS

            message = "Measured Packet Loss: %.0f%s (Target: %.0f%s)"\
                % (packet_loss.value,
                   packet_loss.units,
                   self._target_ping_packet_loss_rate,
                   packet_loss.units)
            self._logger.info(message)
            result_message = "cell reselection is done"

        return result_verdict, result_message