blob: 3ecae3d8b65b77c2b9ed773c27e4fff1a88c5377 [file] [log] [blame]
# Copyright (c) 2013 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.
from autotest_lib.client.common_lib.cros.network import xmlrpc_datatypes
from autotest_lib.server.cros.wlan import hostap_config
from autotest_lib.server.cros.wlan import wifi_test_base
from autotest_lib.server.cros.wlan import wifi_client
class network_WiFi_DTIMPeriod(wifi_test_base.WiFiTestBase):
"""Test that we understand the routers negotiated DTIM period."""
version = 1
def run_once_impl(self):
"""DTIM period test.
DTIM stands for delivery traffic information message and refers to
the number of beacons between DTIMS. For instance, a DTIM period
of 1 would indicate that every beacon should have a DTIM element.
The default DTIM period value is 2.
This flag is used in combination with powersave mode as follows:
1) A client goes into powersave mode and notifies the router.
2) While in powersave mode, the client turns off as much as possible;
the AP is supposed to buffer unicast traffic.
3) The client wakes up to receive beacons, which may include a DTIM
notification.
4) On receiving such a notification, the client should
stay up to recieve the pending frames.
"""
dtim_val = 5
configuration = hostap_config.HostapConfig(
frequency=2437,
mode=hostap_config.HostapConfig.MODE_11G,
dtim_period=dtim_val)
self.context.configure(configuration)
assoc_params = xmlrpc_datatypes.AssociationParameters()
assoc_params.ssid = self.context.router.get_ssid()
self.context.client.powersave_switch(True)
self.assert_connect_wifi(assoc_params)
self.context.client.check_iw_link_value(
wifi_client.WiFiClient.IW_LITNK_KEY_DTIM_PERIOD,
dtim_val)
self.assert_ping_from_dut()
self.context.client.shill.disconnect(assoc_params.ssid)
self.context.client.powersave_switch(False)
self.context.router.deconfig()