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