• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_correctness_cros_core, suite:wifi_lucidsleep'
11SUITE = 'wifi_correctness_cros_core, wifi_lucidsleep'
12
13DOC = """
14This test verifies that the DUT that suspends disconnected successfully
15reconnects to a preferred network that appears while it is suspended. In this
16test, the preferred network that appears during suspend is the same network that
17the DUT was last connected to before suspend.
18
19The test is conducted as follows:
20
211) AP ("AP 1") is brought up, and DUT connects to it
222) AP 1 is brought down, disconnecting the DUT from it
233) Another AP ("AP 2") is brought up, and DUT connects to it
244) AP 2 is brought down, disconnecting the DUT from it
255) DUT suspends while disconnected
266) AP 2 is brought up again
277) The DUT is woken from suspend
288) Verify that the DUT is connected to AP 2 upon resuming from suspend
29
30We verify the connectivity status of the DUT on resume by parsing shill logs,
31since the delays involved in waking a DUT from suspend using autotest framework
32make real-time checks inaccurate.
33"""
34
35from autotest_lib.client.common_lib.cros.network import xmlrpc_datatypes
36from autotest_lib.client.common_lib.cros.network import xmlrpc_security_types
37from autotest_lib.server.cros.network import hostap_config
38from autotest_lib.server import utils
39
40args_dict = utils.args_to_dict(args)
41servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
42
43def 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
54parallel_simple(run, machines)
55