upload_prebuilts: Look in all relevant overlays for GS acl file.

We currently only look in the primary overlay for the Google Storage ACL file.
This means that any project that wants a builder (and hence a hidden GS ACL
file) is forced to have a private overlay.

We may now have projects that share a common master overlay that contains this
ACL file. After this CL, we search for this file in all the stacked overlays.

BUG=chromium:424325
TEST=unittests.

Change-Id: I14ae3744bc7bcb9e418e1b5230ffaae94ee2ddf1
Reviewed-on: https://chromium-review.googlesource.com/223853
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Prathmesh Prabhu <pprabhu@chromium.org>
Tested-by: Prathmesh Prabhu <pprabhu@chromium.org>
diff --git a/scripts/upload_prebuilts_unittest.py b/scripts/upload_prebuilts_unittest.py
index d63f6e8..d498765 100755
--- a/scripts/upload_prebuilts_unittest.py
+++ b/scripts/upload_prebuilts_unittest.py
@@ -21,6 +21,7 @@
 from chromite.lib import gs
 from chromite.lib import binpkg
 from chromite.lib import osutils
+from chromite.lib import portage_util
 
 # pylint: disable=E1120,W0212,R0904
 PUBLIC_PACKAGES = [{'CPV': 'gtk+/public1', 'SHA1': '1', 'MTIME': '1'},
@@ -419,12 +420,13 @@
     self.mox.StubOutWithMock(binpkg, 'GrabRemotePackageIndex')
     binpkg.GrabRemotePackageIndex(old_binhost).AndReturn(True)
     self.mox.StubOutWithMock(prebuilt.PrebuiltUploader, '__init__')
-    self.mox.StubOutWithMock(prebuilt, 'GetBoardOverlay')
+    self.mox.StubOutWithMock(portage_util, 'FindOverlayFile')
     fake_overlay_path = '/fake_path'
-    prebuilt.GetBoardOverlay(
-        options.build_path, options.board).AndReturn(fake_overlay_path)
     expected_gs_acl_path = os.path.join(fake_overlay_path,
                                         prebuilt._GOOGLESTORAGE_GSUTIL_FILE)
+    portage_util.FindOverlayFile(
+        prebuilt._GOOGLESTORAGE_GSUTIL_FILE, board=options.board,
+        buildroot=options.build_path).AndReturn(expected_gs_acl_path)
     prebuilt.PrebuiltUploader.__init__(options.upload, expected_gs_acl_path,
                                        options.upload, mox.IgnoreArg(),
                                        options.build_path, options.packages,