def setup_class(self): self.dut = self.android_devices[0] req_params = [ 'RemoteServer', 'RetailAccessPoints', 'rssi_test_params', 'main_network', 'testbed_params' ] self.unpack_userparams(req_params) self.testclass_params = self.rssi_test_params self.num_atten = self.attenuators[0].instrument.num_atten self.iperf_server = self.iperf_servers[0] self.iperf_client = self.iperf_clients[0] self.remote_server = ssh.connection.SshConnection( ssh.settings.from_config(self.RemoteServer[0]['ssh_config'])) self.access_point = retail_ap.create(self.RetailAccessPoints)[0] self.log_path = os.path.join(logging.log_path, 'results') os.makedirs(self.log_path, exist_ok=True) self.log.info('Access Point Configuration: {}'.format( self.access_point.ap_settings)) self.testclass_results = [] # Turn WiFi ON if self.testclass_params.get('airplane_mode', 1): self.log.info('Turning on airplane mode.') asserts.assert_true(utils.force_airplane_mode(self.dut, True), "Can not turn on airplane mode.") wutils.wifi_toggle_state(self.dut, True)
def setup_class(self): self.tag = 0 self.iperf_result = {} self.thread_list = [] self.log_files = [] if not setup_multiple_devices_for_bt_test(self.android_devices): self.log.error("Failed to setup devices for bluetooth test") return False req_params = ["network", "iperf"] opt_params = ["AccessPoint", "RetailAccessPoints", "RelayDevice"] self.unpack_userparams(req_params, opt_params) if hasattr(self, "RelayDevice"): self.audio_receiver = self.relay_devices[0] self.audio_receiver.power_on() else: self.log.warning("Missing Relay config file.") self.path = self.pri_ad.log_path if hasattr(self, "AccessPoint"): self.ap = self.access_points[0] configure_and_start_ap(self.ap, self.network) elif hasattr(self, "RetailAccessPoints"): self.access_points = retail_ap.create(self.RetailAccessPoints) self.access_point = self.access_points[0] band = self.access_point.band_lookup_by_channel( self.network["channel"]) self.access_point.set_channel(band, self.network["channel"]) else: self.log.warning("config file have no access point information") wifi_test_device_init(self.pri_ad) wifi_connect(self.pri_ad, self.network)
def setup_class(self): self.dut = self.android_devices[-1] req_params = [ 'ping_test_params', 'testbed_params', 'main_network', 'RetailAccessPoints', 'RemoteServer' ] opt_params = ['OTASniffer'] self.unpack_userparams(req_params, opt_params) self.testclass_params = self.ping_test_params self.num_atten = self.attenuators[0].instrument.num_atten self.ping_server = ssh.connection.SshConnection( ssh.settings.from_config(self.RemoteServer[0]['ssh_config'])) self.access_point = retail_ap.create(self.RetailAccessPoints)[0] if hasattr(self, 'OTASniffer') and self.testbed_params['sniffer_enable']: self.sniffer = ota_sniffer.create(self.OTASniffer)[0] self.log.info('Access Point Configuration: {}'.format( self.access_point.ap_settings)) self.log_path = os.path.join(logging.log_path, 'results') os.makedirs(self.log_path, exist_ok=True) self.atten_dut_chain_map = {} self.testclass_results = [] # Turn WiFi ON if self.testclass_params.get('airplane_mode', 1): self.log.info('Turning on airplane mode.') asserts.assert_true(utils.force_airplane_mode(self.dut, True), "Can not turn on airplane mode.") wutils.wifi_toggle_state(self.dut, True) # Configure test retries self.user_params['retry_tests'] = [self.__class__.__name__]
def setup_class(self): self.dut = self.android_devices[0] req_params = ["rssi_test_params", "testbed_params", "main_network"] opt_params = ["RetailAccessPoints"] self.unpack_userparams(req_params, opt_params) self.test_params = self.rssi_test_params self.num_atten = self.attenuators[0].instrument.num_atten self.iperf_server = self.iperf_servers[0] self.access_points = retail_ap.create(self.RetailAccessPoints) self.access_point = self.access_points[0] self.log_path = os.path.join(logging.log_path, "results") utils.create_dir(self.log_path) self.log.info("Access Point Configuration: {}".format( self.access_point.ap_settings)) self.testclass_results = []
def setup_class(self): super().setup_class() self.pri_ad = self.android_devices[0] if len(self.android_devices) == 2: self.sec_ad = self.android_devices[1] elif len(self.android_devices) == 3: self.third_ad = self.android_devices[2] self.ssh_config = None self.counter = 0 self.thread_list = [] if not setup_multiple_devices_for_bt_test(self.android_devices): self.log.error('Failed to setup devices for bluetooth test') return False req_params = ['network', 'iperf'] opt_params = [ 'AccessPoint', 'RetailAccessPoints', 'RelayDevice', 'required_devices' ] self.unpack_userparams(req_params, opt_params) self.iperf_server = self.iperf_servers[0] self.iperf_client = self.iperf_clients[0] if hasattr(self, 'RelayDevice'): self.audio_receiver = self.relay_devices[0] self.audio_receiver.power_on() self.headset_mac_address = self.audio_receiver.mac_address else: self.log.warning('Missing Relay config file.') if hasattr(self, 'AccessPoint'): self.ap = self.access_points[0] configure_and_start_ap(self.ap, self.network) elif hasattr(self, 'RetailAccessPoints'): self.retail_access_points = retail_ap.create( self.RetailAccessPoints) self.retail_access_point = self.retail_access_points[0] band = self.retail_access_point.band_lookup_by_channel( self.network['channel']) self.retail_access_point.set_channel(band, self.network['channel']) else: self.log.warning('config file have no access point information') wifi_test_device_init(self.pri_ad) wifi_connect(self.pri_ad, self.network, num_of_tries=5)
def setup_class(self): """Initializes common test hardware and parameters. This function initializes hardwares and compiles parameters that are common to all tests in this class. """ self.dut = self.android_devices[-1] req_params = [ 'RetailAccessPoints', 'rvr_test_params', 'testbed_params', 'RemoteServer', 'main_network' ] opt_params = ['golden_files_list', 'OTASniffer'] self.unpack_userparams(req_params, opt_params) self.testclass_params = self.rvr_test_params self.num_atten = self.attenuators[0].instrument.num_atten self.iperf_server = self.iperf_servers[0] self.remote_server = ssh.connection.SshConnection( ssh.settings.from_config(self.RemoteServer[0]['ssh_config'])) self.iperf_client = self.iperf_clients[0] self.access_point = retail_ap.create(self.RetailAccessPoints)[0] if hasattr(self, 'OTASniffer') and self.testbed_params['sniffer_enable']: self.sniffer = ota_sniffer.create(self.OTASniffer)[0] self.log.info('Access Point Configuration: {}'.format( self.access_point.ap_settings)) self.log_path = os.path.join(logging.log_path, 'results') os.makedirs(self.log_path, exist_ok=True) if not hasattr(self, 'golden_files_list'): if 'golden_results_path' in self.testbed_params: self.golden_files_list = [ os.path.join(self.testbed_params['golden_results_path'], file) for file in os.listdir(self.testbed_params['golden_results_path']) ] else: self.log.warning('No golden files found.') self.golden_files_list = [] self.testclass_results = [] # Turn WiFi ON if self.testclass_params.get('airplane_mode', 1): self.log.info('Turning on airplane mode.') asserts.assert_true(utils.force_airplane_mode(self.dut, True), "Can not turn on airplane mode.") wutils.wifi_toggle_state(self.dut, True)
def setup_class(self): """Initializes common test hardware and parameters. This function initializes hardwares and compiles parameters that are common to all tests in this class. """ self.dut = self.android_devices[-1] req_params = [ 'RetailAccessPoints', 'roaming_test_params', 'testbed_params' ] opt_params = ['main_network', 'RemoteServer'] self.unpack_userparams(req_params, opt_params) self.testclass_params = self.roaming_test_params self.num_atten = self.attenuators[0].instrument.num_atten self.remote_server = ssh.connection.SshConnection( ssh.settings.from_config(self.RemoteServer[0]['ssh_config'])) self.remote_server.setup_master_ssh() self.iperf_server = self.iperf_servers[0] self.iperf_client = self.iperf_clients[0] self.access_point = retail_ap.create(self.RetailAccessPoints)[0] self.log.info('Access Point Configuration: {}'.format( self.access_point.ap_settings)) # Get RF connection map self.log.info("Getting RF connection map.") wutils.wifi_toggle_state(self.dut, True) self.rf_map_by_network, self.rf_map_by_atten = ( wputils.get_full_rf_connection_map(self.attenuators, self.dut, self.remote_server, self.main_network)) self.log.info("RF Map (by Network): {}".format(self.rf_map_by_network)) self.log.info("RF Map (by Atten): {}".format(self.rf_map_by_atten)) #Turn WiFi ON if self.testclass_params.get('airplane_mode', 1): self.log.info('Turning on airplane mode.') asserts.assert_true(utils.force_airplane_mode(self.dut, True), "Can not turn on airplane mode.") wutils.wifi_toggle_state(self.dut, True)
def setup_class(self): self.dut = self.android_devices[0] req_params = [ "throughput_stability_test_params", "testbed_params", "main_network" ] opt_params = ["RetailAccessPoints"] self.unpack_userparams(req_params, opt_params) self.test_params = self.throughput_stability_test_params self.num_atten = self.attenuators[0].instrument.num_atten self.iperf_server = self.iperf_servers[0] self.access_points = retail_ap.create(self.RetailAccessPoints) self.access_point = self.access_points[0] self.log_path = os.path.join(logging.log_path, "test_results") utils.create_dir(self.log_path) self.log.info("Access Point Configuration: {}".format( self.access_point.ap_settings)) if not hasattr(self, "golden_files_list"): self.golden_files_list = [ os.path.join(self.testbed_params["golden_results_path"], file) for file in os.listdir( self.testbed_params["golden_results_path"]) ]
def setup_class(self): """Initializes common test hardware and parameters. This function initializes hardwares and compiles parameters that are common to all tests in this class. """ self.dut = self.android_devices[-1] req_params = [ 'RetailAccessPoints', 'sensitivity_test_params', 'testbed_params', 'RemoteServer' ] opt_params = ['main_network'] self.unpack_userparams(req_params, opt_params) self.testclass_params = self.sensitivity_test_params self.num_atten = self.attenuators[0].instrument.num_atten self.ping_server = ssh.connection.SshConnection( ssh.settings.from_config(self.RemoteServer[0]['ssh_config'])) self.iperf_server = self.iperf_servers[0] self.iperf_client = self.iperf_clients[0] self.access_point = retail_ap.create(self.RetailAccessPoints)[0] self.log.info('Access Point Configuration: {}'.format( self.access_point.ap_settings)) self.log_path = os.path.join(logging.log_path, 'results') os.makedirs(self.log_path, exist_ok=True) self.atten_dut_chain_map = {} self.testclass_results = [] # Turn WiFi ON if self.testclass_params.get('airplane_mode', 1): self.log.info('Turning on airplane mode.') asserts.assert_true(utils.force_airplane_mode(self.dut, True), "Can not turn on airplane mode.") wutils.wifi_toggle_state(self.dut, True) # Configure test retries self.user_params['retry_tests'] = [self.__class__.__name__]
def setup_class(self): self.dut = self.android_devices[-1] # Initialize AP to ensure that tests can be run in later suites req_params = ['RetailAccessPoints'] opt_params = ['bdf', 'firmware'] self.unpack_userparams(req_params, opt_params) self.access_point = retail_ap.create(self.RetailAccessPoints)[0] # Load BDF and firmware if needed if hasattr(self, 'bdf'): self.log.info('Pushing WiFi BDF to DUT.') wputils.push_bdf(self.dut, self.bdf[0]) if hasattr(self, 'firmware'): self.log.info('Pushing WiFi firmware to DUT.') wlanmdsp = [ file for file in self.firmware if "wlanmdsp.mbn" in file ][0] data_msc = [file for file in self.firmware if "Data.msc" in file][0] wputils.push_firmware(self.dut, wlanmdsp, data_msc) for ad in self.android_devices: ad.droid.wifiEnableVerboseLogging(1) ad.adb.shell("wpa_cli -i wlan0 -p -g@android:wpa_wlan0 IFNAME=" "wlan0 log_level EXCESSIVE")