History log of /external/autotest/site_utils/lab_inventory_unittest.py
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
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_unittest.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_unittest.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_unittest.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_unittest.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_unittest.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_unittest.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_unittest.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_unittest.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_unittest.py