New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 593361 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Last visit > 30 days ago
Closed: Apr 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug

Blocking:
issue 586317



Sign in to add a comment

CrosHost.machine_install() calls self.verify_software()

Reported by jrbarnette@chromium.org, Mar 9 2016

Issue description

These are the last two lines of CrosHost.machine_install():
        self.verify_software()
        return image_name, {ds_constants.JOB_REPO_URL: repo_url}

The `verify_software()` method is slated for deletion as a
side effect of fixing bug 586317.  The call above should be
replaced with `self.verify()`.

 
Blocking: 586317

Comment 2 by dchan@google.com, Mar 16 2016

Labels: Infra
Status: Available (was: Unconfirmed)
Labels: -Infra Infra-ChromeOS

Comment 4 by autumn@chromium.org, Apr 11 2016

Owner: jrbarnette@chromium.org
<sigh> Merely replacing the call to verify_software() with
a call to verify() won't do the right thing:
  * machine_install() is called from the 'au' repair action,
    which is called from repair.
  * If machine_install() calls verify(), it would mean that
    repair() could recursively call verify().
  * The RepairStrategy implementation isn't designed to
    support that kind of re-entrancy.

Instead, to fix this, we need to move the call to verify() to
live in the Provision task code, outside the call to
machine_install().

Looking at the code in depth, I'm not sure if the call to
`verify_software()` serves a truly useful purpose.  Virtually
all of the verification checks in `CrosHost.verify()` are
pointless after a successful re-install:  either the re-install
specifically checks the condition, or in some cases it simply
makes the error too unlikely to be worth checking for.

A handful of checks might be worth some consideration:
    tpm - Re-install won't fix this.  However, we could add a
        call to clear the TPM during one of our reboots during
        installation, which would a) be a Good Thing, and b)
        would generally stop the 'tpm' check from failing.
    power - Re-install won't fix this, but it's not clear that
        including this after install is a high-value operation.
    CrosHost.verify_firmware_status() - This doesn't have its
        own verifier, but it should (someday soon).  This also
        seems to fit into the category of "not a high-value check
        after an install".

So, possibly the best fix is just to delete the call.

Status: Started (was: Available)
I've decided to add a call to verify() in provision jobs.
For posterity, here's the rationale:
  * Although the call is mostly meaningless, it does guarantee
    a minimal amount of useful logging (alas, mainly for success).
  * The 'power' and 'tpm' checks may not be worth much, but the
    performance cost of an entire verify is < 5 seconds, which
    (right now) is free compared to the cost of provisioning.
  * We're only talking about a single line of code, which doesn't
    seem like much of a maintenance challenge.

Project Member

Comment 8 by bugdroid1@chromium.org, Apr 21 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/autotest/+/459592e4ced1eb6c3d980896939e8b3dc00f3cc0

commit 459592e4ced1eb6c3d980896939e8b3dc00f3cc0
Author: Richard Barnette <jrbarnette@chromium.org>
Date: Wed Apr 20 23:06:25 2016

[autotest] Drop call to verify_software() from machine_install().

CrosHost.machine_install() was calling verify_software().  With the
new verify and repair framework, that method is now deprecated.
This deletes the call, and replaces it with a call to
CrosHost.verify() made from the provision task control file.

BUG= chromium:593361 
TEST=Run a suite that invokes provision in a local instance

Change-Id: I209530ebcb2d7ed4da60d9428cd5bd158e9e86bf
Reviewed-on: https://chromium-review.googlesource.com/339954
Commit-Ready: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Kevin Cheng <kevcheng@chromium.org>
Reviewed-by: Dan Shi <dshi@google.com>

[modify] https://crrev.com/459592e4ced1eb6c3d980896939e8b3dc00f3cc0/server/hosts/cros_host.py
[modify] https://crrev.com/459592e4ced1eb6c3d980896939e8b3dc00f3cc0/server/control_segments/provision

Status: Fixed (was: Started)
Components: Infra>Client>ChromeOS
Labels: -Infra-ChromeOS
Status: Verified (was: Fixed)
Bulk verified

Sign in to add a comment