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

Side by Side 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, 10 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 unified diff | Download patch
« no previous file with comments | « client/site_tests/system_AutoLogin/control ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import logging, os, utils 5 import logging, os, utils
6 from autotest_lib.client.bin import test 6 from autotest_lib.client.bin import test
7 from autotest_lib.client.common_lib import error 7 from autotest_lib.client.common_lib import error
8 8
9 class system_AutoLogin(test.test): 9 class system_AutoLogin(test.test):
10 version = 1 10 version = 1
11 11
12 def setup(self):
13 self.job.setup_dep(['autox'])
14 # create a empty srcdir to prevent the error that checks .version file
15 if not os.path.exists(self.srcdir):
16 os.mkdir(self.srcdir)
17
12 def run_once(self): 18 def run_once(self):
13 # Test account information embedded into json file 19 # Test account information embedded into json file
14 20
21 dep = 'autox'
22 dep_dir = os.path.join(self.autodir, 'deps', dep)
23 self.job.install_pkg(dep, 'dep', dep_dir)
24
15 # Set up environment to access login manager 25 # Set up environment to access login manager
16 environment_cmd = \ 26 environment_vars = \
17 'export DISPLAY=:0.0 && export XAUTHORITY=/home/chronos/.Xauthority' 27 'DISPLAY=:0.0 XAUTHORITY=/home/chronos/.Xauthority'
18 28
19 xtest_binary = '/usr/bin/autox' 29 autox_binary = '%s/%s' % (dep_dir, 'usr/bin/autox')
20 xtest_script = os.path.join(self.bindir, 'autox_script.json') 30 autox_script = os.path.join(self.bindir, 'autox_script.json')
21 31
22 try: 32 try:
23 utils.system('%s && %s %s' \ 33 utils.system('%s %s %s' \
24 % (environment_cmd, xtest_binary, xtest_script)) 34 % (environment_vars, autox_binary, autox_script))
25 except error.CmdError, e: 35 except error.CmdError, e:
26 logging.debug(e) 36 logging.debug(e)
27 raise error.TestFail('AutoX program failed to login for test user') 37 raise error.TestFail('AutoX program failed to login for test user')
OLDNEW
« 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