Пример #1
0
 def test_associate_actiontec_mi424wr_24ghz_open(self):
     validate_setup_ap_and_associate(
         access_point=self.access_point,
         client=self.dut,
         profile_name='actiontec_mi424wr',
         channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
         ssid=self.ssid)
Пример #2
0
 def test_associate_tplink_tlwr940n_24ghz_open(self):
     validate_setup_ap_and_associate(
         access_point=self.access_point,
         client=self.dut,
         profile_name='tplink_tlwr940n',
         channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
         ssid=self.ssid)
Пример #3
0
 def test_associate_securifi_almond_24ghz_open(self):
     validate_setup_ap_and_associate(
         access_point=self.access_point,
         client=self.dut,
         profile_name='securifi_almond',
         channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
         ssid=self.ssid)
Пример #4
0
 def test_associate_linksys_wrt1900acv2_5ghz_open(self):
     validate_setup_ap_and_associate(
         access_point=self.access_point,
         client=self.dut,
         profile_name='linksys_wrt1900acv2',
         channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
         ssid=self.ssid)
Пример #5
0
 def test_associate_netgear_wndr3400_5ghz_open(self):
     validate_setup_ap_and_associate(
         access_point=self.access_point,
         client=self.dut,
         profile_name='netgear_wndr3400',
         channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
         ssid=self.ssid)
Пример #6
0
 def test_associate_belkin_f9k1001v5_24ghz_open(self):
     validate_setup_ap_and_associate(
         access_point=self.access_point,
         client=self.dut,
         profile_name='belkin_f9k1001v5',
         channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
         ssid=self.ssid)
Пример #7
0
 def test_associate_asus_rtac86u_5ghz_open(self):
     validate_setup_ap_and_associate(
         access_point=self.access_point,
         client=self.dut,
         profile_name='asus_rtac86u',
         channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
         ssid=self.ssid)
    def setup_and_connect(self, ap_settings):
        """Generates a hostapd config, setups up the AP with that config, then
           attempts to associate a DUT

        Args:
               ap_settings: A dictionary of hostapd constant n_capabilities.
        """
        security_profile = None
        password = None
        temp_n_capabilities = list(ap_settings['n_capabilities'])
        n_capabilities = []
        for n_capability in temp_n_capabilities:
            if n_capability in hostapd_constants.N_CAPABILITIES_MAPPING.keys():
                n_capabilities.append(n_capability)

        if ap_settings['chbw'] == 'HT20' or ap_settings['chbw'] == 'HT40+':
            if ap_settings['frequency'] == '2.4GHz':
                channel = 1
            elif ap_settings['frequency'] == '5GHz':
                channel = 36
            else:
                raise ValueError('Invalid frequence: %s' %
                                 ap_settings['frequency'])

        if ap_settings['chbw'] == 'HT40-':
            if ap_settings['frequency'] == '2.4GHz':
                channel = 11
            elif ap_settings['frequency'] == '5GHz':
                channel = 60
            else:
                raise ValueError('Invalid frequency: %s' %
                                 ap_settings['frequency'])

        if ap_settings['chbw'] == 'HT40-' or ap_settings['chbw'] == 'HT40+':
            if hostapd_config.ht40_plus_allowed(channel):
                extended_channel = hostapd_constants.N_CAPABILITY_HT40_PLUS
            elif hostapd_config.ht40_minus_allowed(channel):
                extended_channel = hostapd_constants.N_CAPABILITY_HT40_MINUS
            else:
                raise ValueError('Invalid channel: %s' % channel)
            n_capabilities.append(extended_channel)

        if ap_settings['security'] == 'wpa2':
            security_profile = Security(security_mode=SECURITY_WPA2,
                                        password=rand_ascii_str(20),
                                        wpa_cipher='CCMP',
                                        wpa2_cipher='CCMP')
            password = security_profile.password

        validate_setup_ap_and_associate(access_point=self.access_point,
                                        client=self.dut,
                                        profile_name='whirlwind',
                                        mode=hostapd_constants.MODE_11N_MIXED,
                                        channel=channel,
                                        n_capabilities=n_capabilities,
                                        ac_capabilities=[],
                                        force_wmm=True,
                                        ssid=utils.rand_ascii_str(20),
                                        security=security_profile,
                                        password=password)
Пример #9
0
    def setup_and_connect(self, ap_settings):
        """Uses ap_settings to set up ap and then attempts to associate a DUT.

        Args:
            ap_settings: a dict containing test case settings, including
                bandwidth, security, n_capabilities, and ac_capabilities

        """
        security = ap_settings['security']
        chbw = ap_settings['chbw']
        password = None
        if security:
            password = security.password
        n_capabilities = ap_settings['n_capabilities']
        ac_capabilities = ap_settings['ac_capabilities']

        validate_setup_ap_and_associate(access_point=self.access_point,
                                        client=self.dut,
                                        profile_name='whirlwind',
                                        mode=hostapd_constants.MODE_11AC_MIXED,
                                        channel=36,
                                        n_capabilities=n_capabilities,
                                        ac_capabilities=ac_capabilities,
                                        force_wmm=True,
                                        ssid=utils.rand_ascii_str(20),
                                        security=security,
                                        vht_bandwidth=chbw,
                                        password=password)
Пример #10
0
 def test_associate_actiontec_pk5000_24ghz_wpa2(self):
     validate_setup_ap_and_associate(
         access_point=self.access_point,
         client=self.dut,
         profile_name='actiontec_pk5000',
         channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
         ssid=self.ssid,
         security=self.security_profile_wpa2,
         password=self.password)
Пример #11
0
 def test_associate_tplink_c1200_5ghz_wpa2(self):
     validate_setup_ap_and_associate(
         access_point=self.access_point,
         client=self.dut,
         profile_name='tplink_c1200',
         channel=hostapd_constants.AP_DEFAULT_CHANNEL_5G,
         ssid=self.ssid,
         security=self.security_profile_wpa2,
         password=self.password)
Пример #12
0
 def test_associate_linksys_wrt1900acv2_24ghz_wpa2(self):
     validate_setup_ap_and_associate(
         access_point=self.access_point,
         client=self.dut,
         profile_name='linksys_wrt1900acv2',
         channel=hostapd_constants.AP_DEFAULT_CHANNEL_2G,
         ssid=self.ssid,
         security=self.security_profile_wpa2,
         password=self.password)