def setup_class(self):
        super().setup_class()

        self.android_devices = getattr(self, 'android_devices', [])
        self.fuchsia_devices = getattr(self, 'fuchsia_devices', [])

        if 'dut' in self.user_params:
            if self.user_params['dut'] == 'fuchsia_devices':
                self.dut = create_wlan_device(self.fuchsia_devices[0])
            elif self.user_params['dut'] == 'android_devices':
                self.dut = create_wlan_device(self.android_devices[0])
            else:
                raise ValueError('Invalid DUT specified in config. (%s)' %
                                 self.user_params['dut'])
        else:
            # Default is an android device, just like the other tests
            self.dut = create_wlan_device(self.android_devices[0])

        self.access_point = self.access_points[0]

        # IPerf Server is run on the AP and setup in the tests
        self.iperf_server_on_ap = None
        self.iperf_client_on_dut = self.iperf_clients[0]

        self.router_adv_daemon = None

        # Times (in seconds) to wait for DUT network connection and assigning an
        # ip address to the wlan interface.
        wlan_reboot_params = self.user_params.get('wlan_reboot_params', {})
        self.dut_network_connection_timeout = wlan_reboot_params.get(
            'dut_network_connection_timeout', DUT_NETWORK_CONNECTION_TIMEOUT)
        self.dut_ip_address_timeout = wlan_reboot_params.get(
            'dut_ip_address_timeout', DUT_IP_ADDRESS_TIMEOUT)
Example #2
0
    def setup_class(self):
        super().setup_class()
        if 'dut' in self.user_params:
            if self.user_params['dut'] == 'fuchsia_devices':
                self.dut = create_wlan_device(self.fuchsia_devices[0])
            elif self.user_params['dut'] == 'android_devices':
                self.dut = create_wlan_device(self.android_devices[0])
            else:
                raise ValueError('Invalid DUT specified in config. (%s)' %
                                 self.user_params['dut'])
        else:
            # Default is an android device, just like the other tests
            self.dut = create_wlan_device(self.android_devices[0])

        self.access_point = self.access_points[0]

        # Same for both 2g and 5g
        self.ssid = utils.rand_ascii_str(hostapd_constants.AP_SSID_LENGTH_2G)
        self.password = utils.rand_ascii_str(
            hostapd_constants.AP_PASSPHRASE_LENGTH_2G)
        self.security_profile_wpa2 = Security(
            security_mode=hostapd_constants.WPA2_STRING,
            password=self.password,
            wpa2_cipher=hostapd_constants.WPA2_DEFAULT_CIPER)

        self.access_point.stop_all_aps()
 def setup_class(self):
     super().setup_class()
     dut = self.user_params.get('dut', None)
     if dut:
         if dut == 'fuchsia_devices':
             self.dut = create_wlan_device(self.fuchsia_devices[0])
         elif dut == 'android_devices':
             self.dut = create_wlan_device(self.android_devices[0])
         else:
             raise ValueError('Invalid DUT specified in config. (%s)' %
                              self.user_params['dut'])
     else:
         # Default is an Fuchsia device
         self.dut = create_wlan_device(self.fuchsia_devices[0])
    def setup_class(self):
        super().setup_class()
        if 'dut' in self.user_params:
            if self.user_params['dut'] == 'fuchsia_devices':
                self.dut = create_wlan_device(self.fuchsia_devices[0])
            elif self.user_params['dut'] == 'android_devices':
                self.dut = create_wlan_device(self.android_devices[0])
            else:
                raise ValueError('Invalid DUT specified in config. (%s)' %
                                 self.user_params['dut'])
        else:
            # Default is an android device, just like the other tests
            self.dut = create_wlan_device(self.android_devices[0])

        self.access_point = self.access_points[0]
        self.access_point.stop_all_aps()
Example #5
0
    def setup_class(self):
        super().setup_class()
        if 'dut' in self.user_params:
            if self.user_params['dut'] == 'fuchsia_devices':
                self.dut = create_wlan_device(self.fuchsia_devices[0])
            elif self.user_params['dut'] == 'android_devices':
                self.dut = create_wlan_device(self.android_devices[0])
            else:
                raise ValueError('Invalid DUT specified in config. (%s)' %
                                 self.user_params['dut'])
        else:
            self.dut = create_wlan_device(self.android_devices[0])

        self.access_point = self.access_points[0]
        self.android_devices = getattr(self, 'android_devices', [])
        self.access_point.stop_all_aps()
Example #6
0
 def setup_class(self):
     super().setup_class()
     self.ssid = rand_ascii_str(10)
     self.wlan_device = create_wlan_device(self.fuchsia_devices[0])
     self.ap = self.access_points[0]
     self.num_of_iterations = int(
         self.user_params.get("beacon_loss_test_iterations",
                              self.num_of_iterations))
     self.in_use_interface = None
 def setup_class(self):
     super().setup_class()
     self.ssid = rand_ascii_str(10)
     self.fd = self.fuchsia_devices[0]
     self.dut = create_wlan_device(self.fd)
     self.ap = self.access_points[0]
     self.num_of_iterations = int(
         self.user_params.get("connection_stress_test_iterations",
                              self.num_of_iterations))
     self.log.info('iterations: %d' % self.num_of_iterations)
Example #8
0
    def setup_class(self):
        super().setup_class()

        self.ssid = rand_ascii_str(10)
        self.fd = self.fuchsia_devices[0]
        self.wlan_device = create_wlan_device(self.fd)
        self.ap = self.access_points[0]
        setup_ap_and_associate(access_point=self.ap,
                               client=self.wlan_device,
                               profile_name='whirlwind',
                               channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
                               ssid=self.ssid,
                               setup_bridge=True)
Example #9
0
    def setup_class(self):
        super().setup_class()
        self.ssid = rand_ascii_str(10)
        self.fd = self.fuchsia_devices[0]
        self.wlan_device = create_wlan_device(self.fd)
        self.ap = self.access_points[0]
        self.num_of_iterations = int(
            self.user_params.get("download_stress_test_iterations",
                                 self.num_of_iterations))

        setup_ap_and_associate(
            access_point=self.ap,
            client=self.wlan_device,
            profile_name='whirlwind',
            channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
            ssid=self.ssid)
    def setup_class(self):
        self.dut = create_wlan_device(self.fuchsia_devices[0])
        self.dut.device.netstack_lib.init()

        # TODO(fxb/51313): Add in device agnosticity for clients
        self.clients = []
        for device in self.android_devices:
            self.clients.append(SoftApClient(device))
        self.primary_client = self.clients[0]

        self.iperf_server_config = {
            'user': self.dut.device.ssh_username,
            'host': self.dut.device.ip,
            'ssh_config': self.dut.device.ssh_config
        }
        self.iperf_server = iperf_server.IPerfServerOverSsh(
            self.iperf_server_config, DEFAULT_IPERF_PORT, use_killall=True)
        self.iperf_server.start()

        try:
            self.access_point = self.access_points[0]
        except AttributeError:
            self.access_point = None
 def __init__(self, device):
     self.w_device = create_wlan_device(device)
     self.ip_client = iperf_client.IPerfClientOverAdb(device.serial)
    def setup_class(self):
        super(WlanRvrTest, self).setup_class()
        if 'dut' in self.user_params:
            if self.user_params['dut'] == 'fuchsia_devices':
                self.dut = create_wlan_device(self.fuchsia_devices[0])
            elif self.user_params['dut'] == 'android_devices':
                self.dut = create_wlan_device(self.android_devices[0])
            else:
                raise ValueError('Invalid DUT specified in config. (%s)' %
                                 self.user_params['dut'])
        else:
            # Default is an android device, just like the other tests
            self.dut = create_wlan_device(self.android_devices[0])

        self.starting_attn = (self.user_params['rvr_settings'].get(
            'starting_attn', 0))

        self.ending_attn = (self.user_params['rvr_settings'].get(
            'ending_attn', 95))

        self.step_size_in_db = (self.user_params['rvr_settings'].get(
            'step_size_in_db', 1))

        self.dwell_time_in_secs = (self.user_params['rvr_settings'].get(
            'dwell_time_in_secs', 10))

        self.reverse_rvr_after_forward = bool(
            (self.user_params['rvr_settings'].get('reverse_rvr_after_forward',
                                                  None)))

        self.iperf_flags = (self.user_params['rvr_settings'].get(
            'iperf_flags', '-i 1'))

        self.iperf_flags = '%s -t %s -J' % (self.iperf_flags,
                                            self.dwell_time_in_secs)

        self.debug_loop_count = (self.user_params['rvr_settings'].get(
            'debug_loop_count', 1))

        self.debug_pre_traffic_cmd = (self.user_params['rvr_settings'].get(
            'debug_pre_traffic_cmd', None))

        self.debug_post_traffic_cmd = (self.user_params['rvr_settings'].get(
            'debug_post_traffic_cmd', None))

        self.router_adv_daemon = None
        self.check_if_has_private_local_ipv6_address = True

        if self.ending_attn == 'auto':
            self.use_auto_end = True
            self.ending_attn = 100
            if self.step_size_in_db > 2:
                asserts.fail('When using an ending attenuation of \'auto\' '
                             'please use a value < 2db.  Larger jumps will '
                             'break the test reporting.')

        self.access_point = self.access_points[0]
        self.attenuators_2g = get_attenuators_for_device(
            self.controller_configs['AccessPoint'][0]['Attenuator'],
            self.attenuators, 'attenuator_ports_wifi_2g')
        self.attenuators_5g = get_attenuators_for_device(
            self.controller_configs['AccessPoint'][0]['Attenuator'],
            self.attenuators, 'attenuator_ports_wifi_5g')

        self.iperf_server = self.iperf_servers[0]
        self.dut_iperf_client = self.iperf_clients[0]

        self.access_point.stop_all_aps()