# Copyright 2019 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. AUTHOR = 'timkovich' TIME = 'SHORT' NAME = 'policy_WiFiPrecedenceServer.device_vs_user' TEST_TYPE = 'Server' ATTRIBUTES = 'suite:ent-wificell' DEPENDENCIES = 'wificell' DOC = """ 'policy_WiFiPrecedenceServer.user_vs_device' sets up both an open user and device network. The client test is given a network policy for both networks with AutoConnect=True. The user network should connect because, with all other things being equal, the user policy should take precedence. """ from autotest_lib.client.common_lib.cros.network import xmlrpc_security_types from autotest_lib.client.cros.enterprise.network_config import NetworkConfig from autotest_lib.server.cros.network import hostap_config def run(machine): user_ssid = 'User Network' device_ssid = 'Device Network' n_mode = hostap_config.HostapConfig.MODE_11N_MIXED ap_configs = [] ap_configs.append(hostap_config.HostapConfig( channel=5, mode=n_mode, ssid=user_ssid)) ap_configs.append(hostap_config.HostapConfig( channel=149, mode=n_mode, ssid=device_ssid)) # Client network configurations. network1_config = NetworkConfig(user_ssid, autoconnect=True) network2_config = NetworkConfig(device_ssid, autoconnect=True) host = hosts.create_host(machine) job.run_test('policy_WiFiPrecedenceServer', raw_cmdline_args=args, host=host, ap_configs=ap_configs, network1_config=network1_config, network2_config=network2_config, precedence=1, test='device_vs_user') parallel_simple(run, machines)