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