[autotest] Add moblab autotest install directory.

Remove the hardcoding of the moblab autotest install directory,
and have it passed via global_config.

Also point poor_mans_rpc to use get_installed_autodir as a host's
autodir is not set unless ran within autotest.py.

BUG=chromium:405170
TEST=Able to add both Moblab and Non-Moblab DUTs via cli/atest.
Moblab server-side and client-side tests work.

Change-Id: I83be3ed9f1c6d54022063f08e62d6254326a7ace
Reviewed-on: https://chromium-review.googlesource.com/213170
Reviewed-by: Simran Basi <sbasi@chromium.org>
Tested-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Simran Basi <sbasi@chromium.org>
diff --git a/global_config.ini b/global_config.ini
index fdfcc3b..cb00629 100644
--- a/global_config.ini
+++ b/global_config.ini
@@ -33,7 +33,7 @@
 
 [AUTOSERV]
 # Autotest potential install paths
-client_autodir_paths: /usr/local/autotest
+client_autodir_paths: /usr/local/autotest,/usr/local/autodir
 # White list of tests with run time measurement enabled.
 measure_run_time_tests: desktopui_ScreenLocker,login_LoginSuccess,security_ProfilePermissions
 # Incrementally update TKO with the status as the test runs.
diff --git a/server/hosts/cros_host.py b/server/hosts/cros_host.py
index b51439d..59c99b4 100644
--- a/server/hosts/cros_host.py
+++ b/server/hosts/cros_host.py
@@ -23,7 +23,7 @@
 from autotest_lib.client.common_lib.cros.graphite import stats
 from autotest_lib.client.cros import constants
 from autotest_lib.client.cros import cros_ui
-from autotest_lib.server import autoserv_parser
+from autotest_lib.server import autoserv_parser, autotest
 from autotest_lib.server import utils as server_utils
 from autotest_lib.server.cros.dynamic_suite import constants as ds_constants
 from autotest_lib.server.cros.dynamic_suite import tools, frontend_wrappers
@@ -1488,7 +1488,7 @@
         @param fun function in client utils namespace.
         @return output string from calling fun.
         """
-        script = 'cd /usr/local/autotest/bin; '
+        script = 'cd %s/bin; ' % autotest.Autotest.get_installed_autodir(self)
         script += 'python -c "import common; import utils;'
         script += 'print utils.%s"' % fun
         return script
diff --git a/server/hosts/moblab_host.py b/server/hosts/moblab_host.py
index af2570f..be823c0 100644
--- a/server/hosts/moblab_host.py
+++ b/server/hosts/moblab_host.py
@@ -33,8 +33,6 @@
         # Clear the Moblab Image Storage so that staging an image is properly
         # tested.
         self.run('rm -rf %s/*' % MOBLAB_IMAGE_STORAGE)
-        # Ensure the autotest install directory exists.
-        self.run('mkdir -p %s' % self.get_autodir())
 
 
     @staticmethod
@@ -59,11 +57,6 @@
         return result.exit_status == 0
 
 
-    def get_autodir(self):
-        """Return the directory to install autotest for client side tests."""
-        return '/usr/local/autodir'
-
-
     def run_as_moblab(self, command, **kwargs):
         """Moblab commands should be ran as the moblab user not root.