Home | History | Annotate | Download | only in policy_WiFiPrecedenceServer
      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 
      5 AUTHOR = 'timkovich'
      6 TIME = 'SHORT'
      7 NAME = 'policy_WiFiPrecedenceServer.managed_vs_unmanaged'
      8 TEST_TYPE = 'Server'
      9 ATTRIBUTES = 'suite:ent-wificell'
     10 DEPENDENCIES = 'wificell'
     11 
     12 DOC = """
     13 'policy_WiFiPrecedenceServer.managed_vs_unmanaged' sets up two APs.
     14 The client test is given a network policy for one of the networks.
     15 The DUT then connects to the unmanaged network so that the DUT "remembers"
     16 that network.
     17 
     18 The DUT should connect to the managed network specified in the user policy.
     19 
     20 """
     21 
     22 
     23 from autotest_lib.client.common_lib.cros.network import xmlrpc_security_types
     24 from autotest_lib.client.cros.enterprise.network_config import NetworkConfig
     25 from autotest_lib.server.cros.network import hostap_config
     26 
     27 
     28 def 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 
     59 parallel_simple(run, machines)
     60