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_checkHiddenWPA' 7TIME = 'SHORT' 8TEST_TYPE = 'Server' 9ATTRIBUTES = ('suite:wifi_matfunc, suite:wifi_release, subsystem:wifi') 10DEPENDENCIES = 'wificell' 11 12DOC = """ 13This test verifies that we can connect to hidden WPA networks. It checks 14several common configurations of hidden networks such as pure WPA/WPA2 and 15mixed WPA/WPA2 networks. 16""" 17 18from autotest_lib.client.common_lib.cros.network import xmlrpc_datatypes 19from autotest_lib.client.common_lib.cros.network import xmlrpc_security_types 20from autotest_lib.server.cros.network import hostap_config 21 22 23def get_configurations(): 24 wpa_configs = [ 25 xmlrpc_security_types.WPAConfig( 26 psk='chromeos', 27 wpa_mode=xmlrpc_security_types.WPAConfig.MODE_PURE_WPA, 28 wpa_ciphers=[xmlrpc_security_types.WPAConfig.CIPHER_TKIP]), 29 xmlrpc_security_types.WPAConfig( 30 psk='chromeos', 31 wpa_mode=xmlrpc_security_types.WPAConfig.MODE_PURE_WPA, 32 wpa_ciphers=[xmlrpc_security_types.WPAConfig.CIPHER_TKIP, 33 xmlrpc_security_types.WPAConfig.CIPHER_CCMP]), 34 xmlrpc_security_types.WPAConfig( 35 psk='chromeos', 36 wpa_mode=xmlrpc_security_types.WPAConfig.MODE_PURE_WPA2, 37 wpa2_ciphers=[xmlrpc_security_types.WPAConfig.CIPHER_CCMP]), 38 xmlrpc_security_types.WPAConfig( 39 psk='chromeos', 40 wpa_mode=xmlrpc_security_types.WPAConfig.MODE_MIXED_WPA, 41 wpa_ciphers=[xmlrpc_security_types.WPAConfig.CIPHER_TKIP, 42 xmlrpc_security_types.WPAConfig.CIPHER_CCMP], 43 wpa2_ciphers=[xmlrpc_security_types.WPAConfig.CIPHER_CCMP]), 44 ] 45 for wpa_config in wpa_configs: 46 ap_config = hostap_config.HostapConfig( 47 hide_ssid=True, 48 frequency=2412, 49 mode=hostap_config.HostapConfig.MODE_11G, 50 security_config=wpa_config) 51 assoc_params = xmlrpc_datatypes.AssociationParameters( 52 is_hidden=True, 53 security_config=wpa_config) 54 configurations = [(ap_config, assoc_params)] 55 return configurations 56 57 58def run(machine): 59 host = hosts.create_host(machine) 60 job.run_test('network_WiFi_SimpleConnect', 61 tag=NAME.split('.')[1], 62 host=host, 63 raw_cmdline_args=args, 64 additional_params=get_configurations()) 65 66 67parallel_simple(run, machines) 68