OLD | NEW |
(Empty) | |
| 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 |
| 3 # found in the LICENSE file. |
| 4 |
| 5 import logging, os, re |
| 6 |
| 7 import os, time |
| 8 from autotest_lib.client.bin import site_login, test |
| 9 from autotest_lib.client.common_lib import error, utils |
| 10 |
| 11 class graphics_WindowManagerGraphicsCapture(test.test): |
| 12 version = 1 |
| 13 |
| 14 def setup(self): |
| 15 site_login.setup_autox(self) |
| 16 self.job.setup_dep(['glbench']) |
| 17 |
| 18 def run_once(self, script = 'autox_script.json', is_control = False): |
| 19 logged_in = site_login.logged_in() |
| 20 logging.info('was logged in already: %s' % logged_in) |
| 21 |
| 22 if not logged_in: |
| 23 # Test account information embedded into json file. |
| 24 if not site_login.attempt_login(self, script): |
| 25 raise error.TestFail('Could not login') |
| 26 |
| 27 # Wait until login complete and window manager is up |
| 28 time.sleep(10) |
| 29 |
| 30 # |
| 31 # Run glbench |
| 32 # |
| 33 dep = 'glbench' |
| 34 dep_dir = os.path.join(self.autodir, 'deps', dep) |
| 35 self.job.install_pkg(dep, 'dep', dep_dir) |
| 36 |
| 37 exefile = os.path.join(self.autodir, 'deps/glbench/windowmanagertest') |
| 38 |
| 39 # Enable running in window manager |
| 40 exefile = ('chvt 1 && DISPLAY=:0 XAUTHORITY=/home/chronos/.Xauthority ' |
| 41 + exefile) |
| 42 |
| 43 options = "--seconds_to_run 10" |
| 44 cmd = "%s %s" % (exefile, options) |
| 45 logging.info("command launched: %s" % cmd) |
| 46 self.results = utils.system_output(cmd, retain_output=True) |
| 47 |
| 48 # If we started logged out, log back out. |
| 49 if not logged_in: |
| 50 site_login.attempt_logout() |
OLD | NEW |