• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2019 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 = 'timkovich'
6TIME = 'SHORT'
7NAME = 'policy_WiFiPrecedenceServer.autoconnect_vs_no_autoconnect'
8TEST_TYPE = 'Server'
9ATTRIBUTES = 'suite:ent-wificell'
10DEPENDENCIES = 'wificell'
11
12DOC = """
13'policy_WiFiPrecedenceServer.autoconnect_vs_no_autoconnect' sets up an AP.
14The client test is given two network policies for the same network, one with
15AutoConnect=True and one with AutoConnect=False.
16
17The DUT should autoconnect to the network.
18
19"""
20
21
22from autotest_lib.client.common_lib.cros.network import xmlrpc_security_types
23from autotest_lib.client.cros.enterprise.network_config import NetworkConfig
24from autotest_lib.server.cros.network import hostap_config
25
26
27def run(machine):
28    ssid = 'User Network'
29    n_mode = hostap_config.HostapConfig.MODE_11N_MIXED
30
31    ap_configs = []
32    ap_configs.append(hostap_config.HostapConfig(
33            channel=5,
34            mode=n_mode,
35            ssid=ssid))
36
37    ap_configs.append(hostap_config.HostapConfig(
38            channel=149,
39            mode=n_mode,
40            ssid=ssid))
41
42    # Client network configurations.
43    network1_config = NetworkConfig(ssid, autoconnect=False)
44    network2_config = NetworkConfig(ssid, autoconnect=True)
45
46    host = hosts.create_host(machine)
47    job.run_test('policy_WiFiPrecedenceServer',
48                 raw_cmdline_args=args,
49                 host=host,
50                 ap_configs=ap_configs,
51                 network1_config=network1_config,
52                 network2_config=network2_config)
53
54
55parallel_simple(run, machines)
56