[autotest] Special task control segments take label-dependant actions

Autoserv accepts the labels of a job via the --job-labels argument, and
feeds them into the control segment by injecting the variable
`job_labels` into the global namespace.

cleanup/verify/repair/reset now use the same sort of loop that provision
does to look up additional tests to run that depend on the labels passed
into the control segment.

Note that some care has to be taken here, as we're moving the labels
from --provision to --job-labels, and I'd rather remove a bit of
migration code later than make for a complicated deploy.

BUG=chromium:334418
TEST=special tasks still run fine

Change-Id: I1596b49905f1500e8ce01e81d9aab2a6c7db111f
Reviewed-on: https://chromium-review.googlesource.com/188454
Tested-by: Alex Miller <milleral@chromium.org>
Reviewed-by: Fang Deng <fdeng@chromium.org>
Reviewed-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Alex Miller <milleral@chromium.org>
diff --git a/server/autoserv b/server/autoserv
index bf3b6ce..dafda25 100755
--- a/server/autoserv
+++ b/server/autoserv
@@ -105,6 +105,7 @@
     cleanup = parser.options.cleanup
     provision = parser.options.provision
     reset = parser.options.reset
+    job_labels = parser.options.job_labels
     no_tee = parser.options.no_tee
     parse_job = parser.options.parse_job
     execution_tag = parser.options.execution_tag
@@ -187,13 +188,13 @@
     try:
         try:
             if repair:
-                job.repair(host_protection)
+                job.repair(host_protection, job_labels)
             elif verify:
-                job.verify()
+                job.verify(job_labels)
             elif provision:
-                job.provision(provision)
+                job.provision(job_labels)
             elif reset:
-                job.reset()
+                job.reset(job_labels)
             else:
                 job.run(cleanup, install_before, install_after,
                         verify_job_repo_url=verify_job_repo_url,