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