• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2011 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.client.bin import test, utils
6from autotest_lib.client.common_lib import error
7from autotest_lib.client.cros import cryptohome
8
9class platform_CryptohomeMultiple(test.test):
10    version = 1
11    cryptohome_proxy = None
12
13    def test_mount_single(self):
14        """
15        Tests mounting a single not-already-existing cryptohome. Ensures that
16        the infrastructure for multiple mounts is present and active.
17        """
18        user = utils.random_username()
19        if not self.cryptohome_proxy.mount(user, 'test', create=True):
20            raise error.TestFail('Mount failed for %s' % user)
21        self.cryptohome_proxy.require_mounted(user)
22        if not self.cryptohome_proxy.unmount(user):
23            raise error.TestFail('Unmount failed for %s' % user)
24
25    def run_once(self):
26        self.cryptohome_proxy = cryptohome.CryptohomeProxy()
27        self.test_mount_single()
28