New issue
Advanced search Search tips

Issue 608583 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: Oct 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: ----

Blocked on:
issue 631837

Blocking:
issue 608580



Sign in to add a comment

Create an auto-update lib for both cros-flash and devserver

Project Member Reported by xixuan@chromium.org, May 3 2016

Issue description

As the first step of BUG:608580, creating an auto-update lib for both cros-flash and devserver to call. 

In this auto-update lib, the supported function list will be:
-------------Transfer-------------
1. TransferDevServerPackage()
2. TransferRootfsUpdate()
3. TransferStatefulUpdate()

-------------Pre-check------------
1. CheckPayloads()
2. _CheckRestoreStateful()
3. _CanRunDevserver()

-------------Tracking-------------
1. GetUpdateStatus()

------------Auto-Update-----------
1. RestoreStateful()
2. UpdateRootfs()
3. UpdateStateful()
4. RunReboot()

--------------Verify--------------
1. Verify()

Further goal: support other types of DUT and images.
 
Blocking: 608580
Project Member

Comment 2 by bugdroid1@chromium.org, May 12 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/e851dfbf550633d46981beae2345b1681bea45aa

commit e851dfbf550633d46981beae2345b1681bea45aa
Author: xixuan <xixuan@google.com>
Date: Tue May 03 01:02:37 2016

chromite: Initial lib for auto-updater

This CL creates an initial auto-update lib for cros flash ONLY. So its goal
includes:
1. change cros flash's code path to use this lib.
2. delete redundant codes.
3. write unittest for this new lib.

does not include:
1. support any other auto-update frameworks.
These functions are in the following CLs.

The new lib auto_update.py supports all the processes that cros flas requires:
1. Pre-check whether payload is ready, devserver can run, and stateful update
should be restored.
2. Transfer devserver package/rootfs update files/stateful update files.
3. Execute rootfs update/stateful restore/stateful update.
4. Reboot and Verify after auto-update.

BUG= chromium:608583 
TEST=ran flash_unittest & auto_updater_unittest;
locally ran 'cros flash [dut] [image_path]'

Change-Id: Ifad41d8a2ff15e77d415bd755e4108c86a94ef0f
Reviewed-on: https://chromium-review.googlesource.com/342131
Commit-Ready: Xixuan Wu <xixuan@chromium.org>
Tested-by: Xixuan Wu <xixuan@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Dan Shi <dshi@google.com>

[modify] https://crrev.com/e851dfbf550633d46981beae2345b1681bea45aa/cli/flash_unittest.py
[add] https://crrev.com/e851dfbf550633d46981beae2345b1681bea45aa/lib/auto_updater_unittest.py
[modify] https://crrev.com/e851dfbf550633d46981beae2345b1681bea45aa/cli/flash.py
[add] https://crrev.com/e851dfbf550633d46981beae2345b1681bea45aa/lib/auto_updater.py
[add] https://crrev.com/e851dfbf550633d46981beae2345b1681bea45aa/lib/auto_updater_unittest

Project Member

Comment 3 by bugdroid1@chromium.org, May 26 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/0f551464bb4a8676dcc938e6a5aac4e8112422d3

commit 0f551464bb4a8676dcc938e6a5aac4e8112422d3
Author: xixuan <xixuan@google.com>
Date: Fri May 20 23:43:56 2016

chromite: not use signal when it's not in the main thread.

Thic CL lets functions not use signal to force timeout,  when they are not
called in the main thread.

BUG= chromium:608583 
TEST=locally ran 'ds.auto_update([dut], [image_path])';
locally ran 'cros flash [dut] [image_path]';
Ran timeout_util_unittest.

Change-Id: I34fc8fe8988e95d3ab798514467d2b82cfb4d9fe
Reviewed-on: https://chromium-review.googlesource.com/346550
Commit-Ready: Xixuan Wu <xixuan@chromium.org>
Tested-by: Xixuan Wu <xixuan@chromium.org>
Reviewed-by: Dan Shi <dshi@google.com>

[modify] https://crrev.com/0f551464bb4a8676dcc938e6a5aac4e8112422d3/lib/timeout_util_unittest.py
[modify] https://crrev.com/0f551464bb4a8676dcc938e6a5aac4e8112422d3/lib/timeout_util.py

Components: Infra>Client>ChromeOS
Components: -Infra

Comment 6 by xixuan@chromium.org, Jul 26 2016

Blockedon: 631837
Project Member

Comment 7 by bugdroid1@chromium.org, Aug 8 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/9a15727c8670d24e264bc06036e8672bcce3f79c

commit 9a15727c8670d24e264bc06036e8672bcce3f79c
Author: xixuan <xixuan@google.com>
Date: Tue May 31 18:35:13 2016

autoupdater: Add cros_host auto-update functions into auto-update lib.

This CL adds cros_host auto-update functions into the auto-update lib in
chromite. The original cros_host auto-update functions' logics come from
autotest/files/client/common_lib/cros/autoupdater.py and
autotest/server/hosts/cros_host.py.

The main added functions includes:
1. pre-setup/post-check for stateful/rootfs update and whole update
process.
2. retry for transfer devserver/stateful/rootfs update packages.
3. setting several different logging strategies.

BUG= chromium:608583 
TEST=Locally ran cros-flash to make sure cros-flash still work.
Locally ran 'ds.auto_update([dut], [image_path])' for stateful update,
rootfs update, and both.
Locally ran 'repair' & 'provision test' on a local autotest.
Ran unittest.

Changes to be committed:
       modified:   cli/flash.py
       modified:   cli/flash_unittest.py
       new file:   lib/auto_update_util.py
       new file:   lib/auto_update_util_unittest
       new file:   lib/auto_update_util_unittest.py
       modified:   lib/auto_updater.py
       modified:   lib/auto_updater_unittest.py
       modified:   lib/cros_build_lib.py
       modified:   lib/cros_build_lib_unittest.py
       modified:   lib/remote_access.py
       modified:   lib/retry_util.py

Change-Id: I983d7365efe2cb27a580aa3e93148a8a8c68c3f0
Reviewed-on: https://chromium-review.googlesource.com/348381
Commit-Ready: Dan Shi <dshi@google.com>
Tested-by: Xixuan Wu <xixuan@chromium.org>
Reviewed-by: Xixuan Wu <xixuan@chromium.org>
Reviewed-by: Dan Shi <dshi@google.com>

[modify] https://crrev.com/9a15727c8670d24e264bc06036e8672bcce3f79c/cli/flash.py
[add] https://crrev.com/9a15727c8670d24e264bc06036e8672bcce3f79c/lib/auto_update_util.py
[modify] https://crrev.com/9a15727c8670d24e264bc06036e8672bcce3f79c/lib/remote_access.py
[modify] https://crrev.com/9a15727c8670d24e264bc06036e8672bcce3f79c/cli/flash_unittest.py
[modify] https://crrev.com/9a15727c8670d24e264bc06036e8672bcce3f79c/lib/auto_updater.py
[modify] https://crrev.com/9a15727c8670d24e264bc06036e8672bcce3f79c/lib/retry_util.py
[modify] https://crrev.com/9a15727c8670d24e264bc06036e8672bcce3f79c/lib/cros_build_lib.py
[modify] https://crrev.com/9a15727c8670d24e264bc06036e8672bcce3f79c/lib/auto_updater_unittest.py
[add] https://crrev.com/9a15727c8670d24e264bc06036e8672bcce3f79c/lib/auto_update_util_unittest.py
[modify] https://crrev.com/9a15727c8670d24e264bc06036e8672bcce3f79c/lib/cros_build_lib_unittest.py
[add] https://crrev.com/9a15727c8670d24e264bc06036e8672bcce3f79c/lib/auto_update_util_unittest

Status: Fixed (was: Assigned)

Comment 9 by dchan@google.com, Jan 21 2017

Labels: VerifyIn-57

Comment 10 by dchan@google.com, Mar 4 2017

Labels: VerifyIn-58

Comment 11 by dchan@google.com, Apr 17 2017

Labels: VerifyIn-59

Comment 12 by dchan@google.com, May 30 2017

Labels: VerifyIn-60
Labels: VerifyIn-61
Status: Verified (was: Fixed)
Closing. Please reopen it if its not fixed. Thanks!

Sign in to add a comment