flash: Work outside the chroot again.
Path conversion to/from the chroot was broken since we switched to use
per-workspace chroots. This extends lib/dev_server_wrapper.py with optional
arguments for accommodating workspace-based chroots, and adds workspace
knowledge to cli/flash.py (which underlies cros and brillo flash).
CQ-DEPEND=CL:269265
BUG=brillo:933
TEST=Unit tests
TEST=brillo flash --project-sdk works outside the chroot (failed before).
Change-Id: I2881814a9178fb5f0166d2efc7f09334e09780cb
Reviewed-on: https://chromium-review.googlesource.com/267570
Commit-Queue: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Bertrand Simonnet <bsimonnet@chromium.org>
diff --git a/cli/flash_unittest.py b/cli/flash_unittest.py
index 739ef05..1eb41e1 100644
--- a/cli/flash_unittest.py
+++ b/cli/flash_unittest.py
@@ -18,6 +18,7 @@
from chromite.lib import osutils
from chromite.lib import partial_mock
from chromite.lib import remote_access
+from chromite.lib import workspace_lib
class RemoteDeviceUpdaterMock(partial_mock.PartialCmdMock):
@@ -60,6 +61,7 @@
self.PatchObject(dev_server_wrapper, 'GetUpdatePayloads')
self.PatchObject(remote_access, 'CHECK_INTERVAL', new=0)
self.PatchObject(remote_access, 'ChromiumOSDevice')
+ self.PatchObject(workspace_lib, 'WorkspacePath', return_value=None)
def testUpdateAll(self):
"""Tests that update methods are called correctly."""
@@ -151,6 +153,7 @@
self.PatchObject(brick_lib, 'FindBrickInPath', return_value=None)
self.isgpt_mock = self.PatchObject(flash, '_IsFilePathGPTDiskImage',
return_value=True)
+ self.PatchObject(workspace_lib, 'WorkspacePath', return_value=None)
def testLocalImagePathCopy(self):
"""Tests that imaging methods are called correctly."""