autotest: Add simple test to verify operation of dual radio router

This will assist us in bringing up multi-radio routers quickly.

TEST=suite wifi_matfunc passes with these changes to
site_linux_system.py
BUG=chromium:313963
Change-Id: Id4fa86b9df0d3ba68c9fed2e546e894ddd84aee0
Reviewed-on: https://chromium-review.googlesource.com/176117
Tested-by: Christopher Wiley <wiley@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Christopher Wiley <wiley@chromium.org>
diff --git a/server/site_linux_router.py b/server/site_linux_router.py
index cd30f40..779497c 100644
--- a/server/site_linux_router.py
+++ b/server/site_linux_router.py
@@ -225,6 +225,7 @@
                 log_file, pid_file, conf_file)
         self.router.run(start_command)
         self.hostapd_instances.append({
+            'ssid': conf['ssid'],
             'conf_file': conf_file,
             'log_file': log_file,
             'interface': interface,
@@ -758,10 +759,10 @@
         self.router.run('grep -q "%s" %s' % (pmksa_match, instance['log_file']))
 
 
-    def get_ssid(self):
+    def get_ssid(self, instance=0):
         """@return string ssid for the network stemming from this router."""
-        if self.hostapd['configured']:
-            return self.hostapd['conf']['ssid']
+        if self.hostapd_instances:
+            return self.hostapd_instances[instance]['ssid']
 
         if not 'ssid' in self.station['conf']:
             raise error.TestFail('Requested ssid of an unconfigured AP.')
diff --git a/server/site_tests/network_WiFi_VerifyRouter/control b/server/site_tests/network_WiFi_VerifyRouter/control
new file mode 100644
index 0000000..54b5b1c
--- /dev/null
+++ b/server/site_tests/network_WiFi_VerifyRouter/control
@@ -0,0 +1,25 @@
+# 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.
+
+AUTHOR = 'wiley@chromium.com'
+NAME = 'network_WiFi_VerifyRouter'
+TIME = 'SHORT'
+TEST_TYPE = 'Server'
+SUITE = 'wifi_matfunc'
+DEPENDENCIES = 'wificell'
+
+DOC = """
+This test is designed to check as quickly as possible that a dual radio
+router is working correctly.
+"""
+
+
+def run(machine):
+    host = hosts.create_host(machine)
+    job.run_test('network_WiFi_VerifyRouter',
+                 host=host,
+                 raw_cmdline_args=args)
+
+
+parallel_simple(run, machines)
diff --git a/server/site_tests/network_WiFi_VerifyRouter/network_WiFi_VerifyRouter.py b/server/site_tests/network_WiFi_VerifyRouter/network_WiFi_VerifyRouter.py
new file mode 100644
index 0000000..286e643
--- /dev/null
+++ b/server/site_tests/network_WiFi_VerifyRouter/network_WiFi_VerifyRouter.py
@@ -0,0 +1,27 @@
+# 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 import site_linux_system
+from autotest_lib.server.cros.network import hostap_config
+from autotest_lib.server.cros.network import wifi_cell_test_base
+
+
+class network_WiFi_VerifyRouter(wifi_cell_test_base.WiFiCellTestBase):
+    """Test that a dual radio router can use both radios."""
+    version = 1
+
+
+    def run_once(self):
+        """Set up two APs connect to both and then exit."""
+        self.context.router.require_capabilities(
+                [site_linux_system.LinuxSystem.CAPABILITY_MULTI_AP_SAME_BAND])
+        ap_config = hostap_config.HostapConfig(channel=6)
+        # Create an AP, manually specifying both the SSID and BSSID.
+        self.context.configure(ap_config)
+        self.context.configure(ap_config, multi_interface=True)
+        for instance in range(2):
+            client_conf = xmlrpc_datatypes.AssociationParameters(
+                    ssid=self.context.router.get_ssid(instance=instance))
+            self.context.assert_connect_wifi(client_conf)