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

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

Issue 1234004: Add control test for login_CryptohomeMounted (Closed)
Patch Set: Fix spacing, comments per gauravsh Created 10 years, 9 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/login_CryptohomeMounted/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/login_CryptohomeMounted/login_CryptohomeMounted.py
diff --git a/client/site_tests/login_CryptohomeMounted/login_CryptohomeMounted.py b/client/site_tests/login_CryptohomeMounted/login_CryptohomeMounted.py
index 28a99c1015556d068e616e2f7b699261dba77311..30d6dc01ec244252cb0bd2ddabc9f4fe5e2c87f0 100644
--- a/client/site_tests/login_CryptohomeMounted/login_CryptohomeMounted.py
+++ b/client/site_tests/login_CryptohomeMounted/login_CryptohomeMounted.py
@@ -2,7 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-import os, time
+import os, utils, time
+from autotest_lib.client.bin import chromeos_constants
from autotest_lib.client.bin import site_cryptohome, site_login, test
from autotest_lib.client.common_lib import error
@@ -12,7 +13,7 @@ class login_CryptohomeMounted(test.test):
def setup(self):
site_login.setup_autox(self)
- def run_once(self, script = 'autox_script.json', is_control = False):
+ def run_once(self, script='autox_script.json', is_control=False):
logged_in = site_login.logged_in()
if not logged_in:
@@ -20,9 +21,12 @@ class login_CryptohomeMounted(test.test):
if not site_login.attempt_login(self, script):
raise error.TestFail('Could not login')
- if not site_cryptohome.is_mounted(allow_fail = is_control):
- raise error.TestFail('Expected cryptohome to be mounted')
+ if (not is_control and
+ not site_cryptohome.is_mounted(allow_fail=is_control)):
+ raise error.TestFail('CryptohomeIsMounted should return %s' %
+ (not is_control))
# If we started logged out, log back out.
if not logged_in:
- site_login.attempt_logout()
+ if not site_login.attempt_logout():
+ raise error.TestError('Could not log out')
« no previous file with comments | « client/site_tests/login_CryptohomeMounted/control ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698