Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Unified Diff: server/autotest.py

Issue 4176007: Fix server side autotests installing to the wrong directory. (Closed) Base URL: http://git.chromium.org/git/autotest.git
Patch Set: Change path back to default. Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « global_config.ini ('k') | server/autotest_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: server/autotest.py
diff --git a/server/autotest.py b/server/autotest.py
index ca4ecf6215a99854b5ea078b41e8d788a6067fc9..63d652e7a779250c9fe86922cc1a59b76bf2e5a4 100644
--- a/server/autotest.py
+++ b/server/autotest.py
@@ -61,6 +61,12 @@ class BaseAutotest(installable_object.InstallableObject):
@classmethod
+ def get_client_autodir_real_path(cls, host):
+ return global_config.global_config.get_config_value(
+ 'AUTOSERV', 'client_autodir_real_path', type=str)
+
+
+ @classmethod
def get_installed_autodir(cls, host):
"""
Find where the Autotest client is installed on the host.
@@ -106,9 +112,26 @@ class BaseAutotest(installable_object.InstallableObject):
@classmethod
def _find_installable_dir(cls, host):
client_autodir_paths = cls.get_client_autodir_paths(host)
+ client_autodir_real_path = utils.sh_escape(
+ cls.get_client_autodir_real_path(host))
for path in client_autodir_paths:
try:
- host.run('mkdir -p %s' % utils.sh_escape(path))
+ path = utils.sh_escape(path)
+ # Since ChromeOS uses tmpfs (in memory fs) we don't want to let
+ # Autotest use it for running tests and storing results. As an
+ # additional wrinkle all fs are mounted noexec. To work around
+ # this we need to setup a mount point and remount it as exec.
+ host.run('mkdir -p ' + client_autodir_real_path)
+ host.run('mkdir -p ' + path)
+
+ # Check for existing mount and unmount if exists.
+ result = host.run('mount | grep -q ' + path, ignore_status=True)
+ if result.exit_status == 0:
+ host.run('umount ' + path)
+
+ host.run('mount --bind %s %s' % (client_autodir_real_path,
+ path))
+ host.run('mount -o remount,exec ' + path)
return path
except error.AutoservRunError:
logging.debug('Failed to create %s', path)
« no previous file with comments | « global_config.ini ('k') | server/autotest_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698