blob: 791384e4431112ad773e3b13ea3461ff809bf990 [file] [log] [blame]
# Copyright 2014 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import time
from autotest_lib.client.common_lib import error
from import hostap_config
from import lucid_sleep_test_base
from import wifi_client
class network_WiFi_WakeOnDisconnect(lucid_sleep_test_base.LucidSleepTestBase):
"""Test that WiFi disconnect wakes up the system."""
version = 1
def run_once(self):
"""Body of the test."""
client = self.context.client
router = self.context.router
# Enable the dark connect feature in shill.
with client.wake_on_wifi_features(wifi_client.WAKE_ON_WIFI_DARKCONNECT):'Set up WoWLAN')
with self.dr_utils.suspend():
# Kick over the router to trigger wake on disconnect.
# Wait for the DUT to wake up in dark resume and suspend again.
# Ensure that wake on packet did not trigger a full wake.
raise error.TestFail('Client woke up fully.')
if self.dr_utils.count_dark_resumes() < 1:
raise error.TestFail('Client failed to wake up.')'Client woke up successfully.')