Home | History | Annotate | Download | only in network_WiFi_SimpleConnect
      1 # Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
      2 # Use of this source code is governed by a BSD-style license that can be
      3 # found in the LICENSE file.
      4 
      5 AUTHOR = 'wiley, pstew, quiche'
      6 NAME = 'network_WiFi_SimpleConnect.wifi_checkHiddenWPA'
      7 TIME = 'SHORT'
      8 TEST_TYPE = 'Server'
      9 ATTRIBUTES = ('suite:wifi_correctness_cros_core, suite:wifi_matfunc, '
     10               'suite:wifi_matfunc_bcm4371, suite:wifi_release')
     11 SUITE = ('wifi_matfunc, wifi_matfunc_bcm4371, '
     12          'wifi_correctness_cros_core, wifi_release')
     13 DEPENDENCIES = 'wificell'
     14 
     15 DOC = """
     16 This test verifies that we can connect to hidden WPA networks.  It checks
     17 several common configurations of hidden networks such as pure WPA/WPA2 and
     18 mixed WPA/WPA2 networks.
     19 """
     20 
     21 from autotest_lib.client.common_lib.cros.network import xmlrpc_datatypes
     22 from autotest_lib.client.common_lib.cros.network import xmlrpc_security_types
     23 from autotest_lib.server.cros.network import hostap_config
     24 
     25 
     26 def get_configurations():
     27     wpa_configs = [
     28             xmlrpc_security_types.WPAConfig(
     29                     psk='chromeos',
     30                     wpa_mode=xmlrpc_security_types.WPAConfig.MODE_PURE_WPA,
     31                     wpa_ciphers=[xmlrpc_security_types.WPAConfig.CIPHER_TKIP]),
     32             xmlrpc_security_types.WPAConfig(
     33                     psk='chromeos',
     34                     wpa_mode=xmlrpc_security_types.WPAConfig.MODE_PURE_WPA,
     35                     wpa_ciphers=[xmlrpc_security_types.WPAConfig.CIPHER_TKIP,
     36                                  xmlrpc_security_types.WPAConfig.CIPHER_CCMP]),
     37             xmlrpc_security_types.WPAConfig(
     38                     psk='chromeos',
     39                     wpa_mode=xmlrpc_security_types.WPAConfig.MODE_PURE_WPA2,
     40                     wpa2_ciphers=[xmlrpc_security_types.WPAConfig.CIPHER_CCMP]),
     41             xmlrpc_security_types.WPAConfig(
     42                     psk='chromeos',
     43                     wpa_mode=xmlrpc_security_types.WPAConfig.MODE_MIXED_WPA,
     44                     wpa_ciphers=[xmlrpc_security_types.WPAConfig.CIPHER_TKIP,
     45                                  xmlrpc_security_types.WPAConfig.CIPHER_CCMP],
     46                     wpa2_ciphers=[xmlrpc_security_types.WPAConfig.CIPHER_CCMP]),
     47     ]
     48     for wpa_config in wpa_configs:
     49         ap_config = hostap_config.HostapConfig(
     50                 hide_ssid=True,
     51                 frequency=2412,
     52                 mode=hostap_config.HostapConfig.MODE_11G,
     53                 security_config=wpa_config)
     54         assoc_params = xmlrpc_datatypes.AssociationParameters(
     55                 is_hidden=True,
     56                 security_config=wpa_config)
     57         configurations = [(ap_config, assoc_params)]
     58     return configurations
     59 
     60 
     61 def run(machine):
     62     host = hosts.create_host(machine)
     63     job.run_test('network_WiFi_SimpleConnect',
     64                  tag=NAME.split('.')[1],
     65                  host=host,
     66                  raw_cmdline_args=args,
     67                  additional_params=get_configurations())
     68 
     69 
     70 parallel_simple(run, machines)
     71