• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2019 The Chromium OS Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4from autotest_lib.client.cros.enterprise import enterprise_policy_base
5
6
7class policy_WilcoOnNonWilcoDevice(
8        enterprise_policy_base.EnterprisePolicyTest):
9    """
10    Test for looping through Wilco policies on a non wilco device.
11
12    Setting Wilco policies on a non Wilco device should not cause a crash.
13
14    """
15    version = 1
16
17    def _run_setup_case(self, tests):
18        self.setup_case(
19            device_policies={
20                tests[0]['Policy_Name']: tests[0]['Policy_Value']},
21            enroll=True,
22            extra_chrome_flags=['--user-always-affiliated'])
23
24    def run_once(self, tests):
25        """
26        Entry point of this test.
27
28        @param case: True, False, or None for the value of the policy.
29
30        """
31        self._run_setup_case(tests)
32        tests.pop(0)
33        for test in tests:
34            self.update_policies(
35                device_policies={test['Policy_Name']: test['Policy_Value']})
36            self.verify_policy_value(test['Policy_Name'], test['Policy_Value'])
37