def __init__(self, tc_name, global_config): """ Constructor """ # Call LiveBTBase init function LiveBTBase.__init__(self, tc_name, global_config) LiveWifiBase.__init__(self, tc_name, global_config) self._audio_file = str(self._tc_parameters.get_param_value("AUDIO_FILE")) self._duration = str(self._tc_parameters.get_param_value("DURATION")) self._a2dp_activity = str(self._tc_parameters.get_param_value("A2DP_ACTIVITY")).upper() self._wifi_activity = str(self._tc_parameters.get_param_value("WIFI_ACTIVITY")).upper() if self._wifi_activity == "WIFI_WEB_BROWSING": self._wifi_url = str(self._tc_parameters.get_param_value("URL_TO_BROWSE")) elif self._wifi_activity == "WIFI_FTP_DOWNLOAD": self._ftp_remote_file = str(self._tc_parameters.get_param_value("FTP_REMOTE_FILE")) self._timeout = 300 self._bt_headset = self._em.get_bluetooth_headset("BT_HEADSET") self._bt_headset_addr = None self._thread_wifi_activity = None self._thread_a2dp_activity = None self._queue = Queue.Queue()
def __init__(self, tc_name, global_config): """ Constructor """ LiveWifiBase.__init__(self, tc_name, global_config) # Get TC Parameters self._packetsize = \ int(self._tc_parameters.get_param_value("PACKET_SIZE")) self._count = int(self._tc_parameters.get_param_value("PACKET_COUNT")) self._target_ping_packet_loss_rate = \ float(self._tc_parameters.get_param_value("TARGET_PACKET_LOSS_RATE")) self._connection_time_list = list() self._current_iteration_num = 0 self._expected_connection_time = str(self._tc_parameters.get_param_value("REF_CONNECTION_TIME")) self._tolerance = str(self._tc_parameters.get_param_value("TOLERANCE")) if re.match(r'\d+\.?\d*', self._tolerance) is not None: self._tolerance = float(self._tolerance) / 100 else: self._tolerance = self.DEFAULT_TOLERANCE self._logger.warning("Tolerance not found, set to default value") self._logger.debug("Tolerance set to %2.2f%%" % (self._tolerance * 100))
def __init__(self, tc_name, global_config): """ Constructor """ LiveWifiBase.__init__(self, tc_name, global_config) self._disconnected = False self._unplugged = False self._test_usb_disconnect = str_to_bool_ex(self._tc_parameters.get_param_value("TEST_USB_DISCONNECT"))
def __init__(self, tc_name, global_config): """ Constructor """ # Call LiveBTBase init function LiveBTBase.__init__(self, tc_name, global_config) LiveWifiBase.__init__(self, tc_name, global_config) self._wifi_ip = self._wifirouter.get_param_value("IP") self._bt_headset = self._em.get_bluetooth_headset("BT_HEADSET")
def __init__(self, tc_name, global_config): """ Constructor """ # Call LiveBTBase init function LiveDualPhoneBTBase.__init__(self, tc_name, global_config) LiveWifiBase.__init__(self, tc_name, global_config) self._duration = str(self._tc_parameters.get_param_value("DURATION")) self._dut_state = str(self._tc_parameters.get_param_value("DUT_STATE")) self._opp_local_file = str(self._tc_parameters.get_param_value("OPP_LOCAL_FILE")) self._wifi_activity = str(self._tc_parameters.get_param_value("WIFI_ACTIVITY")) if self._wifi_activity == "WIFI_FTP_DOWNLOAD": self._ftp_remote_file = str(self._tc_parameters.get_param_value("FTP_REMOTE_FILE")) self._bt_headset = None self._bt_headset_addr = None
def __init__(self, tc_name, global_config): LiveWifiBase.__init__(self, tc_name, global_config) # Get TC Parameters self._iperf_options = \ self._tc_parameters.get_param_value("IPERF_OPTIONS") self._direction = self._tc_parameters.get_param_value("DIRECTION") if self._direction is None or self._direction == "": self._direction = 'both' else: self._direction = self._direction.lower() mode = self._tc_parameters.get_param_value("IPERF_MODE") if mode is None or mode == "": mode = "single" else: mode = mode.lower() self._tune_options = self._tc_parameters.\ get_param_value("IPERF_TUNE_OPTIONS") if self._tune_options in (None, 1, '1', 'on', 'ON'): self._tune_options = 1 else: self._tune_options = 0 self._target_ul = self._tc_parameters.get_param_value("TARGET_UL") self._failure_ul = self._tc_parameters.get_param_value("FAILURE_UL") self._target_dl = self._tc_parameters.get_param_value("TARGET_DL") self._failure_dl = self._tc_parameters.get_param_value("FAILURE_DL") # Get computer type self._computer = self._tc_parameters.get_param_value("COMPUTER") if self._computer == "": self._computer = None # Load computer equipment if self._computer is not None: self._computer = self._em.get_computer(self._computer) self._throughput_targets = None self._iperf_settings = { "server_ip_address": self._server_ip_address, "mode": mode }
def __init__(self, tc_name, global_config): """ Constructor """ LiveWifiBase.__init__(self, tc_name, global_config) # Get TC Parameters self._direction = self._tc_parameters.get_param_value("DIRECTION") # Read the DL_FILE value from UseCase xml Parameter self._dlfilename = os.path.join( self._ftp_path, self._tc_parameters.get_param_value("DL_FILE", "")) # Read the UL_FILE value from UseCase xml Parameter self._ulfilename = os.path.join( self._ftp_path, self._tc_parameters.get_param_value("UL_FILE", "")) self._xfer_timeout = \ int(self._tc_parameters.get_param_value("XFER_TIMEOUT")) # Intended to test connection failure with wrong passphrase. self._wrong_passphrase = None
def __init__(self, tc_name, global_config): """ Constructor """ LiveWifiBase.__init__(self, tc_name, global_config) # Get TC Parameters self._cts_path = self._tc_parameters.get_param_value("CTS_PATH") self._cts_media_path = self._tc_parameters.get_param_value("CTS_MEDIA_PATH") self._cts_result_comparison = self._tc_parameters.get_param_value("CTS_REPORT_COMPARISON_PATH") self._test_cmd_lines = self._tc_parameters.get_param_value("TEST_CMD_LINES") self._test_timeout = self._tc_parameters.get_param_value("TEST_TIMEOUT", default_cast_type=float) self._ui_api = self._device.get_uecmd("Ui") self._ui_api.set_global_config(global_config) self._misc_api = self._device.get_uecmd("PhoneSystem") self._system_api = self._device.get_uecmd("System") self._app_api = self._device.get_uecmd("AppMgmt") # Add a secondary report self.__tc_report = SecondaryTestReport(self._device.get_report_tree().get_report_path()) self._cts_exec_path = ""
def __init__(self, tc_name, global_config): """ Constructor """ LiveWifiBase.__init__(self, tc_name, global_config) # Get TC Parameters self._browser_type = \ str(self._tc_parameters.get_param_value("BROWSER_TYPE")).lower() self._website_url = str( self._tc_parameters.get_param_value("WEBSITE_URL")) self._webpage_loading_timeout = \ int(self._tc_parameters.get_param_value("TIMEOUT")) if self._website_url.upper() in ["", "NONE"]: # In case of empty WEBSITE_URL TC parameter, use the IP server in the bench config self._website_url = self._server_ip_address # Get UECmdLayer self._phonesystem_api = self._device.get_uecmd("PhoneSystem") # Store current screen timeout (default to 15s in case of failure) self._current_screen_timeout = 15
def __init__(self, tc_name, global_config): """ Constructor """ # Call LiveBTBase init function LiveDualPhoneBTBase.__init__(self, tc_name, global_config) LiveWifiBase.__init__(self, tc_name, global_config) # Read COMPONENT_USE from test case xml file self._component_use = str( self._tc_parameters.get_param_value("COMPONENT_USE")) # Read DUT_STATE from test case xml file self._dut_state = str(self._tc_parameters.get_param_value("DUT_STATE")) # Read OPP_LOCAL_FILE from test case xml file self._opp_local_file = str( self._tc_parameters.get_param_value("OPP_LOCAL_FILE")) # Initialize data self._thread_opp_transfer = None self._thread_scan_bt = None self._thread_scan_wifi = None self._queue = Queue.Queue()