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_checkWEP40'
      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 case verifies that the DUT can connect to an AP using
     17 WEP both open and shared system authentication and 40-bit
     18 pre-shared keys.
     19 """
     20 
     21 
     22 from autotest_lib.client.common_lib.cros.network import xmlrpc_datatypes
     23 from autotest_lib.client.common_lib.cros.network import xmlrpc_security_types
     24 from autotest_lib.server.cros.network import hostap_config
     25 
     26 
     27 def run(machine):
     28     # FYI: D-Bus requires string parameters must be valid UTF-8.
     29     wep_keys = ['abcde', # Interpretted as ASCII.
     30                 'fedcba9876',  # Interpretted as hex.
     31                 # Mix ASCII characters with a 3-byte UTF-8 character.
     32                 'ab\xe4\xb8\x89',
     33                 # Mix different byte length UTF-8 characters.
     34                 '\xe4\xb8\x89\xc2\xa2']
     35     auth_algs = (xmlrpc_security_types.WEPConfig.AUTH_ALGORITHM_OPEN,
     36                  xmlrpc_security_types.WEPConfig.AUTH_ALGORITHM_SHARED)
     37     configurations = []
     38     for auth_algorithm in auth_algs:
     39         for i in range(len(wep_keys)):
     40             wep_config = xmlrpc_security_types.WEPConfig(
     41                     wep_keys,
     42                     wep_default_key=i,
     43                     auth_algorithm=auth_algorithm)
     44             ap_config = hostap_config.HostapConfig(
     45                     frequency=2412,
     46                     mode=hostap_config.HostapConfig.MODE_11G,
     47                     security_config=wep_config)
     48             assoc_params = xmlrpc_datatypes.AssociationParameters(
     49                     security_config=wep_config)
     50             configurations.append((ap_config, assoc_params))
     51     host = hosts.create_host(machine)
     52     job.run_test('network_WiFi_SimpleConnect',
     53                  tag=NAME.split('.')[1],
     54                  host=host,
     55                  raw_cmdline_args=args,
     56                  additional_params=configurations)
     57 
     58 
     59 parallel_simple(run, machines)
     60