1# Copyright 2016 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 = 'krisr, tienchang, bmahadev' 6NAME = 'network_WiFi_SuspendStress.stress_WPA2' 7TIME = 'LONG' 8TEST_TYPE = 'Server' 9DEPENDENCIES = 'wificell' 10ATTRIBUTES = 'suite:wifi_stress' 11 12DOC = """ 13This test uses powerd_dbus to suspend and resume and checks that the 14wifi adapter is brought back up and connects to a WPA2 network. 15""" 16 17from autotest_lib.client.common_lib.cros.network import xmlrpc_datatypes 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 22def run(machine): 23 host = hosts.create_host(machine) 24 wpa_config = xmlrpc_security_types.WPAConfig( 25 psk='chromeos', 26 wpa_mode=xmlrpc_security_types.WPAConfig.MODE_PURE_WPA2, 27 wpa2_ciphers=[xmlrpc_security_types.WPAConfig.CIPHER_CCMP]) 28 ap_config = hostap_config.HostapConfig( 29 frequency=2412, 30 mode=hostap_config.HostapConfig.MODE_11N_PURE, 31 security_config=wpa_config) 32 assoc_params = xmlrpc_datatypes.AssociationParameters() 33 assoc_params.security_config = wpa_config 34 configurations = [(ap_config, assoc_params)] 35 job.run_test('network_WiFi_SuspendStress', 36 host=host, 37 tag=NAME.split('.')[1], 38 suspends=690, 39 raw_cmdline_args=args, 40 additional_params=configurations) 41 42parallel_simple(run, machines) 43