network_WiFi_VerifyRouter.py revision 73115681214ba5a04a94ed4f8b7fc60989b5524a
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
5import logging
6
7from autotest_lib.client.common_lib.cros.network import xmlrpc_datatypes
8from autotest_lib.server import site_linux_system
9from autotest_lib.server.cros.network import hostap_config
10from autotest_lib.server.cros.network import wifi_cell_test_base
11
12
13class network_WiFi_VerifyRouter(wifi_cell_test_base.WiFiCellTestBase):
14    """Test that a dual radio router can use both radios."""
15    version = 1
16
17
18    def run_once(self):
19        """Set up two APs connect to both and then exit."""
20        self.context.router.require_capabilities(
21                [site_linux_system.LinuxSystem.CAPABILITY_MULTI_AP_SAME_BAND])
22        ap_config = hostap_config.HostapConfig(channel=6)
23        # Create an AP, manually specifying both the SSID and BSSID.
24        self.context.configure(ap_config)
25        self.context.configure(ap_config, multi_interface=True)
26        for instance in range(2):
27            client_conf = xmlrpc_datatypes.AssociationParameters(
28                    ssid=self.context.router.get_ssid(instance=instance))
29            self.context.assert_connect_wifi(client_conf)
30            logging.info('Signal level for AP %d is %d', instance,
31                         self.context.client.wifi_signal_level)
32            self.write_perf_keyval({'signal_for_ap_%d' % instance:
33                                    self.context.client.wifi_signal_level})
34