• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2014 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.
4
5from autotest_lib.server import autotest
6from autotest_lib.server import test
7
8class platform_CryptohomeMigrateChapsToken(test.test):
9    """ This test checks to see if Chaps generated keys are
10        available after a ChromeOS autoupdate.
11    """
12    version = 1
13
14    CLIENT_TEST = 'platform_CryptohomeMigrateChapsTokenClient'
15
16
17    def run_once(self, host, baseline_version=None):
18        # Save the build on the DUT, because we want to provision it after
19        # the test.
20        info = host.host_info_store.get()
21        final_version = info.build
22        if baseline_version:
23            version = baseline_version
24        else:
25            board_name = host.get_board().split(':')[1]
26            version = "%s-release/R37-3773.0.0" % board_name
27
28        # Downgrade to baseline version and run client side test.
29        self.job.run_test('provision_AutoUpdate', host=host,
30                          value=version)
31        client_at = autotest.Autotest(host)
32        client_at.run_test(self.CLIENT_TEST, generate_key=True)
33        # Upgrade back to latest version and see if the key migration
34        # succeeded.
35        self.job.run_test('provision_AutoUpdate', host=host,
36                          value=final_version)
37        client_at.run_test(self.CLIENT_TEST, generate_key=False)
38