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'
6TIME = 'SHORT'
7NAME = 'network_WiFi_RoamSuspendSSID.rsn'
8TEST_TYPE = 'Server'
9DOC = """
10This test verifies that the connection manager connects to a
11previously connected network on resume from suspend when an
12SSID disappears during suspend.
13
14"""
15
16from autotest_lib.client.common_lib.cros.network import xmlrpc_security_types
17from autotest_lib.server.cros.network import hostap_config
18
19
20def run(machine):
21    mode = hostap_config.HostapConfig.MODE_11N_MIXED
22    wpa_config0 = xmlrpc_security_types.WPAConfig(
23            psk='chromeos0',
24            wpa_mode=xmlrpc_security_types.WPAConfig.MODE_PURE_WPA2,
25	    wpa2_ciphers=[xmlrpc_security_types.WPAConfig.CIPHER_CCMP])
26    wpa_config1 = xmlrpc_security_types.WPAConfig(
27            psk='chromeos1',
28            wpa_mode=xmlrpc_security_types.WPAConfig.MODE_PURE_WPA2,
29	    wpa2_ciphers=[xmlrpc_security_types.WPAConfig.CIPHER_CCMP])
30    ap_config0 = hostap_config.HostapConfig(channel=1,
31                                            security_config=wpa_config0,
32					    mode=mode)
33    ap_config1 = hostap_config.HostapConfig(channel=44,
34                                            security_config=wpa_config1,
35					    mode=mode)
36    job.run_test('network_WiFi_RoamSuspendSSID',
37                 tag=NAME.split('.')[1],
38                 host=hosts.create_host(machine),
39                 raw_cmdline_args=args,
40                 additional_params=(ap_config0, ap_config1))
41
42
43parallel_simple(run, machines)
44