예제 #1
0
 def __init__(self, name, model, eqt_params, bench_params):
     """
     Constructor
     :type name: str
     :param name: the bench configuration name of the equipment
     :type model: str
     :param model: the model of the equipment
     :type eqt_params: dict
     :param eqt_params: the dictionary containing equipment parameters
     :type bench_params: dict
     :param bench_params: the dictionary containing equipment bench parameters
     """
     EquipmentBase.__init__(self, name, model, eqt_params)
     IIOCard.__init__(self)
     self.__bench_params = bench_params
     self.__handle = None
     self.__default_states = USBRly08.__DEFAULT_STATE_TABLE
     self.__wiring_table = USBRly08.__DEFAULT_WIRING_TABLE
     self.__usb_host_pc_connect_relay = None
     self.__usb_host_pc_power_minus = None
     self.__usb_host_pc_data_plus = None
     self.__usb_host_pc_data_minus = None
     self.__power_supply_relay = None
     self.__ps_sense_shunt_relay = None
     self.__switch_on_off_relay = None
     self.__wall_charger_relay = None
     self.__wireless_charger_relay = None
     self.__rpc_server_port = None
     self.__wall_charger = None
     self.__selected_usb_device = USBRly08.USB_HOST_PC
     self.__test_status_display_connect_relay = None
     self.__provisioning_mode = None
     self.__usb_otg_type_relay = None
     self.__lamp_relay = None
예제 #2
0
 def __init__(self, name, model, eqt_params, bench_params):
     """
     Constructor
     :type name: str
     :param name: the bench configuration name of the equipment
     :type model: str
     :param model: the model of the equipment
     :type eqt_params: dict
     :param eqt_params: the dictionary containing equipment parameters
     :type bench_params: dict
     :param bench_params: the dictionary containing equipment bench parameters
     """
     IIOCard.__init__(self)
     DllLoader.__init__(self, name, model, eqt_params)
     self.__bench_params = bench_params
     self.__device_index = -1
     self.__wall_charger = None
     self._use_ext_ps = None
     self.__default_battery = None
     self.__ext_ps_plug = False
     # MAP PHONE BUTTON here
     self.PHONE_BUTTON = {
         ACBN.VOLUME_UP: self.LINES.button_ctrl21,
         ACBN.VOLUME_DOWN: self.LINES.button_ctrl20,
         ACBN.PWR_BUTTON: self.LINES.button_ctrl12
     }
     # define what is usb host pc
     self.ACCESSORY_TO_ACB[self.USB_HOST_PC] = self.ACCESSORY_TO_ACB[
         self.SDP]
     self.ACCESSORY_TO_ACB[self.WALL_CHARGER] = []
예제 #3
0
 def __init__(self, name, model, eqt_params, bench_params):
     """
     Constructor
     :type name: str
     :param name: the bench configuration name of the equipment
     :type model: str
     :param model: the model of the equipment
     :type eqt_params: dict
     :param eqt_params: the dictionary containing equipment parameters
     :type bench_params: dict
     :param bench_params: the dictionary containing equipment bench parameters
     """
     EquipmentBase.__init__(self, name, model, eqt_params)
     IIOCard.__init__(self)
     self.__bench_params = bench_params
     # what is the wall charger for th dut
     self.__wall_charger = None
     # do we use ext ps to supply usb
     self._usb_supply_path = "USB_SUPPLY"
     # default battery taken from device catalog
     self.__default_battery = None
     # current battery
     self.__current_battery = None
     # current battery state
     self.__current_battery_state = None
     # Type of Digital Battery
     self.__digital_battery_type = None
     # default battid value taken from device catalog
     self.__default_batt_id_value = None
     # current battid
     self.__current_batt_id_value = None
     # default bptherm value taken from device catalog
     self.__default_bptherm_value = None
     # is external power supply plug ?
     self.__ext_ps_plug = False
     # Client/Server things
     self.__func_wrapper = EMT350Wrapper()
     self.__io_card_conf = {}
     self.__automatic_serial_com_port_detection = None
     self.__serial_com_port = None
     self.__serial_baud_rate = None
     self.__retry_nb = None
     self.__server_ip = None
     self.__server_port = None
     self.__multi_exec_needed = None
     self.__usb_host = self.SDP
예제 #4
0
 def __init__(self, name, model, eqt_params, bench_params):
     """
     Constructor
     :type name: str
     :param name: the bench configuration name of the equipment
     :type model: str
     :param model: the model of the equipment
     :type eqt_params: dict
     :param eqt_params: the dictionary containing equipment parameters
     :type bench_params: dict
     :param bench_params: the dictionary containing equipment bench parameters
     """
     IIOCard.__init__(self)
     DllLoader.__init__(self, name, model, eqt_params)
     self.__bench_params = bench_params
     self.__device_index = -1
     self.__wall_charger = None
예제 #5
0
 def __init__(self, name, model, eqt_params, bench_params):
     """
     Constructor
     :type name: str
     :param name: the bench configuration name of the equipment
     :type model: str
     :param model: the model of the equipment
     :type eqt_params: dict
     :param eqt_params: the dictionary containing equipment parameters
     :type bench_params: dict
     :param bench_params: the dictionary containing equipment bench parameters
     """
     DllLoader.__init__(self, name, model, eqt_params)
     IIOCard.__init__(self)
     self.__bench_params = bench_params
     self.__wiring_table = 0
     self.__usb_host_pc_connect_relay = 0
     self.__switch_on_off_relay = 0
     self.__jwork_wrapper = None
예제 #6
0
 def __init__(self, name, model, eqt_params, bench_params):
     """
     Constructor
     :type name: str
     :param name: the bench configuration name of the equipment
     :type model: str
     :param model: the model of the equipment
     :type eqt_params: dict
     :param eqt_params: the dictionary containing equipment parameters
     :type bench_params: dict
     :param bench_params: the dictionary containing equipment bench parameters
     """
     IIOCard.__init__(self)
     DllLoader.__init__(self, name, model, eqt_params)
     self.__default_pwr_btn = bench_params.get_param_value(
         "DEFAULT_POWER_BUTTON", "")
     self.__default_usb_no = bench_params.get_param_value("DEFAULT_USB", "")
     self.__bench_params = bench_params
     self.__device_index = -1
     self.__wall_charger = None
예제 #7
0
    def __init__(self, tc_name, global_config):
        """
        Constructor
        """
        # Call UseCase base Init function
        UseCaseBase.__init__(self, tc_name, global_config)
        self._overmind = None
        # init em stamp
        self.em_stamp = self._name
        self._uc_id_logged = False
        # override IO CARD with a not None type but not implemented type
        if self._io_card is None:
            self._io_card = IIOCard()

        # get em parameter from device catalog here
        self.phone_info = self._device.get_em_parameters()
        # feed the overmind
        self._overmind = OverMind()
        self._overmind.init(device=self._device,
                            tc_parameters=self._tc_parameters,
                            equipment_manager=self._em,
                            bench_config=global_config.benchConfig,
                            dut_config=self._dut_config)

        # Get uecmd api
        self.em_api = self._device.get_uecmd("EnergyManagement")
        self.phonesystem_api = self._device.get_uecmd("PhoneSystem")
        self.modem_api = self._device.get_uecmd("Modem")
        self.voicecall_api = self._device.get_uecmd("VoiceCall")
        self.networking_api = self._device.get_uecmd("Networking")
        self.bt_api = self._device.get_uecmd("LocalConnectivity")

        # init temperature chamber
        self._tct = self._tc_parameters.get_param_value("TCT",
                                                        default_cast_type=int)
        if self._tct is not None:
            self.tc_module = ThermalChamberModule(self._tct)
        else:
            self.tc_module = None

        # Each raw measurement data & xml files are
        # stored in a folder bearing the name
        # of the TC + a time stamp
        directory_name = self._name + "_" + time.strftime("%Y-%m-%d_%Hh%M.%S")
        report_tree = global_config.campaignConfig.get("campaignReportTree")
        self._saving_directory = report_tree.create_subfolder(directory_name)
        campaign_pass_rate = float(
            global_config.campaignConfig.get("targetB2bPassRate"))
        # resume file
        self._campaign_folder = report_tree.get_report_path()
        # verdict file
        self._em_meas_verdict = EMUtil.EMMeasurement(self._saving_directory,
                                                     campaign_pass_rate)

        # Call ConfigsParser to parse Energy_Management
        external_target_path = self._device.get_config("EMExternalTarget")
        if external_target_path is not None and os.path.exists(
                external_target_path):
            # Call ConfigsParser to parse Energy_Management
            self._logger.info("[EM BASE] External EM target file found : %s" %
                              external_target_path)
            self._target_file = ConfigsParser(external_target_path,
                                              config_folder="")
        else:
            # If no external target file , parse default one
            self._logger.info(
                "[EM BASE] No external target file found, use default EM target file"
            )
            self._target_file = ConfigsParser("Energy_Management")

        # Enable ACS secondary reports
        self._secondary_report = SecondaryTestReport(
            self._device.get_report_tree().get_report_path())

        # init variables
        # var for robustness
        self.start_time = time.time()
        self.__phone_date = ""
        self._ambient_temperature = 25
        self.phone_as_reboot = False
        self._consecutive_meas_error = 5
        # pylint: disable=W0212
        # Ignore used of protected member, will be change if a getter is created later
        self.pwr_btn_boot = self._device._prss_pwr_btn_time_switch_on
        self.pwr_btn_off = self._device._prss_pw_btn_time_switch_off

        # INIT PARAMETERS HERE
        # param related to usecase
        self._em_cst = EMUtil.EMConstant
        self._em_targets = None
        # add usb sleep for avoiding to lost connection during usb recognition
        self.usb_sleep = self._device._usb_sleep_duration  # pylint: disable=w0212

        # param related to device
        self.vbatt_mos_shutdown = self.phone_info["BATTERY"][
            "VBATT_MOS_SHUTDOWN"] + 0.1
        self.vbatt_mos_boot = self.phone_info["BATTERY"]["VBATT_MOS_BOOT"] + 0.1

        # param that are designed to be updated
        self.batt_capacity = -1
        self.batt_voltage = -1
        # measurement list where we store measurement inside
        self._meas_list = EMUtil.MeasurementList()

        # init core module at the end
        self.em_core_module = None
        bench_type = self._tc_parameters.get_param_value(
            "BENCH_TYPE", self.DEDICATED_BENCH).upper()
        if bench_type == "POWER_SUPPLY_BENCH":
            self.em_core_module = UcPowerSupplyModule(self)
        elif bench_type == "BATTERY_BENCH":
            self.em_core_module = UcBatteryModule(self)
        self._logger.info("Loaded EM TEST_SCRIPT configuration for %s" %
                          self.DEDICATED_BENCH)
        # get the list of TCD to test, it can have several entries
        # if the parameter is missing or empty ( meaning None) the old verdict system will be used.
        self.tcd_to_test = self._tc_parameters.get_param_value(
            EMConstant.TC_PARAMETER_TO_CHECK, "")
        if type(self.tcd_to_test) is str:
            self.tcd_to_test = filter(None, self.tcd_to_test.split(";"))
            self.tcd_to_test = map(str.strip, self.tcd_to_test)