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.Stress' 7 TIME = 'MEDIUM' 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 successfully reconnects to a network in dark 15 resume after getting disconnected from that same network while suspended. 16 This test simulates the cases where multiple disconnect and SSID appearance 17 events take place over a single period of suspension. The test is conducted as 18 follows: 19 20 1) AP ("AP 1") is brought up, and DUT connects to it 21 2) AP 1 is brought down, disconnecting the DUT from it 22 3) Another AP ("AP 2") is brought up, and DUT connects to it 23 4) DUT suspends while connected to AP 2 24 5) AP 2 is brought down, disconnecting the DUT from it while suspended 25 6) AP 2 is brought up again 26 7) Repeat steps 5-6 another 4 times (for 5 total iterations) 27 8) The DUT is woken from suspend 28 9) 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 Note: this test suspends the DUT for long periods of time, which may lead to 35 flakiness if the ssh connection from the autotest host to the DUT has a 36 ServerAliveInterval setting that is too low (i.e. less than the total suspend 37 time). This test was verified stable with the ServerAliveInterval set to 900. 38 """ 39 40 from autotest_lib.client.common_lib.cros.network import xmlrpc_datatypes 41 from autotest_lib.client.common_lib.cros.network import xmlrpc_security_types 42 from autotest_lib.server.cros.network import hostap_config 43 from autotest_lib.server import utils 44 45 args_dict = utils.args_to_dict(args) 46 servo_args = hosts.CrosHost.get_servo_arguments(args_dict) 47 48 def run(machine): 49 host = hosts.create_host(machine, servo_args=servo_args) 50 job.run_test('network_WiFi_ReconnectInDarkResume', 51 host=host, 52 tag=NAME.split('.')[1], 53 disconnect_before_suspend=False, 54 reconnect_to_same_ap=True, 55 num_iterations=5, 56 raw_cmdline_args=args) 57 58 parallel_simple(run, machines) 59