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

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

Issue 6880288: [autotest] Add test for the re-taking of ownership after the owner key is lost (Closed) Base URL: http://git.chromium.org/git/autotest.git@master
Patch Set: improve comment Created 9 years, 8 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/cros/ownership.py ('k') | client/site_tests/login_OwnershipRetaken/control » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/site_tests/login_OwnershipApi/login_OwnershipApi.py
diff --git a/client/site_tests/login_OwnershipApi/login_OwnershipApi.py b/client/site_tests/login_OwnershipApi/login_OwnershipApi.py
index d854e6202a6645fe9c5f887b5b1c0fcd5419e03a..c1b00c525da75c82086593617db29c13a735fc00 100644
--- a/client/site_tests/login_OwnershipApi/login_OwnershipApi.py
+++ b/client/site_tests/login_OwnershipApi/login_OwnershipApi.py
@@ -39,7 +39,7 @@ class login_OwnershipApi(cros_ownership_test.OwnershipTest):
tmpname)))
os.unlink(tmpname)
- self.use_known_ownerkeys()
+ ownership.use_known_ownerkeys()
cros_ui.start()
login.wait_for_browser()
@@ -52,8 +52,8 @@ class login_OwnershipApi(cros_ownership_test.OwnershipTest):
def run_once(self):
- pkey = self.known_privkey()
- pubkey = self.known_pubkey()
+ pkey = ownership.known_privkey()
+ pubkey = ownership.known_pubkey()
sm = self.connect_to_session_manager()
if not sm.StartSession(self._testuser, ''):
raise error.TestFail('Could not start session for owner')
@@ -68,10 +68,25 @@ class login_OwnershipApi(cros_ownership_test.OwnershipTest):
policy_string = self.generate_policy(pkey, pubkey, poldata)
self.push_policy(policy_string, sm)
retrieved_policy = self.get_policy(sm)
-
- if retrieved_policy != policy_string:
- raise error.TestFail('Policy should not be %s' % retrieved_policy)
-
+ if retrieved_policy is None: raise error.TestFail('Policy not found')
+ self.compare_policy_response(retrieved_policy,
+ owner=self._testuser,
+ guests=False,
+ new_users=True,
+ roaming=True,
+ whitelist=(self._testuser, 'a@b.c'),
+ proxies={ 'proxy_mode': 'direct' })
+ try:
+ # Sanity check against an incorrect policy
+ self.compare_policy_response(retrieved_policy,
+ owner=self._testuser,
+ guests=True,
+ whitelist=(self._testuser, 'a@b.c'),
+ proxies={ 'proxy_mode': 'direct' })
+ except ownership.OwnershipError:
+ pass
+ else:
+ raise error.TestFail('Did not detect bad policy')
if not sm.StopSession(''):
raise error.TestFail('Could not stop session for owner')
« no previous file with comments | « client/cros/ownership.py ('k') | client/site_tests/login_OwnershipRetaken/control » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698