[autotest] Add retrying logic to devserver calls, autoupdate 'test'

Have the autoupdate 'test' control file that we use to reimage devices
use a RetryingAFE, so that it doesn't die in the event of frontend
restarts.

Also, re-use the same retrying logic to have the DevServer class retry
calls in the event of URLErrors.  We don't do this for
DevServerExceptions, because that would cause us to retry for things
like attempts to trigger a download with a malformed image name, which
we don't want to do.

BUG=chromium-os:31418
TEST=unit
TEST=run_suite using a local dev server that's not running initially.
TEST=It should keep trying until you start the dev server, at which point things should progress normally.

Change-Id: Id8c7b07ce19d528ae35e7df6a7359234329869df
Reviewed-on: https://gerrit.chromium.org/gerrit/28101
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Ready: Chris Masone <cmasone@chromium.org>
diff --git a/server/cros/frontend_wrappers_unittest.py b/server/cros/frontend_wrappers_unittest.py
index 96656dc..49e6ad3 100644
--- a/server/cros/frontend_wrappers_unittest.py
+++ b/server/cros/frontend_wrappers_unittest.py
@@ -9,6 +9,7 @@
 import time
 import unittest
 
+from autotest_lib.client.common_lib.cros import retry
 from autotest_lib.server.cros import frontend_wrappers
 from autotest_lib.server import frontend
 
@@ -29,9 +30,7 @@
         """Tests that a wrapped function succeeds without retrying."""
         timeout_min = .1
         timeout_sec = timeout_min * 60
-        @frontend_wrappers.retry(Exception,
-                                 timeout_min=timeout_min,
-                                 delay_sec=1)
+        @retry.retry(Exception, timeout_min=timeout_min, delay_sec=1)
         def succeed():
             return True
 
@@ -44,9 +43,7 @@
         """Tests that a wrapped function can retry and succeed."""
         timeout_min = .1
         timeout_sec = timeout_min * 60
-        @frontend_wrappers.retry(Exception,
-                                 timeout_min=timeout_min,
-                                 delay_sec=1)
+        @retry.retry(Exception, timeout_min=timeout_min, delay_sec=1)
         def flaky_succeed():
             if self._FLAKY_FLAG:
                 return True
@@ -62,9 +59,7 @@
         """Tests that a wrapped function retries til the timeout, then fails."""
         timeout_min = .01
         timeout_sec = timeout_min * 60
-        @frontend_wrappers.retry(Exception,
-                                 timeout_min=timeout_min,
-                                 delay_sec=1)
+        @retry.retry(Exception, timeout_min=timeout_min, delay_sec=1)
         def fail():
             raise Exception()