Telemetry based version of desktopui_SimpleLogin test.
Replacing the pyauto version with a telemetry version. This test is only
called by USB stress tests which are not run in the lab and is a very simple
change, so there is no need for a separate telemetry_ version.
BUG=None
TEST=ran it
Change-Id: Ie605516bb115153d2bf2415eefb02a1676b8590f
Reviewed-on: https://chromium-review.googlesource.com/185707
Reviewed-by: Achuith Bhandarkar <achuith@chromium.org>
Commit-Queue: Katherine Threlkeld <kathrelkeld@chromium.org>
Tested-by: Katherine Threlkeld <kathrelkeld@chromium.org>
diff --git a/client/site_tests/desktopui_SimpleLogin/control b/client/site_tests/desktopui_SimpleLogin/control
index abcd160..dc223ca 100644
--- a/client/site_tests/desktopui_SimpleLogin/control
+++ b/client/site_tests/desktopui_SimpleLogin/control
@@ -1,12 +1,12 @@
-# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
+# Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-AUTHOR = "Chrome OS Project"
+AUTHOR = "kathrelkeld"
NAME = "desktopui_SimpleLogin"
-PURPOSE = "Logs into the system, this is used be server based servo tests."
+PURPOSE = "Logs into the system; this is used be server based servo tests."
CRITERIA = """
-This test logs in and waits forever.
+This test logs in and waits forever (or until exit flag is seen).
"""
TIME = "LONG"
TEST_CATEGORY = "General"
@@ -14,7 +14,8 @@
TEST_TYPE = "client"
DOC = """
-This test logs in and waits forever.
+This test logs in and waits forever (or until the exit flag is seen).
+Telemetry based test.
"""
job.run_test('desktopui_SimpleLogin')
diff --git a/client/site_tests/desktopui_SimpleLogin/desktopui_SimpleLogin.py b/client/site_tests/desktopui_SimpleLogin/desktopui_SimpleLogin.py
index 90b3f42..8595a4f 100755
--- a/client/site_tests/desktopui_SimpleLogin/desktopui_SimpleLogin.py
+++ b/client/site_tests/desktopui_SimpleLogin/desktopui_SimpleLogin.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
+# Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -6,26 +6,24 @@
import os
import time
-from autotest_lib.client.cros import cros_ui_test, httpd
+from autotest_lib.client.bin import test
+from autotest_lib.client.common_lib.cros import chrome
-class desktopui_SimpleLogin(cros_ui_test.UITest):
+class desktopui_SimpleLogin(test.test):
+ """Login and wait until exit flag file is seen."""
version = 1
- def initialize(self):
- super(desktopui_SimpleLogin, self).initialize(creds='$default')
- self._testServer = httpd.HTTPListener(8000, docroot=self.bindir)
- self._testServer.run()
-
-
def run_once(self):
+ """Entrance point for test."""
terminate_path = '/tmp/simple_login_exit'
if os.path.isfile(terminate_path):
os.remove(terminate_path)
- while True:
- time.sleep(1)
- if os.path.isfile(terminate_path):
- logging.info('Exit flag detected, exiting.')
- return
+ with chrome.Chrome():
+ while True:
+ time.sleep(1)
+ if os.path.isfile(terminate_path):
+ logging.info('Exit flag detected; exiting.')
+ return