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 5AUTHOR = 'wiley, pstew, quiche' 6NAME = 'network_WiFi_SimpleConnect.wifi_checkOddWPAPassphrases' 7TIME = 'SHORT' 8TEST_TYPE = 'Server' 9ATTRIBUTES = ('suite:wifi_matfunc, suite:wifi_matfunc_bcm4371, ' 10 'suite:wifi_release') 11SUITE = 'wifi_matfunc, wifi_matfunc_bcm4371, wifi_release' 12DEPENDENCIES = 'wificell' 13 14DOC = """ 15This tests verifies that we can connect to an AP broadcasting a WPA network 16with a variety of unusual passphrases. 17""" 18 19from autotest_lib.client.common_lib.cros.network import xmlrpc_datatypes 20from autotest_lib.client.common_lib.cros.network import xmlrpc_security_types 21from autotest_lib.server.cros.network import hostap_config 22 23 24def get_configurations(): 25 wpa_configs = [] 26 psks = ['\xe4\xb8\x80\xe4\xba\x8c\xe4\xb8\x89', # Pure unicode. 27 'abcdef\xc2\xa2', # Mixed unicode and ASCII. 28 ' !"#$%&\'()>*+,-./:;<=>?@[\\]^_{|}~'] # All punctuation. 29 for psk in psks: 30 wpa_configs.append(xmlrpc_security_types.WPAConfig( 31 psk=psk, 32 wpa_mode=xmlrpc_security_types.WPAConfig.MODE_PURE_WPA2, 33 wpa2_ciphers=[xmlrpc_security_types.WPAConfig.CIPHER_CCMP])) 34 wpa_configs.append(xmlrpc_security_types.WPAConfig( 35 psk=psk, 36 wpa_mode=xmlrpc_security_types.WPAConfig.MODE_PURE_WPA, 37 wpa_ciphers=[xmlrpc_security_types.WPAConfig.CIPHER_TKIP])) 38 return [(hostap_config.HostapConfig( 39 frequency=2412, 40 mode=hostap_config.HostapConfig.MODE_11G, 41 security_config=wpa_config), 42 xmlrpc_datatypes.AssociationParameters(security_config=wpa_config)) 43 for wpa_config in wpa_configs] 44 45 46def run(machine): 47 host = hosts.create_host(machine) 48 job.run_test('network_WiFi_SimpleConnect', 49 tag=NAME.split('.')[1], 50 host=host, 51 raw_cmdline_args=args, 52 additional_params=get_configurations()) 53 54 55parallel_simple(run, machines) 56