OLD | NEW |
1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import logging, os, re, utils | 5 import logging, os, re |
6 import common | 6 import common |
7 import constants as chromeos_constants | 7 import constants as chromeos_constants |
8 from autotest_lib.client.bin import test | 8 from autotest_lib.client.bin import test, utils |
9 from autotest_lib.client.common_lib import error | 9 from autotest_lib.client.common_lib import error |
10 | 10 |
11 | 11 |
12 CRYPTOHOME_CMD = '/usr/sbin/cryptohome' | 12 CRYPTOHOME_CMD = '/usr/sbin/cryptohome' |
13 | 13 |
14 class ChromiumOSError(error.InstallError): | 14 class ChromiumOSError(error.InstallError): |
15 """Generic error for ChromiumOS-specific exceptions.""" | 15 """Generic error for ChromiumOS-specific exceptions.""" |
16 pass | 16 pass |
17 | 17 |
18 | 18 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 return len(mount_parts) > 0 and re.match(device, mount_parts[0]) | 87 return len(mount_parts) > 0 and re.match(device, mount_parts[0]) |
88 | 88 |
89 | 89 |
90 def is_mounted_on_tmpfs(device = chromeos_constants.CRYPTOHOME_INCOGNITO, | 90 def is_mounted_on_tmpfs(device = chromeos_constants.CRYPTOHOME_INCOGNITO, |
91 expected_mountpt = | 91 expected_mountpt = |
92 chromeos_constants.CRYPTOHOME_MOUNT_PT, | 92 chromeos_constants.CRYPTOHOME_MOUNT_PT, |
93 allow_fail = False): | 93 allow_fail = False): |
94 mount_parts = __get_mount_parts(device, allow_fail) | 94 mount_parts = __get_mount_parts(device, allow_fail) |
95 return (len(mount_parts) > 2 and device == mount_parts[0] and | 95 return (len(mount_parts) > 2 and device == mount_parts[0] and |
96 'tmpfs' == mount_parts[2]) | 96 'tmpfs' == mount_parts[2]) |
OLD | NEW |