P2P tests: Retry one, make another less strict.

Sometimes when the 2nd DUT looks for the 1st DUT to update via P2P it
will find another DUT in the lab with P2P enabled and use that instead
of the DUT we expect. I have been failing the test in this case but I
now I think it is OK since it is still actually updating via p2p and we
cannot control which DUT P2P decides to use.

I've added a retry to the P2P test for another issue where it cannot
find any hosts sometimes.

BUG=None
TEST=tested it locally

Change-Id: I179dccd9b6009d24d8f0224c57cc9619bbbd012a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/1534252
Tested-by: David Haddock <dhaddock@chromium.org>
Reviewed-by: Katherine Threlkeld <kathrelkeld@chromium.org>
(cherry picked from commit ae49a6b7b8bffb06d6afd3ccfc03d24e2f81f475)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/1588493
Reviewed-by: David Haddock <dhaddock@chromium.org>
Commit-Queue: David Haddock <dhaddock@chromium.org>
diff --git a/server/site_tests/autoupdate_P2P/autoupdate_P2P.py b/server/site_tests/autoupdate_P2P/autoupdate_P2P.py
index 8c1f2a5..c0cf690 100644
--- a/server/site_tests/autoupdate_P2P/autoupdate_P2P.py
+++ b/server/site_tests/autoupdate_P2P/autoupdate_P2P.py
@@ -205,11 +205,10 @@
         line1 = "Checking if payload is available via p2p, file_id=" \
                 "cros_update_size_(.*)_hash_(.*)"
         line2 = "Lookup complete, p2p-client returned URL " \
-                "'http://%s:(.*)/cros_update_size_(.*)_hash_(.*).cros_au'" % \
-                self._hosts[0].ip
+                "'http://(.*)/cros_update_size_(.*)_hash_(.*).cros_au'"
         line3 = "Replacing URL (.*) with local URL " \
-                "http://%s:(.*)/cros_update_size_(.*)_hash_(.*).cros_au " \
-                "since p2p is enabled." % self._hosts[0].ip
+                "http://(.*)/cros_update_size_(.*)_hash_(.*).cros_au " \
+                "since p2p is enabled."
         errline = "Forcibly disabling use of p2p for downloading because no " \
                   "suitable peer could be found."
         too_many_attempts_err_str = "Forcibly disabling use of p2p for " \
diff --git a/server/site_tests/autoupdate_P2P/control.delta b/server/site_tests/autoupdate_P2P/control.delta
index 04edb20..9c202d1 100644
--- a/server/site_tests/autoupdate_P2P/control.delta
+++ b/server/site_tests/autoupdate_P2P/control.delta
@@ -11,6 +11,7 @@
 TEST_TYPE = "server"
 ATTRIBUTES = "suite:bvt-perbuild"
 SYNC_COUNT = 2
+JOB_RETRIES = 2
 DOC = """
 This tests autoupdate between two devices via peer to peer.