Build API: Add Chromite unit tests endpoint.

BUG=chromium:958024, b:131688647
TEST=run_tests

Change-Id: I066df55c2260ea16e25784993a1ec7c1ef0ab014
Reviewed-on: https://chromium-review.googlesource.com/1590326
Commit-Ready: Alex Klein <saklein@chromium.org>
Tested-by: Alex Klein <saklein@chromium.org>
Reviewed-by: Evan Hernandez <evanhernandez@chromium.org>
Reviewed-by: David Burger <dburger@chromium.org>
diff --git a/api/controller/test.py b/api/controller/test.py
index d38e10d..319656c 100644
--- a/api/controller/test.py
+++ b/api/controller/test.py
@@ -114,3 +114,10 @@
                                         error_code_ok=True)
 
   return tarball_path if result.returncode == 0 else None
+
+
+def ChromiteUnitTest(_input_proto, _output_proto):
+  """Run the chromite unit tests."""
+  cmd = [os.path.join(constants.CHROMITE_DIR, 'scripts', 'run_tests')]
+  result = cros_build_lib.RunCommand(cmd, error_code_ok=True)
+  return result.returncode