Commit d9ede243 authored by Sergey Ulanov's avatar Sergey Ulanov Committed by Commit Bot

Fuchsia: Fix bugs in incremental packaged deployment

1. Target.IsNewInstance() was returning to true when host name is
specified explicitly. This is incorrect because the host is expected to
be provisioned and it may be reused for multiple test runs.
2. Updated deployment code to read /blob instead of /blobstore to get
list of existing blobs.

Bug: 798851
Change-Id: I62b04a352a364250e2aa2d44319494481be011c6
Reviewed-on: https://chromium-review.googlesource.com/956349
Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: default avatarWez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541975}
parent 575217c3
...@@ -40,6 +40,7 @@ class DeviceTarget(target.Target): ...@@ -40,6 +40,7 @@ class DeviceTarget(target.Target):
self._host = host self._host = host
if port: if port:
self._port = port self._port = port
self._new_instance = False
def __Discover(self, node_name): def __Discover(self, node_name):
"""Returns the IP address and port of a Fuchsia instance discovered on """Returns the IP address and port of a Fuchsia instance discovered on
......
...@@ -22,7 +22,7 @@ PM = os.path.join(common.SDK_ROOT, 'tools', 'pm') ...@@ -22,7 +22,7 @@ PM = os.path.join(common.SDK_ROOT, 'tools', 'pm')
def _Deploy(target, output_dir, archive_path): def _Deploy(target, output_dir, archive_path):
"""Converts the FAR archive at |archive_path| into a Fuchsia package """Converts the FAR archive at |archive_path| into a Fuchsia package
and deploys it to |target|'s blobstore. If |incremental| is set, and deploys it to |target|'s blobstore. If target.IsNewInstance() is not set,
then the remote target's blobstore is queried and only the changed blobs then the remote target's blobstore is queried and only the changed blobs
are copied. are copied.
...@@ -71,7 +71,7 @@ def _Deploy(target, output_dir, archive_path): ...@@ -71,7 +71,7 @@ def _Deploy(target, output_dir, archive_path):
existing_blobs = set() existing_blobs = set()
if not target.IsNewInstance(): if not target.IsNewInstance():
logging.debug('Querying the target blobstore\'s state.') logging.debug('Querying the target blobstore\'s state.')
ls = target.RunCommandPiped(['ls', '/blobstore'], stdout=subprocess.PIPE) ls = target.RunCommandPiped(['ls', '/blob'], stdout=subprocess.PIPE)
for blob in ls.stdout: for blob in ls.stdout:
existing_blobs.add(blob.strip()) existing_blobs.add(blob.strip())
ls.wait() ls.wait()
...@@ -123,7 +123,6 @@ def _Deploy(target, output_dir, archive_path): ...@@ -123,7 +123,6 @@ def _Deploy(target, output_dir, archive_path):
'rm', '/tmp/meta.far']) 'rm', '/tmp/meta.far'])
if result != 0: if result != 0:
raise Exception('Deployment failed.') raise Exception('Deployment failed.')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment