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.managed_vs_unmanaged' 8TEST_TYPE = 'Server' 9ATTRIBUTES = 'suite:ent-wificell' 10DEPENDENCIES = 'wificell' 11 12DOC = """ 13'policy_WiFiPrecedenceServer.managed_vs_unmanaged' sets up two APs. 14The client test is given a network policy for one of the networks. 15The DUT then connects to the unmanaged network so that the DUT "remembers" 16that network. 17 18The DUT should connect to the managed network specified in the user policy. 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 ssid1 = 'Network1' 30 ssid2 = 'Network2' 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=ssid1)) 38 39 ap_configs.append(hostap_config.HostapConfig( 40 channel=149, 41 mode=n_mode, 42 ssid=ssid2)) 43 44 # Client network configurations. 45 network1_config = NetworkConfig(ssid1, autoconnect=True) 46 network2_config = NetworkConfig(ssid2) 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='managed_vs_unmanaged') 57 58 59parallel_simple(run, machines) 60