[autotest] site_linux_router: increase hostapd startup timeout

It doesn't actually take hostapd very long to start up (I see 3-5
seconds in the longest cases), but it can take a little while to
check whether or not it has started up. This is partly because we use 3
different methods in _has_hostapd_started(), and each is run over a new
SSH session. Additionally, poll_for_condition() is not very forgiving --
when we use a 10 second timeout, it decides to cut us off even if (due
to, e.g., network delays, autoserv load, etc.) the last time we started
a "check for liveness" was much earlier in the 10 second window. This is
apparently how the function was designed, despite its flaws. Perhaps
we'll change that in CL:1364090.

But regardless, it's fair to increase this timeout significantly.
Looking through recent failures in startup, there are exactly zero
legitimate instances of hitting this timeout condition. In all cases,
hostapd started relatively quickly, but the last time we checked in was
1 to 2 seconds before it finished starting up. If we triple the timeout,
we are likely to get at least one or two more chances to check in with
hostapd, and we can hopefully avoid the spurious timeout.

Another reason a large timeout is no problem here: we also have negative
checks in _has_hostapd_started() which can detect whether
(a) hostapd terminated early (i.e., PID is not running) or
(b) hostapd logged some known errors already and is preparing to shut
    down.
With those two cases, we will short-circuit and raise TestFail() anyway,
so we won't hit the timeout. So the only legitamite use of this timeout
is for very exceptional cases, which we aren't hitting in the lab today.

Side note: I spot-checked every recent "timeout" we've seen in the lab,
and all of them are spurious cases of
poll_for_condition()/_has_hostapd_started() declaring premature timeout.

BUG=chromium:811975
TEST=a few network_WiFi_... tests, even with 10 seconds of delay added
     to _has_hostapd_started()

Change-Id: If814ae8b17435998fdcb4a74073ecab04b202feb
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1366335
Reviewed-by: Kirtika Ruchandani <kirtika@chromium.org>
diff --git a/server/site_linux_router.py b/server/site_linux_router.py
index fe8e86d..51464d4 100644
--- a/server/site_linux_router.py
+++ b/server/site_linux_router.py
@@ -98,7 +98,7 @@
 
     KNOWN_TEST_PREFIX = 'network_WiFi_'
     POLLING_INTERVAL_SECONDS = 0.5
-    STARTUP_TIMEOUT_SECONDS = 10
+    STARTUP_TIMEOUT_SECONDS = 30
     SUFFIX_LETTERS = string.ascii_lowercase + string.digits
     SUBNET_PREFIX_OCTETS = (192, 168)