Build API: Enter chroot on INSIDE assertion.
BUG=chromium:953049
TEST=run_tests
TEST=manual - called INSIDE endpoint and verified entry
Cq-Depend: chromium:1569042
Change-Id: I78ad1a249d90b5de112ed6da4db319bcf19ff836
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/1570352
Tested-by: Alex Klein <saklein@chromium.org>
Reviewed-by: Evan Hernandez <evanhernandez@chromium.org>
Reviewed-by: Sean Abraham <seanabraham@chromium.org>
diff --git a/api/controller/sdk_unittest.py b/api/controller/sdk_unittest.py
index 7774e0a..03d924e 100644
--- a/api/controller/sdk_unittest.py
+++ b/api/controller/sdk_unittest.py
@@ -24,7 +24,7 @@
self.PatchObject(cros_build_lib, 'IsInsideChroot', return_value=False)
def _GetRequest(self, no_replace=False, bootstrap=False, no_use_image=False,
- cache_path=None, chrome_path=None, chroot_path=None):
+ cache_path=None, chroot_path=None):
"""Helper to build a create request message."""
request = sdk_pb2.CreateRequest()
request.flags.no_replace = no_replace
@@ -32,11 +32,9 @@
request.flags.no_use_image = no_use_image
if cache_path:
- request.paths.cache = cache_path
- if chrome_path:
- request.paths.chrome = chrome_path
+ request.chroot.cache_dir = cache_path
if chroot_path:
- request.paths.chroot = chroot_path
+ request.chroot.path = chroot_path
return request
@@ -84,13 +82,10 @@
# Test the path arguments get passed through.
cache_dir = '/cache/dir'
- chrome_root = '/chrome/path'
chroot_path = '/chroot/path'
- request = self._GetRequest(cache_path=cache_dir, chrome_path=chrome_root,
- chroot_path=chroot_path)
+ request = self._GetRequest(cache_path=cache_dir, chroot_path=chroot_path)
sdk_controller.Create(request, response)
- paths_patch.assert_called_with(cache_dir=cache_dir, chrome_root=chrome_root,
- chroot_path=chroot_path)
+ paths_patch.assert_called_with(cache_dir=cache_dir, chroot_path=chroot_path)
class SdkUpdateTest(cros_test_lib.MockTestCase):