aboutsummaryrefslogtreecommitdiff
path: root/crosperf/settings_factory.py
diff options
context:
space:
mode:
authorcmtice <cmtice@google.com>2015-04-22 09:25:53 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-04-26 04:18:33 +0000
commit5c09fc2966ac49263ce7154c2905f2a86aeda297 (patch)
treeafb3ec9829c59f98cf1cabdc2a26c71465cf9153 /crosperf/settings_factory.py
parentd7d5084ffa40651b5adbaea4f4659a51e1045f06 (diff)
downloadtoolchain-utils-5c09fc2966ac49263ce7154c2905f2a86aeda297.tar.gz
Fix current problem with machine locks.
Currently if crosperf can't access the default locks directory, it assumes that it is safe to proceed without locks and it uses machines without checking locks. This script does two things: It causes crosperf to fail if it can't access a locks directory; and it allows the user to specify an alternate locks directory. As a by-product it also adds a boolean prompting function to utils/misc.py BUG=None TEST=Tested with default directory accessible & inaccessible; tested using local locks directory. Change-Id: I6f24f772986813bf089f5f4e40335a15e8ee4837 Reviewed-on: https://chrome-internal-review.googlesource.com/214129 Reviewed-by: Luis Lozano <llozano@chromium.org> Commit-Queue: Caroline Tice <cmtice@google.com> Tested-by: Caroline Tice <cmtice@google.com>
Diffstat (limited to 'crosperf/settings_factory.py')
-rw-r--r--crosperf/settings_factory.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/crosperf/settings_factory.py b/crosperf/settings_factory.py
index d86dc2bc..835748a3 100644
--- a/crosperf/settings_factory.py
+++ b/crosperf/settings_factory.py
@@ -6,6 +6,8 @@
"""Setting files for global, benchmark and labels."""
+import lock_machine
+
from field import BooleanField
from field import FloatField
from field import IntegerField
@@ -133,6 +135,14 @@ class GlobalSettings(Settings):
" se[arated bu a \",\""))
self.AddField(TextField("results_dir", default="",
description="The results dir"))
+ default_locks_dir = lock_machine.Machine.LOCKS_DIR
+ self.AddField(TextField("locks_dir", default=default_locks_dir,
+ description="An alternate directory to use for "
+ "storing/checking machine locks.\n"
+ "WARNING: If you use your own locks directory, "
+ "there is no guarantee that someone else might not "
+ "hold a lock on the same machine in a different "
+ "locks directory."))
self.AddField(TextField("chrome_src",
description="The path to the source of chrome. "
"This is used to run telemetry benchmarks. "