[autotest] Honor DEPENDENCIES information when running dynamic_suites.

A test control file can specify a list of DEPENDENCIES, which are really just
the set of labels a host needs to have in order for that test to be scheduled
on it.  In the case of a dynamic_suite, many tests in the suite may have
DEPENDENCIES specified.  They may overlap, they may not.

This is a first-pass at a very naive mechanism for finding and reimaging a
set of machines that can satisfy all the test DEPENDENCIES in a given suite.
Per-test-per-suite DEPENDENCIES information is generated at build time, and
then fetched and consumed during suite preparation.  If info exists for the
suite being run, the infrastructure will look for a host that matches each
unique DEPENDENCY list.  If it can find such a set that is <= the suite
sharding factor, the infrastructure will schedule those machines for
reimaging.  If not, the suite will fail.

If the suite to be run has no DEPENDENCIES, meta_host scheduling will be used
as today.

BUG=chromium-os:22060
TEST=unit
TEST=run_suite.py with a suite (like 'dummy') that uses DEPENDENCIES
TEST=run_suite.py with a suite that doesn't use DEPENDENCIES
TEST=run_suite.py with a suite that uses DEPENDENCIES; shut down a non-essential machine during reimage.  Suite should complete.
TEST=Same as above, but for a suite that doesn't use DEPENDENCIES
TEST=run_suite.py with a suite that uses DEPENDENCIES; shut down an essential machine (e.g. the only one with the 'bluetooth' label) during reimage.  Suite should not complete.

Change-Id: I64b2e39a79a05c92748f34ffa4acf7667b0476a6
Reviewed-on: https://gerrit.chromium.org/gerrit/27526
Commit-Ready: Chris Masone <cmasone@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
18 files changed