• 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.device_vs_user'
8TEST_TYPE = 'Server'
9ATTRIBUTES = 'suite:ent-wificell'
10DEPENDENCIES = 'wificell'
11
12DOC = """
13'policy_WiFiPrecedenceServer.user_vs_device' sets up both an open user
14and device network. The client test is given a network policy for both
15networks with AutoConnect=True.
16
17The user network should connect because, with all other things being equal,
18the user policy should take precedence.
19
20"""
21
22
23from autotest_lib.client.common_lib.cros.network import xmlrpc_security_types
24from autotest_lib.client.cros.enterprise.network_config import NetworkConfig
25from autotest_lib.server.cros.network import hostap_config
26
27
28def run(machine):
29    user_ssid = 'User Network'
30    device_ssid = 'Device Network'
31    n_mode = hostap_config.HostapConfig.MODE_11N_MIXED
32
33    ap_configs = []
34    ap_configs.append(hostap_config.HostapConfig(
35            channel=5,
36            mode=n_mode,
37            ssid=user_ssid))
38
39    ap_configs.append(hostap_config.HostapConfig(
40            channel=149,
41            mode=n_mode,
42            ssid=device_ssid))
43
44    # Client network configurations.
45    network1_config = NetworkConfig(user_ssid, autoconnect=True)
46    network2_config = NetworkConfig(device_ssid, autoconnect=True)
47
48    host = hosts.create_host(machine)
49    job.run_test('policy_WiFiPrecedenceServer',
50                 raw_cmdline_args=args,
51                 host=host,
52                 ap_configs=ap_configs,
53                 network1_config=network1_config,
54                 network2_config=network2_config,
55                 precedence=1,
56                 test='device_vs_user')
57
58
59parallel_simple(run, machines)
60