• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 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.common_lib.cros import tpm_utils
5from autotest_lib.server import autotest
6from autotest_lib.server import test
7
8
9class policy_WilcoServerDeviceDockMacAddressSource(test.test):
10    """Test that verifies DeviceDockMacAddressSource policy.
11
12    If the policy is set to 1, dock will grab the designated mac address from
13    the device.
14    If the policy is set to 2, dock mac address will match the device mac.
15    If the policy is set to 3, dock will use its own mac address.
16
17    This test has to run on a Wilco device.
18
19    The way the test is currently setup is: ethernet cable is plugged into the
20    device and dock is not plugged into the internet directly. This might
21    change later on.
22    """
23    version = 1
24
25
26    def cleanup(self):
27        """Clean up DUT."""
28        tpm_utils.ClearTPMIfOwned(self.host)
29
30
31    def run_once(self, client_test, host, case):
32        """Run the test.
33
34        @param client_test: the name of the Client test to run.
35        @param case: the case to run for the given Client test.
36        """
37        self.host = host
38        tpm_utils.ClearTPMIfOwned(self.host)
39
40        self.autotest_client = autotest.Autotest(self.host)
41        self.autotest_client.run_test(client_test, case=case)
42
43        self.host.reboot()
44
45        self.autotest_client.run_test(
46            client_test, case=case, enroll=False, check_mac=True)
47