Rewrite SuspendTimeout to do explicit deauth

The previous version of the SuspendTimeout test relied on setting
an inactivity timeout on the AP.  This turns out to be somewhat
unreliable as the AP does some number of attempts to restore
connectivity.  Instead, use the hostapd_cli interface to explicitly
deauth the DUT while it sleeps.

BUG=chromium-os:15689
TEST=Rerun -- all SuspendTimeout tests and ensure that not only do tests
pass (pings succeed) but that all the log_time_diff values appear

Change-Id: Ibb88e34a2d8150ace74cca2b0df3cf01bea8808c
Reviewed-on: http://gerrit.chromium.org/gerrit/1468
Reviewed-by: Sam Leffler <sleffler@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
diff --git a/server/site_linux_router.py b/server/site_linux_router.py
index 71696c5..60f8822 100644
--- a/server/site_linux_router.py
+++ b/server/site_linux_router.py
@@ -29,6 +29,7 @@
         self.wiredif = params.get('wiredev', "eth0")
         self.cmd_brctl = "/usr/sbin/brctl"
         self.cmd_hostapd = "/usr/sbin/hostapd"
+        self.cmd_hostapd_cli = "/usr/sbin/hostapd_cli"
 
         # Router host.
         self.router = host
@@ -46,7 +47,8 @@
             'conf': {
                 'ssid': defssid,
                 'bridge': self.bridgeif,
-                'hw_mode': 'g'
+                'hw_mode': 'g',
+                'ctrl_interface': '/tmp/hostapd-test.control'
             }
         }
         self.station = {
@@ -465,3 +467,10 @@
                         (self.cmd_iw, params.get('interface',
                                                  self.hostapd['interface']),
                          params.get('power', 'auto')))
+
+
+    def deauth(self, params):
+        self.router.run('%s -p%s deauthenticate %s' %
+                        (self.cmd_hostapd_cli,
+                         self.hostapd['conf']['ctrl_interface'],
+                         params['client']))