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 30d6dc01ec244252cb0bd2ddabc9f4fe5e2c87f0..8fecd5f0eb3b1a72463f8ed18d811d691f16e8ee 100644 |
--- a/client/site_tests/login_CryptohomeMounted/login_CryptohomeMounted.py |
+++ b/client/site_tests/login_CryptohomeMounted/login_CryptohomeMounted.py |
@@ -14,19 +14,18 @@ class login_CryptohomeMounted(test.test): |
site_login.setup_autox(self) |
def run_once(self, script='autox_script.json', is_control=False): |
- logged_in = site_login.logged_in() |
+ # Make sure that we're logged out initially -- this test is run |
+ # multiple times, and we don't want to reuse the previous instance's |
+ # session. |
+ if site_login.logged_in(): |
+ site_login.attempt_logout() |
- if not logged_in: |
- # Test account information embedded into json file. |
- if not site_login.attempt_login(self, script): |
- raise error.TestFail('Could not login') |
+ # Test account information embedded into json file. |
+ site_login.attempt_login(self, script) |
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: |
- if not site_login.attempt_logout(): |
- raise error.TestError('Could not log out') |
+ site_login.attempt_logout() |