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) |