def __init__(self, tc_name, global_config): """ Constructor """ LabWifiBase.__init__(self, tc_name, global_config) self._computer = None
def __init__(self, tc_name, global_config): """ Constructor """ LabWifiBase.__init__(self, tc_name, global_config) # Retrieve UC parameter if self._channel.isdigit() and int( self._channel ) in AcsWifiFrequencies.WIFI_CHANNELS_FREQUENCIES_5G: self._first_freq = AcsWifiFrequencies.WIFI_CHANNELS_FREQUENCIES_5G[ int(self._channel)] else: self._first_freq = None self._second_channel = str( self._tc_parameters.get_param_value("SECOND_WIFI_CHANNEL")) if self._second_channel.isdigit() and int( self._second_channel ) in AcsWifiFrequencies.WIFI_CHANNELS_FREQUENCIES_5G: self._second_freq = AcsWifiFrequencies.WIFI_CHANNELS_FREQUENCIES_5G[ int(self._second_channel)] else: self._second_freq = None self._nbr_beacon_to_wait = str( self._tc_parameters.get_param_value("NBR_BEACON_TO_WAIT")) self._dfs_mode = str(self._tc_parameters.get_param_value("DFS_MODE"))
def __init__(self, tc_name, global_config): """ Constructor """ LabWifiBase.__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")) self._xfer_40_to_20mhz_ratio = str( self._tc_parameters.get_param_value("XFER_40MHz_TO_20MHz_RATIO", "")) if is_number(self._xfer_40_to_20mhz_ratio): self._xfer_40_to_20mhz_ratio = float(self._xfer_40_to_20mhz_ratio) else: self._xfer_40_to_20mhz_ratio = 1.5 self._xfer_mimo_to_siso_ratio = str( self._tc_parameters.get_param_value("XFER_MIMO_TO_SISO_RATIO", "")) if is_number(self._xfer_mimo_to_siso_ratio): self._xfer_mimo_to_siso_ratio = float( self._xfer_mimo_to_siso_ratio) else: self._xfer_mimo_to_siso_ratio = 1.5 self.__1st_iteration = True
def __init__(self, tc_name, global_config): """ Constructor """ LabWifiBase.__init__(self, tc_name, global_config) LabWifiKPIBase.__init__(self, tc_name, global_config) self._time_target = float( self._tc_parameters.get_param_value("REF_CONNECTION_TIME"))
def __init__(self, tc_name, global_config): """ Constructor """ LabWifiBase.__init__(self, tc_name, global_config) if self._hidden: # The main goal of the test won't be reached self._logger.warning("The SSID has been set to 'hidden'. The " + "test will control that DUT cannot scan the AP.")
def __init__(self, tc_name, global_config): """ Constructor """ LabWifiBase.__init__(self, tc_name, global_config) # Read time to wait between tests self._time2wait = self._tc_parameters.\ get_param_value("TIME_BETWEEN_TESTS") self._wrong_passphrase = None
def __init__(self, tc_name, global_config): LabWifiBase.__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) if self._computer.get_host_on_test_network() is not None: self._wifi_server_ip_address = self._computer.get_host_on_test_network( ) else: error_msg = "No IP Address found for %s" % self._computer self._logger.error(error_msg) raise AcsConfigException(AcsConfigException.INVALID_PARAMETER, error_msg) self._throughput_targets = None self._iperf_settings = { "server_ip_address": self._wifi_server_ip_address, "mode": mode }
def __init__(self, tc_name, global_config): """ Constructor """ LabWifiBase.__init__(self, tc_name, global_config) self._connection_expected = self._tc_parameters.get_param_value("CONNECTION_EXPECTED") self._dut_crda = self._tc_parameters.get_param_value("DUT_REGULATORY_DOMAIN") # Disable WRONG_PASSPHRASE TC parameter self._wrong_passphrase = None # Disable REGULATORY_DOMAIN TC parameter self._user_reg_domain = None
def __init__(self, tc_name, global_config): """ Constructor """ LabWifiBase.__init__(self, tc_name, global_config) # Parameter for ping controls self._packetsize = 32 self._packnb = 4 self._lossrate = 25 # Record whether Wifi is already connected to handle B2B continuous mode values self._is_wifi_already_connected = None
def __init__(self, tc_name, global_config): """ Constructor """ LabWifiBase.__init__(self, tc_name, global_config) # Get TC Parameters self._live_server = \ self._tc_parameters.get_param_value("CELLULAR_ADDRESS_TO_PING") self._packetsize = 32 self._count = 10 self._target_ping_packet_loss_rate = 20 self._registration_waiting_time = 15
def __init__(self, tc_name, global_config): """ Constructor """ LabWifiBase.__init__(self, tc_name, global_config) self._connected = \ str(self._tc_parameters.get_param_value("WIFI_CONNECTED")) self._display_state = \ str(self._tc_parameters.get_param_value("DISPLAY")).upper() self._keep_wifi_on = \ str(self._tc_parameters.get_param_value("KEEP_WIFI_ON_DURING_SLEEP")) self._ssid_list_empty = \ str(self._tc_parameters.get_param_value("REMEMBERED_SSID_LIST_EMPTY")) self._usb_pluggedin = \ str(self._tc_parameters.get_param_value("USB_PLUGGED_IN")) self._tolerance = str(self._tc_parameters.get_param_value("TOLERANCE")) # Behavior informations: # 1- Scan period in seconds self._scan = 0 # 2- Time to WiFi turn off in minutes self._wifi_off = 0 # 3- Recommended test duration in seconds self._tduration = 0 self._wifi_mac = "" self._original_screen_timeout = None # USB Connected stated self._usb_connected_status = True # Set tolerance parameter if self._tolerance.isdigit(): self._tolerance = float(self._tolerance) / 100 else: self._tolerance = self.DEFAULT_TOLERANCE self._logger.debug("Tolerance set to %2.2f%%" % (self._tolerance * 100)) # Forbid the usage of the sniffer in LAB_WIFI_BASE self._sniffer = None self._sp_sniffer = None # Get WiFi interface name self._wifi_interface = str(self._dut_config.get("wlanInterface"))
def __init__(self, tc_name, global_config): """ Constructor """ LabWifiBase.__init__(self, tc_name, global_config) # Get TC Parameters self._direction = self._tc_parameters.get_param_value("DIRECTION") 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._waiting_time = \ int(self._tc_parameters.get_param_value("DELAY_AFTER_PING")) self._dut_ip = None self._computer = None self._all_ip_to_ping = []
def __init__(self, tc_name, global_config): """ Constructor """ LabWifiBase.__init__(self, tc_name, global_config) # Parameter for ping controls self._packetsize = 32 self._packnb = 4 self._lossrate = 25 self._lossrate_disconnected = 99 # source IP address to use (interface from which the ping will be send) self.__dut_ip_adr = None # Time to wait for the DUT to reconnect after Wifi is back self._wifi_reconnection_time = 60 # Get UECmdLayer for bluetooth self._bt_api = self._device.get_uecmd("LocalConnectivity")
def __init__(self, tc_name, global_config): """ Constructor """ # Call LiveDualPhoneBTBase and LabWifiBase init functions LiveDualPhoneBTBase.__init__(self, tc_name, global_config) LabWifiBase.__init__(self, tc_name, global_config) # Reset unused parameter: self._wrong_passphrase = None self._key_exchange_should_fail = False # Read TC parameters self._nap_or_pan_test = \ str(self._tc_parameters.get_param_value("NAP_OR_PAN_TEST")).upper() self._pairing_initiator = \ str(self._tc_parameters.get_param_value("PAIRING_INITIATOR")).upper() self._who_disconnect = \ str(self._tc_parameters.get_param_value("WHO_DISCONNECT")).upper() self._who_restarts_bt = \ str(self._tc_parameters.get_param_value("WHO_RESTARTS_BT_BEFORE_TEST")).upper() self._bt_tethering_deactivation_test = \ str(self._tc_parameters.get_param_value("ENABLE_BT_TETHERING_DEACTIVATION_TEST", "")) self._lola_test = \ str(self._tc_parameters.get_param_value("ENABLE_LOLA_TEST", "")) self._packet_count = \ str(self._tc_parameters.get_param_value("PACKET_COUNT")) self._packet_size = \ str(self._tc_parameters.get_param_value("PACKET_SIZE")) self._target_packet_loss_rate = \ str(self._tc_parameters.get_param_value("TARGET_PACKET_LOSS_RATE")) # Server to ping self._server_to_ping = self._wifirouter_ip self._nap_api = None self._panu_api = None self._nap_addr = None self._panu_addr = None self._wifi_api = None self._panu_net_api = None self._paired_api = None self._pair_requester_api = None
def __init__(self, tc_name, global_config): """ Constructor """ LabWifiBase.__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._wifi_server_ip_address # Store current screen timeout (default to 15s in case of failure) self._current_screen_timeout = 15
def __init__(self, tc_name, global_config): """ Constructor """ LabWifiBase.__init__(self, tc_name, global_config) # Set the screen timeout (in sec) to a very small value self._screen_timeout = 15 # Default value for time to wait for wifi to disconnect all network self._time_before_wifi_sleep = 18 * 60 # Ping fixed parameters self._packetsize = 32 self._count = 4 self._lossrate_connection_ok = 50 self._lossrate_disconnected = 99 self._previous_wifi_sleep_policy = None self._previous_screen_timeout = None
def __init__(self, tc_name, global_config): """ Constructor """ LabWifiBase.__init__(self, tc_name, global_config) # Retrieve UC parameter self._restart_dut = str( self._tc_parameters.get_param_value("RESTART_DUT", "")).upper() if self._restart_dut in ["", "OFF", "NO", "NONE", "FALSE"]: self._restart_dut = "OFF" self._restart_ap_radio = str_to_bool( str(self._tc_parameters.get_param_value("RESTART_AP_RADIO"))) self._mac_filter = str( self._tc_parameters.get_param_value("MAC_FILTER", "OFF")).upper() if self._mac_filter == "": self._mac_filter = "OFF" self._mac_filter_parameter = str( self._tc_parameters.get_param_value("MAC_FILTER_PARAMETER", "OFF")) if self._mac_filter_parameter == "": self._mac_filter_parameter = "OFF" self._dut_in_mac_filter = False 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 """ LabWifiBase.__init__(self, tc_name, global_config) # Get configurable AP dhcp settings self._dhcp_enabled = str(self._configurable_ap. get_param_value("DHCP_ENABLED")) if self._dhcp_enabled == "None" or self._dhcp_enabled == "": self._dhcp_enabled = "False" self._low_excluded_addr = str(self._configurable_ap. get_param_value("LOW_EXCLUDED_IP")) self._high_excluded_addr = str(self._configurable_ap. get_param_value("HIGH_EXCLUDED_IP")) self._dhcp_subnet = str(self._configurable_ap. get_param_value("DHCP_SUBNET")) self._dhcp_subnet_mask = str(self._configurable_ap. get_param_value("DHCP_SUBNET_MASK")) self._dhcp_lease = str(self._configurable_ap. get_param_value("DHCP_LEASE")) self._dhcp_gateway_address = str(self._configurable_ap. get_param_value("DHCP_GATEWAY"))
def __init__(self, tc_name, global_config): """ Constructor """ LabWifiBase.__init__(self, tc_name, global_config) self._passphrase_2 = None self._security_2 = str(self._tc_parameters.get_param_value("WIFI_SECURITY_2")) self._eap_user_2 = self._tc_parameters.get_param_value("EAP_USER", self.__get_bc_ap_param("EAP_user")) self._eap_password_2 = self.__get_bc_ap_param("EAP_password") if self._security_2 in ["WEP64", "WEP64-OPEN"]: self._passphrase_2 = self._passphrase_wep64 elif self._security_2 in ["WEP128", "WEP128-OPEN"]: self._passphrase_2 = self._passphrase_wep128 elif self._security_2 in ["EAP-WPA", "EAP-WPA2"]: # Get WIFI Router configuration according to WPA-enterprise options self._eap_method_2 = str(self._tc_parameters.get_param_value("EAP_METHOD_2")) self._phase2_auth_2 = str(self._tc_parameters.get_param_value("PHASE2_AUTH_2")) if self._eap_method_2 == "SIM": self._eap_user_2 = self.__get_bc_ap_param("EAP_SIM_user") # If no username is required, we don't need the password if self._eap_user_2 == "": self._eap_password = "" elif self._eap_method_2 == "AKA": self._eap_user_2 = self.__get_bc_ap_param("EAP_AKA_user") # If no username is required, we don't need the password if self._eap_user_2 == "": self._eap_password_2 = "" # Compute passphrase for WPA-ENT (will be parsed by ACS Embedded) self._passphrase_2 = self._eap_method_2 + "-" + self._phase2_auth_2 \ + "_" + self._eap_user_2 + "_" + self._eap_password_2 \ + "_" + self._certificat_name + "_" + str(self._mandatory_cert) elif "WPA2" in self._security_2: self._passphrase_2 = self._passphrase_wpa2 elif "WPA" in self._security_2: self._passphrase_2 = self._passphrase_wpa
def __init__(self, tc_name, global_config): """ Constructor """ LabWifiBase.__init__(self, tc_name, global_config) # Parameter for ping controls self._packetsize = 32 self._packnb = 4 self._lossrate = 25 # Time to wait for wifi fully switch off self._wifi_switchoff_time = 10 # Time to wait for wifi fully switch on self._wifi_switchon_time = 25 # Get UECmdLayer for bluetooth self._bt_api = self._device.get_uecmd("LocalConnectivity") # Record whether Wifi is already connected to handle B2B continuous mode values self._is_wifi_already_connected = None # Time to wait for SSID list refresh self._waiting_check_time = 120
def __init__(self, tc_name, global_config): """ Constructor """ LabWifiBase.__init__(self, tc_name, global_config) self._original_flight_mode = None self._computer = None self._disconnected = False self._unplugged = False self._changedroute = False self._destination = None self._netmask = None self._iface = None self._hotspot_ip = None self._network = None 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")) # Should we unplug USB during tethering ? unplug_usb = str(self._tc_parameters.get_param_value("UNPLUG_USB")) if unplug_usb.lower() in ["1", "on", "true", "yes"]: self._unplug_usb = 1 else: self._unplug_usb = 0 # Should we turn wifi off during tethering ? wifi_off = str(self._tc_parameters.get_param_value("WIFI_OFF")) if wifi_off.lower() in ["1", "on", "true", "yes"]: self._wifi_off = 1 else: self._wifi_off = 0