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