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.DisconnectAfterSuspendSameAP' 9TIME = 'SHORT' 10TEST_TYPE = 'Server' 11DEPENDENCIES = 'wificell, servo, lucidsleep' 12ATTRIBUTES = 'suite:wifi_correctness_cros_core, suite:wifi_lucidsleep' 13SUITE = 'wifi_correctness_cros_core, wifi_lucidsleep' 14 15DOC = """ 16This test verifies that the DUT that suspends connected, then subsequently 17disconnects while suspended, successfully reconnects to a preferred network 18that later appears while it is still suspended. In this test, the preferred 19network that appears during suspend is the same network that the DUT was last 20connected to before suspend. 21 22The test is conducted as follows: 23 241) AP ("AP 1") is brought up, and DUT connects to it 252) AP 1 is brought down, disconnecting the DUT from it 263) Another AP ("AP 2") is brought up, and DUT connects to it 274) DUT suspends while connected to AP 2 285) AP 2 is brought down, disconnecting the DUT from it while suspended 296) AP 2 is brought up again 307) The DUT is woken from suspend 318) Verify that the DUT is connected to AP 2 upon resuming from suspend 32 33We verify the connectivity status of the DUT on resume by parsing shill logs, 34since the delays involved in waking a DUT from suspend using autotest framework 35make real-time checks inaccurate. 36""" 37 38args_dict = utils.args_to_dict(args) 39servo_args = hosts.CrosHost.get_servo_arguments(args_dict) 40 41def 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 51parallel_simple(run, machines) 52