# Copyright 2015 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from autotest_lib.server import utils AUTHOR = 'samueltan, ejcaruso' NAME = 'network_WiFi_ReconnectInDarkResume.DisconnectAfterSuspendDiffAP' TIME = 'SHORT' TEST_TYPE = 'Server' DEPENDENCIES = 'wificell, servo, lucidsleep' ATTRIBUTES = 'suite:wifi_lucidsleep' DOC = """ This test verifies that the DUT that suspends connected, then subsequently disconnects while suspended, successfully reconnects to a preferred network that later appears while it is still suspended. In this test, the preferred network that appears during suspend is different from the network that the DUT was last connected to before suspend. The test is conducted as follows: 1) AP ("AP 1") is brought up, and DUT connects to it 2) AP 1 is brought down, disconnecting the DUT from it 3) Another AP ("AP 2") is brought up, and DUT connects to it 4) DUT suspends while connected to AP 2 5) AP 2 is brought down, disconnecting the DUT from it while suspended 6) AP 1 is brought up again 7) The DUT is woken from suspend 8) Verify that the DUT is connected to AP 1 upon resuming from suspend We verify the connectivity status of the DUT on resume by parsing shill logs, since the delays involved in waking a DUT from suspend using autotest framework make real-time checks inaccurate. """ args_dict = utils.args_to_dict(args) servo_args = hosts.CrosHost.get_servo_arguments(args_dict) def run(machine): host = hosts.create_host(machine, servo_args=servo_args) job.run_test('network_WiFi_ReconnectInDarkResume', host=host, tag=NAME.split('.')[1], disconnect_before_suspend=False, reconnect_to_same_ap=False, num_iterations=1, raw_cmdline_args=args) parallel_simple(run, machines)