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') |