Home | History | Annotate | Download | only in network_WiFi_ReconnectInDarkResume
      1 # Copyright 2015 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 = 'samueltan, ejcaruso'
      6 NAME = 'network_WiFi_ReconnectInDarkResume.DisconnectBeforeSuspendDiffAP'
      7 TIME = 'SHORT'
      8 TEST_TYPE = 'Server'
      9 DEPENDENCIES = 'servo, wificell, lucidsleep'
     10 ATTRIBUTES = 'suite:wifi_correctness_cros_core, suite:wifi_lucidsleep'
     11 
     12 DOC = """
     13 This test verifies that the DUT that suspends disconnected successfully
     14 reconnects to a preferred network that appears while it is suspended. In this
     15 test, the preferred network that appears during suspend is different from the
     16 one that the DUT was last connected to before suspend.
     17 
     18 The test is conducted as follows:
     19 
     20 1) AP ("AP 1") is brought up, and DUT connects to it
     21 2) AP 1 is brought down, disconnecting the DUT from it
     22 3) Another AP ("AP 2") is brought up, and DUT connects to it
     23 4) AP 2 is brought down, disconnecting the DUT from it
     24 5) DUT suspends while disconnected
     25 6) AP 1 is brought up again
     26 7) The DUT is woken from suspend
     27 8) Verify that the DUT is connected to AP 1 upon resuming from suspend
     28 
     29 We verify the connectivity status of the DUT on resume by parsing shill logs,
     30 since the delays involved in waking a DUT from suspend using autotest framework
     31 make real-time checks inaccurate.
     32 """
     33 
     34 from autotest_lib.client.common_lib.cros.network import xmlrpc_datatypes
     35 from autotest_lib.client.common_lib.cros.network import xmlrpc_security_types
     36 from autotest_lib.server.cros.network import hostap_config
     37 from autotest_lib.server import utils
     38 
     39 args_dict = utils.args_to_dict(args)
     40 servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
     41 
     42 def run(machine):
     43     host = hosts.create_host(machine, servo_args=servo_args)
     44     job.run_test('network_WiFi_ReconnectInDarkResume',
     45                  host=host,
     46                  tag=NAME.split('.')[1],
     47                  disconnect_before_suspend=True,
     48                  reconnect_to_same_ap=False,
     49                  num_iterations=1,
     50                  raw_cmdline_args=args)
     51 
     52 
     53 parallel_simple(run, machines)
     54