1 # Copyright (c) 2013 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 from autotest_lib.client.common_lib.cros.network import xmlrpc_datatypes 6 from autotest_lib.server.cros.network import hostap_config 7 from autotest_lib.server.cros.network import wifi_cell_test_base 8 9 10 class network_WiFi_SuspendTwice(wifi_cell_test_base.WiFiCellTestBase): 11 """Test that WiFi works after suspending twice with the device disabled.""" 12 13 version = 1 14 15 16 def run_once(self): 17 """Body of the test.""" 18 self.context.configure(hostap_config.HostapConfig(channel=1)) 19 assoc_params = xmlrpc_datatypes.AssociationParameters( 20 ssid=self.context.router.get_ssid()) 21 self.context.assert_connect_wifi(assoc_params) 22 self.context.client.set_device_enabled( 23 self.context.client.wifi_if, False, fail_on_unsupported=True) 24 self.context.client.do_suspend(3) 25 self.context.client.do_suspend(3) 26 self.context.client.set_device_enabled( 27 self.context.client.wifi_if, True, fail_on_unsupported=True) 28 self.context.wait_for_connection(self.context.router.get_ssid()) 29