Re-land "[crostestutils] Pipe verbose flag up to cros_run_{parallel_}vm_test{s}"

This reverts commit abe75065b9d1a88989b314c3c29057b46167a6f6


BUG=chromium-os:20426
TEST=cros_run_vm_test --board ${BOARD} --use_emerged -v 0 LoginSuccess

Change-Id: I17912b8e6135e8052ace2339aed416e58f77ae14
Reviewed-on: https://gerrit.chromium.org/gerrit/10739
Commit-Ready: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
diff --git a/cros_run_vm_test b/cros_run_vm_test
index 4c511eb..01f9063 100755
--- a/cros_run_vm_test
+++ b/cros_run_vm_test
@@ -22,6 +22,7 @@
 DEFINE_string test_case "" "Name of the test case to run"
 DEFINE_boolean use_emerged ${FLAGS_FALSE} \
     "Force use of emerged autotest packages"
+DEFINE_integer verbose 1 "{0,1,2} Max verbosity shows autoserv debug output." v
 
 set -e
 
@@ -74,4 +75,5 @@
     --remote=127.0.0.1 \
     --results_dir_root="${FLAGS_results_dir_root}" \
     ${USE_EMERGED} \
+    --verbose=${FLAGS_verbose} \
     "${tests[@]}"
diff --git a/utils_py/cros_run_parallel_vm_tests.py b/utils_py/cros_run_parallel_vm_tests.py
index 0be1c3f..fae160b 100755
--- a/utils_py/cros_run_parallel_vm_tests.py
+++ b/utils_py/cros_run_parallel_vm_tests.py
@@ -77,6 +77,7 @@
                '--snapshot', # The image is shared so don't modify it.
                '--no_graphics',
                '--use_emerged',
+               '--verbose=1',
                '--ssh_port=%d' % ssh_port ]
       if self._board: args.append('--board=%s' % self._board)
       if self._image_path: args.append('--image_path=%s' % self._image_path)
@@ -85,14 +86,15 @@
         results_dir = '%s/%s.%d' % (self._results_dir_root, test, ssh_port)
         args.append('--results_dir_root=%s' % results_dir)
       args.append(test)
-      Info('Running %r...' % args)
       output = None
       if self._quiet:
+        args.append('--verbose=0')  # generate less output
         output = open('/dev/null', mode='w')
         Info('Log files are in %s' % results_dir)
       elif self._order_output:
         output = tempfile.NamedTemporaryFile(prefix='parallel_vm_test_')
         Info('Piping output to %s.' % output.name)
+      Info('Running %r...' % args)
       proc = subprocess.Popen(args, stdout=output, stderr=output)
       test_info = { 'test': test,
                     'proc': proc,