def set_up(self):
        """
        Initialize the test
        """
        # Depending on IP version, set DUT IP address with IPV4 or IPV6 address
        if self._ip_version == "IPV6":
            if self._ns_dut_ipv6_Address not in (None, ""):
                self._ns_dut_ip_Address = self._ns_dut_ipv6_Address
                self._logger.info("IP version is %s, set DUT IP to: %s" %
                                  (self._ip_version, self._ns_dut_ip_Address))
            else:
                self._logger.error(
                    "IPV6 address for DUT is not defined in Callbox section of bench config!! Please update it"
                )
                return Global.FAILURE, "IPV6 address for DUT is not defined in Callbox section of bench config!! Please update it"
        else:
            self._logger.info("IP version is %s, keep DUT IP to: %s" %
                              (self._ip_version, self._ns_dut_ip_Address))
        # Call LAB_LTE_BASE set_up function
        LabLteBase.set_up(self)

        self._check_ip_version()

        # Set Cell on
        self._ns_cell_4g.set_cell_on(self._mimo)

        # Flight mode deactivation after LTE BASE Setup
        self._networking_api.set_flight_mode("off")

        if self._switch_mode in ("hardshutdown", "softshutdown"):
            # Switch off according to the mode chosen in XML file
            self.phoneonoff_util.switch_off(self._switch_mode)

        return Global.SUCCESS, "No errors"
Example #2
0
    def set_up(self):
        """
        Initialize the test
        """
        # Call LAB_LTE_BASE set_up function
        LabLteBase.set_up(self)

        # Set Cell on
        self._ns_cell_4g.set_cell_on(self._mimo)

        return Global.SUCCESS, "No errors"
Example #3
0
    def set_up(self):
        """
        Initialize the test
        """
        # Call LAB_LTE_BASE set_up function
        LabLteBase.set_up(self)

        # Set Cell on
        self._ns_cell_4g.set_cell_on(self._mimo)

        # Flight mode deactivation
        self._networking_api.set_flight_mode("off")


        # Check data connection state is "CON"
        self._check_data_connection_state("CON")
        # 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)

        # Set APN for LTE and/or IMS depending on protocol IPv4 or IPv6
        self._set_apn_for_lte_and_ims()

        # move to her to wait for register then activate pdp
        time.sleep(self._wait_btwn_cmd)
        self._networking_api.activate_pdp_context(check = False)

        # Get RAT from Equipment
        network_type = self._ns_data_4g.get_network_type()
        # Check that DUT is registered on the good RAT
        self._modem_api.check_network_type_before_timeout(network_type,
                                                          self._registration_timeout)

        # Set rrc state to the value defined in the TC
        current_rrc_state = self._ns_cell_4g.get_rrc_state()
        if self._rrc_state == "RRC_IDLE":
            self._networking_api.disable_output_traffic()
            self._ns_data_4g.ue_detach()
            self._networking_api.enable_output_traffic()
            current_rrc_state = self._ns_cell_4g.get_rrc_state()
            self._logger.info("The ping will start from %s state" % current_rrc_state)
        elif self._rrc_state == "RRC_CONNECTED":
            self._logger.info("The ping will start from %s state" % current_rrc_state)

        return Global.SUCCESS, "No errors"
Example #4
0
    def set_up(self):
        """
        Initialize the test.
        """
        # configure RRC state after cell attach process (will be used on LabLteBase set_up)
        if "IDLE" in str(self._rrc_state):
            self._ns_cell_4g.keep_rrc_connection(False)
        else:
            self._ns_cell_4g.keep_rrc_connection(True)

        # Call LAB_LTE_BASE set_up function
        LabLteBase.set_up(self)

        # Reset KPI data needed for computing KPI test result
        if self._kpi_test:
            self._kpi_data = KPIUtil()
            self._current_iteration = 0

        if self._iperf_protocol is None:
            return Global.FAILURE, "The IPERF protocol parameter should be present."

        self._iperf_settings["direction"] = self._iperf_direction
        if self._iperf_protocol.lower() == "udp":
            # Compute IPERF bandwidth from target throughput and iperf bandwidth
            compute_iperf_bw(self._iperf_settings, self._throughput_targets,
                             self._iperf_bandwidth)

        # Set Cell on.
        self._ns_cell_4g.set_cell_on(self._mimo)

        # Activate 4G
        self._connect_dut_to_4g_cell()

        # Configuration for different LTE equipments:
        # Configuration for Rohde & Schwarz CMW500
        if "RS_CMW500" in self._ns_model:
            # Add CMW500 equipment api to perform settings on internal IPERF server/client.
            self._iperf_settings.update({
                "server_ip_address": self._server_ip_address,
                "equipment_api": self._ns_data_4g,
                "computer": None
            })
            # Be sure to use equipment api for IPERF and not Computer equipment
            self._computer = None
        else:
            # LTE equipment not supported
            return Global.FAILURE, "LTE equipment %s not supported (AGILENT_E6621A, RS_CMW500)." \
                                   % self._ns_model

        # Trying to get the DUT IP address as the CMW500 does not provide the
        # IP described in the Bench Config. The two checks are done because
        # platform can have different interface names.
        try:
            self._dut_ip_address = self._ns_dut_ip_Address
            if self._ip_version == "IPV4":
                self._dut_ip_address = wait_for_dut_ipv4_address(
                    self._registration_timeout, self._networking_api,
                    self._device.get_cellular_network_interface())
            if self._ip_version == "IPV6":
                # Transform IPV6 DUT Prefix (xxxx:xxxx:xxxx:xxxx::/64) => DUT IP Adress (xxxx:xxxx:xxxx:xxxx::1)
                self._dut_ip_address = self._dut_ip_address.split("/")[0] + "1"
        except (KeyboardInterrupt, SystemExit):
            raise

        # Setup the IPERF test.
        self._iperf_settings.update({
            "port_number": self._port,
            "duration": self._duration,
            "protocol": self._iperf_protocol.lower(),
            "dut_ip_address": self._dut_ip_address
        })
        if self._iperf_uldl_parameters != {}:
            # If it's a KPI test we should disable the setting of the window size on the CMW500
            #             if self._kpi_test:
            #                 self._ns_data_4g.config_window_size_off()
            self._iperf_settings.update(self._iperf_uldl_parameters)

        if self._buffer_length != 0:
            self._iperf_settings.update({"buffer_length": self._buffer_length})
        if self._ip_version == "IPV6":
            self._iperf_settings["ipv6_domain"] = True

        # Setup the IPERF server/client, if IPERF embedded on equipment (CMW500 equipment)
        if self._computer is None:
            # Stop FTP server on CMW
            self._ns_data_4g.stop_ftp_service()
            # Configure internal IPERF server/client of the equipment.
            if self._iperf_direction.upper() in ("UP"):
                self._logger.info("Enable CMW500 IPERF server.")
                self._ns_data_4g.disable_iperf_client()
                self._ns_data_4g.configure_iperf_server(self._iperf_settings)
            elif self._iperf_direction.upper() in ("BOTH"):
                # Configure first iperf server as iperf duration is set by server and client but the desired value is client duration
                self._logger.info("Enable CMW500 IPERF server.")
                self._ns_data_4g.configure_iperf_server(self._iperf_settings)
                self._logger.info("Enable CMW500 IPERF client.")
                # Add 30 more seconds to iperf service duration on CMW to allow concurrency transfer
                self._iperf_settings.update({"duration": self._duration + 15})
                # Change port for DL iperf
                self._iperf_settings.update({"port_number": self._port + 1})
                self._ns_data_4g.configure_iperf_client(self._iperf_settings)

                # Reset iperf duration and port for DUT iperf client
                self._iperf_settings.update({
                    "duration": self._duration,
                    "port_number": self._port
                })
            else:
                self._logger.info("Enable CMW500 IPERF client.")
                self._ns_data_4g.disable_iperf_server()
                self._ns_data_4g.configure_iperf_client(self._iperf_settings)

        return Global.SUCCESS, "No errors"