History log of /external/autotest/site_utils/lab_inventory.py
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
54150304b9637704c8a65d4a3e2c12e99c46f41b 26-Feb-2018 Richard Barnette <jrbarnette@chromium.org> [autotest] Fix lab inventory for "detect repair loops".

When not invoked for debug, the lab inventory script requires at
least one option that specifies one of the available inventory
reports. The new repair loop detection is an inventory report, but
the check for "at least one report" didn't recognize it as such.
The result was that inventory runs requesting "detect repair loops
only" would fail.

This updates the command line parsing to do the right thing, and
updates the unit tests to test against that case.

BUG=chromium:775199
TEST=run unit tests, run the cron job script manually

Change-Id: I5eb664a2901e3c351fd2efce0d5dd1dfe48175c2
Reviewed-on: https://chromium-review.googlesource.com/937782
Commit-Ready: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Paul Hobbs <phobbs@google.com>
/external/autotest/site_utils/lab_inventory.py
08aae248df06367ebc6356f7fb779141b2c5fa18 24-Feb-2018 Richard Barnette <jrbarnette@chromium.org> [autotest] Fix metrics initialization for lab inventory.

The setup for metrics generation in lab inventory run was using
`short_lived=True,`. ITOT that we prefer for that parameter to be
false.

BUG=chromium:775199
TEST=None

Change-Id: Ie4c0ffde6a506ffd183991f009e99108894d4b7c
Reviewed-on: https://chromium-review.googlesource.com/935834
Commit-Ready: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Paul Hobbs <phobbs@google.com>
/external/autotest/site_utils/lab_inventory.py
3a40449a3564523e196e696a41c0ee4240b4e6bf 08-Feb-2018 Richard Barnette <jrbarnette@chromium.org> [autotest] Fix lab_inventory for full lab.

The factory method for creating _LabInventory objects was broken by
the previous CL in the (standard) code path for an inventory of the
entire lab. This fixes it.

BUG=None
TEST=assign_stable_images --dry-run

Change-Id: I937d8fe9cde73074e643107d0c4ef09c3a22cdb1
Reviewed-on: https://chromium-review.googlesource.com/909806
Commit-Queue: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Paul Hobbs <phobbs@google.com>
/external/autotest/site_utils/lab_inventory.py
5de01eb5e3520284c70a71483fd139fc6ca2e5ef 15-Dec-2017 Richard Barnette <jrbarnette@chromium.org> [autotest] Convert inventory management to be model based

BUG=chromium:798889
TEST=None

Change-Id: I986ecd424c761d1e4a37568a86707c31569c4e92
Reviewed-on: https://chromium-review.googlesource.com/893527
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@google.com>
/external/autotest/site_utils/lab_inventory.py
88b948904cb027d738e5265cd483fb71ead2a0bb 07-Feb-2018 Richard Barnette <jrbarnette@chromium.org> [autotest] Add an option for debugging metrics in lab_inventory.

It's possible to do better for debugging the behavior of the
metrics library if we throw the right options at the setup
function. So, add an option to make it possible.

BUG=chromium:775199
TEST=Run the command with the option

Change-Id: I16d94161d79fb8ca22ea6aa157341ea536994c4e
Reviewed-on: https://chromium-review.googlesource.com/907182
Reviewed-by: Paul Hobbs <phobbs@google.com>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
/external/autotest/site_utils/lab_inventory.py
8840588deca7ef5b8bc10099527d42374fc85719 07-Feb-2018 Richard Barnette <jrbarnette@chromium.org> [autotest] Fix lab_inventory to properly report its metrics.

The lab_inventory script has been failing to report the metric for
DUTs in repair loops. This adds a call to `metrics.Flush()` to make
sure that the metrics get reported.

BUG=chromium:775199
TEST=None

Change-Id: Ia09c0e06c5c1b013af470cdf4ce01418e50ee617
Reviewed-on: https://chromium-review.googlesource.com/907213
Reviewed-by: Paul Hobbs <phobbs@google.com>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
/external/autotest/site_utils/lab_inventory.py
93e646cbcab150b4ae11945592ff969e464ad31a 08-Dec-2017 Xixuan Wu <xixuan@chromium.org> autotest: remove dependencies of suite_scheduler.

BUG=chromium:793179
TEST=Ran unittest.

Change-Id: I633a1ec2ccc352abd4da20c8b7667b0eb6d3305e
Reviewed-on: https://chromium-review.googlesource.com/816080
Commit-Ready: Xixuan Wu <xixuan@chromium.org>
Tested-by: Xixuan Wu <xixuan@chromium.org>
Reviewed-by: Dan Shi <dshi@google.com>
/external/autotest/site_utils/lab_inventory.py
cf5d8346c98566f33923ac946845f6e1c7a4eb06 25-Oct-2017 Richard Barnette <jrbarnette@chromium.org> [autotest] Report repair loops in inventory runs.

This add an option to the lab inventory script to detect and
report DUTs stuck in repair loops.

BUG=chromium:775199
TEST=run the script locally with --debug

Change-Id: I2f7972054e632906207279c08a32bd691864eb56
Reviewed-on: https://chromium-review.googlesource.com/737070
Commit-Ready: Richard Barnette <jrbarnette@google.com>
Tested-by: Richard Barnette <jrbarnette@google.com>
Reviewed-by: Richard Barnette <jrbarnette@google.com>
/external/autotest/site_utils/lab_inventory.py
3dcbb6ac2299eca8c2d8a783817c29896ac5b66b 24-Oct-2017 Richard Barnette <jrbarnette@chromium.org> [autotest] Refactor lab_inventory main() routine.

This changes the lab_inventory main() routine to extract various
chunks into separate functions, so as to shorten main(), and give
names to some of the constituent operations.

BUG=None
TEST=Run locally with --debug

Change-Id: If000304deca0e9a99178777fd60b668a64b74620
Reviewed-on: https://chromium-review.googlesource.com/734144
Commit-Ready: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Prathmesh Prabhu <pprabhu@chromium.org>
/external/autotest/site_utils/lab_inventory.py
a5a0e3d64c7824faa44213afa8dcff88a87dede1 09-Nov-2017 Prathmesh Prabhu <pprabhu@chromium.org> Support lab inventory summary by model

LabInventory can now summarize DUT histories by board as well as model.
This will allow all scripts that use LabInventory to slowly migrate to
respecting models instead of boards.

BUG=chromium:780892
TEST=unittests.

Change-Id: I422b4bd151b3bad97591eed3da23b6c12c968414
Reviewed-on: https://chromium-review.googlesource.com/760498
Reviewed-by: Prathmesh Prabhu <pprabhu@chromium.org>
Commit-Queue: Prathmesh Prabhu <pprabhu@chromium.org>
Tested-by: Prathmesh Prabhu <pprabhu@chromium.org>
/external/autotest/site_utils/lab_inventory.py
021e7842e83a9726b572c7766e2c5516b8ef3678 09-Nov-2017 Prathmesh Prabhu <pprabhu@chromium.org> inventory: Use labellib for label manipulation

BUG=chromium:780892
TEST=unittest

Change-Id: I6d0d68f47860a0f3d19fb26da8889369350b1d20
Reviewed-on: https://chromium-review.googlesource.com/759719
Commit-Ready: Prathmesh Prabhu <pprabhu@chromium.org>
Tested-by: Prathmesh Prabhu <pprabhu@chromium.org>
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
/external/autotest/site_utils/lab_inventory.py
154cb2b41714873728ca98aec921087f29ab1d86 09-Nov-2017 Prathmesh Prabhu <pprabhu@chromium.org> inventory: Make inventory-classified-by-board an attribute.

So far, inventory is always classified by board. We now want to also
classify inventory by model. In preparation for that, add an attribute
that stores the by_board classification.

BUG=chromium:780892
TEST=unittests

Change-Id: I37658df2d0533ee20c72ed3269d187e6eb6cc171
Reviewed-on: https://chromium-review.googlesource.com/759718
Commit-Ready: Prathmesh Prabhu <pprabhu@chromium.org>
Tested-by: Prathmesh Prabhu <pprabhu@chromium.org>
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
/external/autotest/site_utils/lab_inventory.py
0ecbf322278bb5448f2bbe324884ed6e01528b9a 09-Nov-2017 Prathmesh Prabhu <pprabhu@chromium.org> inventory: Rename classes to be more generic.

BUG=chromium:780892
TEST=unittests.

Change-Id: I6a49840b22791bb9c3e657d185720c8e7a8b8b25
Reviewed-on: https://chromium-review.googlesource.com/759716
Commit-Ready: Prathmesh Prabhu <pprabhu@chromium.org>
Tested-by: Prathmesh Prabhu <pprabhu@chromium.org>
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
/external/autotest/site_utils/lab_inventory.py
99473f6963e30282bed8ef4538af7d23be3fba6c 17-Oct-2017 Richard Barnette <jrbarnette@chromium.org> [autotest] Exclude hosts in more than one pool from lab inventory.

The lab inventory script fails if a DUT is assigned to a non-managed
pool. The query that constructs the inventory selects only hosts
that are in managed pools, but failure may still occur if a DUT is
in both a managed and non-managed pool.

The lab inventory script isn't meant to allow DUTs to be in more
than one pool, so this excludes those DUTs from inventory.

BUG=chromium:757815
TEST=run the script locally

Change-Id: Ia5f5ed762b58e9bd6ce3014c07ee7cc8fd39887c
Reviewed-on: https://chromium-review.googlesource.com/724216
Commit-Ready: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Prathmesh Prabhu <pprabhu@chromium.org>
/external/autotest/site_utils/lab_inventory.py
eabcf39bd25c46239e8e9d12d058c48d59f2c26d 02-Sep-2017 Richard Barnette <jrbarnette@chromium.org> [autotest] Exclude moblab from lab inventory management.

The moblab instances in Stierlin Ct are handled by a separate
process that's separate from the standard lab inventory cron job
e-mail. So, remove the board from consideration.

BUG=chromium:757815
TEST=unit test for sanity

Change-Id: Ie327752c2b2980f541e091867e75ac135f870e83
Reviewed-on: https://chromium-review.googlesource.com/647316
Commit-Ready: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@google.com>
/external/autotest/site_utils/lab_inventory.py
754403d1182481d60d4e93d05fec75ffd50bd3ae 22-Aug-2017 Prathmesh Prabhu <pprabhu@chromium.org> autotest: Improve error message when choking on unmanaged pool

If a DUT has two pool: labels, one managed and one unmanaged,
lab_inventory may choke on the DUT (depending on which pool
status_history blesses). In this case, we got no information whatsoever
about where the failure was.
This CL is a small improvement in the error message so that the next
person doesn't need to spend an hour chasing the error message.

BUG=chromium:757815
TEST=None

Change-Id: Ia84eaa3d3a1dfaa9e7996d2adbfccfcb4e5f1e61
Reviewed-on: https://chromium-review.googlesource.com/627162
Commit-Ready: Prathmesh Prabhu <pprabhu@chromium.org>
Tested-by: Prathmesh Prabhu <pprabhu@chromium.org>
Reviewed-by: Prathmesh Prabhu <pprabhu@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@google.com>
/external/autotest/site_utils/lab_inventory.py
673573b051b3f18c71f27a0c740a261cb759e1f5 12-Dec-2016 Richard Barnette <jrbarnette@chromium.org> [autotest] Break an import cycle in lab_inventory.

An upcoming change adds a dependency in server.hosts on the
MANAGED_POOLS list. That dependency introduces a cycle:
hosts package -> lab_inventory -> servo_host -> hosts package

To break the cycle, this moves the MANAGED_POOLS list into
suite_scheduler.constants.

BUG=None
TEST=unit tests; dry run of lab_inventory script

Change-Id: I502d57631705f5f7dd69c805c2a67ff88b5bc73f
Reviewed-on: https://chromium-review.googlesource.com/419115
Commit-Ready: Richard Barnette <jrbarnette@google.com>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
/external/autotest/site_utils/lab_inventory.py
7ee95860dabcd3ca1c6cb054f59203534fcd5132 31-Aug-2016 Aviv Keshet <akeshet@chromium.org> autotest: refactor status_history into a lib outside of site_utils

CQ-DEPEND=CL:378599

BUG=chromium:641093
TEST=Ran dut_status command, verified working.

Change-Id: I9f60e2dff24683e66af00c7ce1c8a825b239e782
Reviewed-on: https://chromium-review.googlesource.com/378435
Commit-Ready: Aviv Keshet <akeshet@chromium.org>
Tested-by: Aviv Keshet <akeshet@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@google.com>
/external/autotest/site_utils/lab_inventory.py
254d5b4a9dc4bac4fa2ce35682c7089cb72df6fd 07-Jul-2016 Richard Barnette <jrbarnette@chromium.org> [autotest] Include DUT totals in lab inventory log messages.

This adds a short summary of the total number of DUTs found for each
board or board+pool combination that's logged during inventory
processing. The intent is to be able to put a time boundary on
unexpected changes in inventory allocations.

BUG=chromium:623137
TEST=run locally, see the new logging messages.

Change-Id: I6aa27d3657d422d308042ff791db0bf67e86d4c9
Reviewed-on: https://chromium-review.googlesource.com/358642
Commit-Ready: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Xixuan Wu <xixuan@chromium.org>
/external/autotest/site_utils/lab_inventory.py
f1a9ffe97e31156e0a9a65d307a2bab5c72ce3b4 17-Jun-2016 Rohit Makasana <rohitbm@chromium.org> Adding pool:cts to the critical pool list.

BUG=chromium:617860
TEST=None

Change-Id: Ie6c6d57afdfefad556b4fb8abae93b75e10f324a
Reviewed-on: https://chromium-review.googlesource.com/353401
Commit-Ready: Rohit Makasana <rohitbm@chromium.org>
Tested-by: Rohit Makasana <rohitbm@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@google.com>
/external/autotest/site_utils/lab_inventory.py
cf0ad2ba0e9df5ca6473f50829235b7cc94163d5 19-Apr-2016 Kevin Cheng <kevcheng@chromium.org> [autotest] Update run-pool-inventory to balance_pool.

Balance out the pool before we send out the notification eMail to the
deputy.

BUG=chromium:605747,chromium:607200,chromium:617292
TEST=locally with dry-run/debug options and unittest

Change-Id: I47cd45fe495e1d46a1a49e97922868de74c5fd02
Reviewed-on: https://chromium-review.googlesource.com/339674
Commit-Ready: Kevin Cheng <kevcheng@chromium.org>
Tested-by: Kevin Cheng <kevcheng@chromium.org>
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
/external/autotest/site_utils/lab_inventory.py
5af97406efacb4d9b0701aafc843f34f08e09cc2 18-Apr-2016 Richard Barnette <jrbarnette@chromium.org> [autotest] Create logdir in lab_inventory script.

When running the lab_inventory script, if the requested logs
directory doesn't exist, create it.

BUG=chromium:604426
TEST=run the script locally, see the directory get created.

Change-Id: I48b85b7a83fed38e9e9059f7ce1bbac9900b4178
Reviewed-on: https://chromium-review.googlesource.com/339431
Commit-Ready: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Paul Hobbs <phobbs@google.com>
/external/autotest/site_utils/lab_inventory.py
5d0fa5116c3e6f6819651f207d7cbd3a44e59472 06-Apr-2016 J. Richard Barnette <jrbarnette@chromium.org> [autotest] Update DUT repair recommendations to show logs URL.

This changes the format of the DUT repair recommendations e-mail to
show the URL to the logs of the most recent failed repair task.
This will make it reasonably easy to get to the repair logs, including
the status.log file.

BUG=chromium:600818
TEST=run locally with --debug; look at the output in Gmail

Change-Id: Ia957cae90f464b3a840cec5ad875003a32a9df97
Reviewed-on: https://chromium-review.googlesource.com/337380
Commit-Ready: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Haowei Wang <haoweiw@chromium.org>
/external/autotest/site_utils/lab_inventory.py
12ce04fcc1a574815e5891512adc7d2f08aa32cc 10-Mar-2016 xixuan <xixuan@google.com> Autotest: Report idle devices for the Lab DUT inventory.

Idle DUTs that are typically locked or wedged, are currently classfied as the
same non-working DUT as broken DUTs.

This fixes two things:
* For the board inventory, request repair for those `BROKEN` DUTs that have
actually failed repair. Add a column that reports on idle DUTs to
the message that is sent to englab-sys-cros.
* For the pool inventory (sent to the deputies) add a column that reports
on idle DUTs, and a detailed idle DUT list. Ask for deputy's attention.

BUG=chromium:590386
TEST=ran lab_inventory_unittest.py locally with --debug, add idle duts
in the test.

Change-Id: I564dd79de69092276aabca6b6714dc175e37dfda
Reviewed-on: https://chromium-review.googlesource.com/332191
Commit-Ready: Xixuan Wu <xixuan@chromium.org>
Tested-by: Xixuan Wu <xixuan@chromium.org>
Reviewed-by: Xixuan Wu <xixuan@chromium.org>
/external/autotest/site_utils/lab_inventory.py
b8bc570c95a394d3122773abd79b916a9025718e 18-Mar-2016 J. Richard Barnette <jrbarnette@chromium.org> [autotest] Exclude Android and Brillo hosts from inventory tools.

This change excludes any host with the label 'adb' from inclusion in
the lab inventory management scripts. We're not ready to include
those DUTs in the board or pool management e-mail reports.

BUG=None
TEST=manually run lab_inventory.get_managed_boards()

Change-Id: I8dc5ba889e24feee99453ffcc8f0d15895e677d2
Reviewed-on: https://chromium-review.googlesource.com/333403
Commit-Ready: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Xixuan Wu <xixuan@chromium.org>
/external/autotest/site_utils/lab_inventory.py
ea5a4ba79f97abd484dfa848abc05e832c2d3459 19-Feb-2016 J. Richard Barnette <jrbarnette@chromium.org> [autotest] Update board inventory not to list boards without failures.

The standard board inventory included all boards, including boards
with no broken DUTs. That was unnecessary clutter.

This changes the board inventory to include only those boards with
at least one broken DUT.

BUG=chromium:588002
TEST=run locally with --debug, run new unit tests

Change-Id: I87a45db2f71965bb864e06d13c5f1623989ded52
Reviewed-on: https://chromium-review.googlesource.com/328472
Commit-Ready: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Dan Shi <dshi@google.com>
/external/autotest/site_utils/lab_inventory.py
222d7f49a74cac0a95b48a95f93a61934c332311 15-Dec-2015 J. Richard Barnette <jrbarnette@chromium.org> [autotest] Add the 'continuous' pool to lab inventory management.

We're creating a new pool named 'continuous' that will be used by
certain continuous Chrome builders in order to improve the gardening
process. Those pools will be treated the same as the 'bvt' and 'cq'
pools for inventory management purposes.

BUG=chromium:569743
TEST=None

Change-Id: I2f056d32d80a2d5d739cf7a59a156a4e40fa7ed0
Reviewed-on: https://chromium-review.googlesource.com/317985
Commit-Ready: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Fang Deng <fdeng@chromium.org>
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
/external/autotest/site_utils/lab_inventory.py
aa8689388ab9b48b1236e985476897d2781f91f3 23-Oct-2015 J. Richard Barnette <jrbarnette@chromium.org> [autotest] Add assign_stable_images.py to site_utils.

This adds a new tool for automatically selecting and updating stable
test images. The tool will guarantee that no managed board in the
lab will use an image older than the current Beta channel build
that's being served by Omaha for that board.

BUG=chromium:532654
TEST=Run with --dry-run; test once w/ prod

Change-Id: I6ec9484ef0a135429bf36cda99696a97e2ce74f9
Reviewed-on: https://chromium-review.googlesource.com/308555
Commit-Ready: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Dan Shi <dshi@chromium.org>
/external/autotest/site_utils/lab_inventory.py
e39c827129e2a906eecbab6a6872da10ef8262bc 21-Oct-2015 J. Richard Barnette <jrbarnette@chromium.org> [autotest] Change to get_managed_boards() in lab inventory.

Previously, the _LabInventory class contained a `get_board_counts()`
method that returned a list of tuples for selected boards. That
interface was bad both for readability and reusability.

This change replaces the bad API with a method called
`get_managed_boards()` that returns just a set of the boards that
wer of interest in the old `get_board_counts()` API. Callers of
the method and the associate unit tests have been adjusted for the
change.

BUG=None
TEST=unit tests, plus selected lab_inventory --debug invocations

Change-Id: Iafcf7fe36984fe1a806337417536d541b3d1dfcf
Reviewed-on: https://chromium-review.googlesource.com/307592
Commit-Ready: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
/external/autotest/site_utils/lab_inventory.py
d3ba33a890a71b2ffd27a69e837a15ffc8df984b 14-Oct-2015 J. Richard Barnette <jrbarnette@chromium.org> [autotest] Add aggregate statistics to board inventory.

In lab_inventory, add numbers for aggregate statistics for
good and bad DUTs, and for the number of boards. A sample
of the new output:

Summary of DUTs in inventory:
Bad Good Total
8 14% 52 86% 60

Boards with failures: 3
Boards in inventory: 4

BUG=None
TEST=unit tests, and various sample runs with --debug

Change-Id: Iec925a819c6618f5ae80498f2f4ad230757f4719
Reviewed-on: https://chromium-review.googlesource.com/305566
Commit-Ready: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
/external/autotest/site_utils/lab_inventory.py
55127430374f9e2801e1ccee3f22806c18182b85 14-Oct-2015 J. Richard Barnette <jrbarnette@chromium.org> [autotest] For lab inventory, don't recommend non-inventory boards

The regular board inventory excludes boards that have no suites
pool, or that have only suites DUTs. However, when we create a list
of DUTs for repair, we don't honor those exclusions. The result is
that in some cases, we recommend DUTs for repair when the board
isn't listed in the inventory.

This change makes the repair recommendations be drawn only from
the boards that are part of the regular inventory.

BUG=None
TEST=unit tests, plus selected testing w/ --debug

Change-Id: I0dfbd060193afbd9dd08d646151e598a9b8c0d5f
Reviewed-on: https://chromium-review.googlesource.com/305398
Commit-Ready: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Paul Hobbs <phobbs@google.com>
/external/autotest/site_utils/lab_inventory.py
02e824301c65af31cfbebd5e4a3cb21bfc27cd82 14-Oct-2015 J. Richard Barnette <jrbarnette@chromium.org> [autotest] Slight improvement to debug options for lab_inventory

This renames the --print option to --debug, and allows for testing
the individual --board-summary and --pool-summary (instead of always
executing both options when --debug is present).

BUG=None
TEST=unit tests

Change-Id: If4068f56bbb03833d1005207d7a1f73fb0b82f0b
Reviewed-on: https://chromium-review.googlesource.com/305584
Commit-Ready: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
/external/autotest/site_utils/lab_inventory.py
a7c514e6ea729e86909089cb84819f5252f8e261 15-Sep-2015 J. Richard Barnette <jrbarnette@chromium.org> [autotest] Use a RetryingAFE for lab_inventory.

We get periodic 500 errors from cautotest due to load. So,
retry the RPC calls.

BUG=chromium:498883
TEST=run an inventory sample locally

Change-Id: If9d7258f3d7a28b13b74b4edfe4142f4f4bcd707
Reviewed-on: https://chromium-review.googlesource.com/299559
Commit-Ready: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Dan Shi <dshi@chromium.org>
/external/autotest/site_utils/lab_inventory.py
056d74ca9da956940c742be383a65d51ad456b55 14-Jul-2015 Aviv Keshet <akeshet@chromium.org> lab_inventory: clarify email message

BUG=None
TEST=None

Change-Id: I758b740cd50e392233645c723adf636d10f4b8dc
Reviewed-on: https://chromium-review.googlesource.com/285313
Tested-by: Aviv Keshet <akeshet@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Queue: Aviv Keshet <akeshet@chromium.org>
/external/autotest/site_utils/lab_inventory.py
1df6a568e8dc3fa59725043147177e89934583cb 09-Jun-2015 J. Richard Barnette <jrbarnette@chromium.org> [autotest] Merge DUT repair recommendations with board inventory.

Based on discussions with englab-sys-cros, this merges the
DUT repair recommendations with the full board inventory e-mail.

After the change, there are two distinct kinds of inventory
runs:
* run-pool-inventory generates a pool inventory e-mail sent to the
deputies, and generates the combined board and DUT repair
recommendations e-mail for the englab team.
* run-board-inventory generates a board inventory only, without
repair recommendations, and sends it to the englab team.

BUG=None
TEST=run locally, examine the output

Change-Id: Ifc03560b637884f3abbfcd6561f614a9d2de7005
Reviewed-on: https://chromium-review.googlesource.com/276800
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Richard Barnette <jrbarnette@chromium.org>
/external/autotest/site_utils/lab_inventory.py
1f87ee1890281d13c5185f58179756fd5d4b8256 09-Jun-2015 Richard Barnette <jrbarnette@chromium.org> Revert "[autotest] Merge DUT repair recommendations with board inventory."

This reverts commit 6e9a6b487dc921d9ee6cdc1d13bdf534d70c6680.

This won't do what I meant:
* It breaks the current cron job, because it deletes an option that's
still in use.
* It includes repair recommendations unconditionally, but really,
we only want them first thing in the morning.

Change-Id: I8a095be5cbeb3656f47af799a89ac01a6ff1438b
Reviewed-on: https://chromium-review.googlesource.com/276462
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
/external/autotest/site_utils/lab_inventory.py
6e9a6b487dc921d9ee6cdc1d13bdf534d70c6680 09-Jun-2015 J. Richard Barnette <jrbarnette@chromium.org> [autotest] Merge DUT repair recommendations with board inventory.

Based on discussions with englab-sys-cros, this merges the
DUT repair recommendations with the full board inventory e-mail.

BUG=None
TEST=run locally, examine the output

Change-Id: Ie12b7defbabc6c4b72cb553837005153e514f46b
Reviewed-on: https://chromium-review.googlesource.com/276269
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Richard Barnette <jrbarnette@chromium.org>
/external/autotest/site_utils/lab_inventory.py
c9a143caf0a60024c86bdf15ca00becf58bde794 04-Jun-2015 J. Richard Barnette <jrbarnette@chromium.org> [autotest] Improve the pool inventory message.

Based on feedback from a recent deputy, change the pool inventory
message in site_utils/lab_inventory.py to make the expectations
clearer.

BUG=None
TEST=unit tests

Change-Id: I614f7f4a3c0a2095ea4973c1512ebcedae6bde1f
Reviewed-on: https://chromium-review.googlesource.com/275293
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
Commit-Queue: Richard Barnette <jrbarnette@chromium.org>
/external/autotest/site_utils/lab_inventory.py
f683928724acf6dc20e365b048c09f20dc826d0a 02-Jun-2015 J. Richard Barnette <jrbarnette@chromium.org> [autotest] Provide a repair recommender for lab inventory.

This enhances the lab_inventory script to include a feature that
will recommend a list of hosts for repair. The hosts are selected
so that they are (somewhat) close together, and all hosts are
guaranteed to reside in the same lab. The selection is also
designed to try and improve the inventory numbers by focusing
on the boards that have the lowest number of working spares.

BUG=None
TEST=unit tests; various tests with --print; full run w/ e-mail

Change-Id: Ie9863ce337045a3fdd6d8d649613dda830fae7f0
Reviewed-on: https://chromium-review.googlesource.com/274541
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Queue: Richard Barnette <jrbarnette@chromium.org>
/external/autotest/site_utils/lab_inventory.py
f60a1eec59298077bc30340ef473e50402759e4f 02-Jun-2015 J. Richard Barnette <jrbarnette@chromium.org> [autotest] Adjust the lab_inventory pool inventory message.

The message referred to `freon_swap`, which is now obsolete.

BUG=chromium:492264
TEST=unit tests

Change-Id: Ia5f8eaab85566872ff88ab186e4fe2540be00ed8
Reviewed-on: https://chromium-review.googlesource.com/274810
Commit-Queue: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Dan Shi <dshi@chromium.org>
/external/autotest/site_utils/lab_inventory.py
6948ed3288dc7a363671e711f6a68c594d589153 06-May-2015 J. Richard Barnette <jrbarnette@chromium.org> [autotest] In lab inventory, ignore DUTs with no board.

From time to time (twice so far), we've had cases of hosts being
added to the database with a pool: label, but no board: label.
That caused failures when gathering inventory, because
status_history.HostJobHistory assumed (without particular
justification) that every board has board: and pool: labels,
and nowhere was there a check to deal with it.

This changes the code so that the host_board and host_pool
properties in HostJobHistory will return `None` when there's no
appropriate label, and changes lab inventory gathering to skip hosts
with no board label.

BUG=chromium:480026
TEST=Unit tests

Change-Id: Ic1065a34ba0e4a2d2019bf8ea89507b277499af6
Reviewed-on: https://chromium-review.googlesource.com/269609
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Mungyung Ryu <mkryu@google.com>
Commit-Queue: Richard Barnette <jrbarnette@chromium.org>
/external/autotest/site_utils/lab_inventory.py
3d0590adb50cd0af0c53007c64eeaa6cddfbf5e9 29-Apr-2015 J. Richard Barnette <jrbarnette@chromium.org> [autotest] In status_history, convert some methods to properties.

This converts HostJobHistory.get_host_board() and get_host_pool()
to @property methods. Also add a new host property.

BUG=None
TEST=run unit tests

Change-Id: I42f8d0792ee7f83655581225584e86ea3065cd08
Reviewed-on: https://chromium-review.googlesource.com/268350
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Richard Barnette <jrbarnette@chromium.org>
/external/autotest/site_utils/lab_inventory.py
4845fcf1c09c076279f816cfa039a54e943bd337 20-Apr-2015 J. Richard Barnette <jrbarnette@chromium.org> [autotest] Update the pool inventory e-mail message.

This adds instructions for the Infrastructure deputy to the pool
inventory e-mail to make required actions clearer, and updates the
unit tests with a sanity check to see that the instructions are
there.

BUG=None
TEST=unit tests, run for one board and inspect the logs

Change-Id: I7e96dca03d5d5e4ae699bcaf7a5c053a86e73e61
Reviewed-on: https://chromium-review.googlesource.com/266517
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Gabe Black <gabeblack@chromium.org>
Commit-Queue: Richard Barnette <jrbarnette@chromium.org>
/external/autotest/site_utils/lab_inventory.py
96db349a945e8a595567223840271f1e6a5412b5 28-Mar-2015 J. Richard Barnette <jrbarnette@chromium.org> [autotest] Create lab_inventory for inventory cron jobs

This converts the core of the run-board-inventory and
run-pool-inventory scripts to python. The new scripts produce
output that is largely similar, but not identical to the old
bash scripts.

The scripts provide some performance advantage, and some flexibilty:
The bash scripts needed >75 minutes to generate board inventory; the
new python script can generate pool and board inventories at the
same time, and finishes in ~30 minutes.

BUG=None
TEST=unit tests, plus full command-line against cautotest

Change-Id: Id4f5443d7efb8b538bfe4453256201cce2f81bcf
Reviewed-on: https://chromium-review.googlesource.com/263594
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
Commit-Queue: Richard Barnette <jrbarnette@chromium.org>
/external/autotest/site_utils/lab_inventory.py