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 5AUTHOR = 'samueltan, ejcaruso' 6NAME = 'network_WiFi_ReconnectInDarkResume.DisconnectBeforeSuspendSameAP' 7TIME = 'SHORT' 8TEST_TYPE = 'Server' 9DEPENDENCIES = 'servo, wificell, lucidsleep' 10ATTRIBUTES = 'suite:wifi_lucidsleep' 11 12DOC = """ 13This test verifies that the DUT that suspends disconnected successfully 14reconnects to a preferred network that appears while it is suspended. In this 15test, the preferred network that appears during suspend is the same network that 16the DUT was last connected to before suspend. 17 18The test is conducted as follows: 19 201) AP ("AP 1") is brought up, and DUT connects to it 212) AP 1 is brought down, disconnecting the DUT from it 223) Another AP ("AP 2") is brought up, and DUT connects to it 234) AP 2 is brought down, disconnecting the DUT from it 245) DUT suspends while disconnected 256) AP 2 is brought up again 267) The DUT is woken from suspend 278) Verify that the DUT is connected to AP 2 upon resuming from suspend 28 29We verify the connectivity status of the DUT on resume by parsing shill logs, 30since the delays involved in waking a DUT from suspend using autotest framework 31make real-time checks inaccurate. 32""" 33 34from autotest_lib.client.common_lib.cros.network import xmlrpc_datatypes 35from autotest_lib.client.common_lib.cros.network import xmlrpc_security_types 36from autotest_lib.server.cros.network import hostap_config 37from autotest_lib.server import utils 38 39args_dict = utils.args_to_dict(args) 40servo_args = hosts.CrosHost.get_servo_arguments(args_dict) 41 42def 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=True, 49 num_iterations=1, 50 raw_cmdline_args=args) 51 52 53parallel_simple(run, machines) 54