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