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

Unified Diff: client/site_tests/login_OwnershipTaken/login_OwnershipTaken.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
Index: client/site_tests/login_OwnershipTaken/login_OwnershipTaken.py
diff --git a/client/site_tests/login_OwnershipTaken/login_OwnershipTaken.py b/client/site_tests/login_OwnershipTaken/login_OwnershipTaken.py
index 2eb79d5f0a91179c073a72efd53a701471b2e8b1..533cffeb8f3143f9088de613411418ca6d81505c 100644
--- a/client/site_tests/login_OwnershipTaken/login_OwnershipTaken.py
+++ b/client/site_tests/login_OwnershipTaken/login_OwnershipTaken.py
@@ -33,33 +33,7 @@ class login_OwnershipTaken(cros_ui_test.UITest):
login.wait_for_ownership()
sm = ownership.connect_to_session_manager()
-
retrieved_policy = sm.RetrievePolicy(byte_arrays=True)
if retrieved_policy is None:
raise error.TestFail('Policy not found')
-
- # Pull in protobuf definitions.
- sys.path.append(self.srcdir)
- from device_management_backend_pb2 import PolicyFetchResponse
- from device_management_backend_pb2 import PolicyData
- from chrome_device_policy_pb2 import ChromeDeviceSettingsProto
- from chrome_device_policy_pb2 import UserWhitelistProto
-
- policy_proto = PolicyFetchResponse()
- policy_proto.ParseFromString(retrieved_policy)
- poldata = PolicyData()
- poldata.ParseFromString(policy_proto.policy_data)
- if (not poldata.HasField('username') or
- poldata.username != self.username):
- raise error.TestFail('Username not appropriately set in policy')
-
- polval = ChromeDeviceSettingsProto()
- polval.ParseFromString(poldata.policy_value)
- if (not polval.HasField('allow_new_users') or
- not polval.allow_new_users.HasField('allow_new_users') or
- not polval.allow_new_users):
- raise error.TestFail('Whitelisting not disabled in policy')
-
- if (not polval.HasField('user_whitelist') or
- not self.username in polval.user_whitelist.user_whitelist):
- raise error.TestFail('Owner not whitelisted')
+ self.validate_basic_policy(retrieved_policy)

Powered by Google App Engine
This is Rietveld 408576698