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

Unified Diff: client/site_tests/system_AutoLogin/system_AutoLogin.py

Issue 553128: Adds autox deps configuration and adds setup to AutoLogin (Closed)
Patch Set: Fixes to nits Created 10 years, 11 months 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 | « client/site_tests/system_AutoLogin/control ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/site_tests/system_AutoLogin/system_AutoLogin.py
diff --git a/client/site_tests/system_AutoLogin/system_AutoLogin.py b/client/site_tests/system_AutoLogin/system_AutoLogin.py
index 9cf5f8e0ae56fed2367e3369c3555cfe40c2167f..66f981597dc459fe1a0e7dd43077d3cf11b6f75c 100644
--- a/client/site_tests/system_AutoLogin/system_AutoLogin.py
+++ b/client/site_tests/system_AutoLogin/system_AutoLogin.py
@@ -9,19 +9,29 @@ from autotest_lib.client.common_lib import error
class system_AutoLogin(test.test):
version = 1
+ def setup(self):
+ self.job.setup_dep(['autox'])
+ # create a empty srcdir to prevent the error that checks .version file
+ if not os.path.exists(self.srcdir):
+ os.mkdir(self.srcdir)
+
def run_once(self):
- # Test account information embedded into json file
-
+ # Test account information embedded into json file
+
+ dep = 'autox'
+ dep_dir = os.path.join(self.autodir, 'deps', dep)
+ self.job.install_pkg(dep, 'dep', dep_dir)
+
# Set up environment to access login manager
- environment_cmd = \
- 'export DISPLAY=:0.0 && export XAUTHORITY=/home/chronos/.Xauthority'
-
- xtest_binary = '/usr/bin/autox'
- xtest_script = os.path.join(self.bindir, 'autox_script.json')
-
+ environment_vars = \
+ 'DISPLAY=:0.0 XAUTHORITY=/home/chronos/.Xauthority'
+
+ autox_binary = '%s/%s' % (dep_dir, 'usr/bin/autox')
+ autox_script = os.path.join(self.bindir, 'autox_script.json')
+
try:
- utils.system('%s && %s %s' \
- % (environment_cmd, xtest_binary, xtest_script))
+ utils.system('%s %s %s' \
+ % (environment_vars, autox_binary, autox_script))
except error.CmdError, e:
logging.debug(e)
- raise error.TestFail('AutoX program failed to login for test user')
+ raise error.TestFail('AutoX program failed to login for test user')
« no previous file with comments | « client/site_tests/system_AutoLogin/control ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698