| 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, utils |
| 6 from autotest_lib.client.bin import chromeos_constants, test | 6 from autotest_lib.client.bin import test |
| 7 from autotest_lib.client.common_lib import error | 7 from autotest_lib.client.common_lib import error |
| 8 | 8 from autotest_lib.client.cros import constants as chromeos_constants |
| 9 | 9 |
| 10 CRYPTOHOME_CMD = '/usr/sbin/cryptohome' | 10 CRYPTOHOME_CMD = '/usr/sbin/cryptohome' |
| 11 | 11 |
| 12 class ChromiumOSError(error.InstallError): | 12 class ChromiumOSError(error.InstallError): |
| 13 """Generic error for ChromiumOS-specific exceptions.""" | 13 """Generic error for ChromiumOS-specific exceptions.""" |
| 14 pass | 14 pass |
| 15 | 15 |
| 16 | 16 |
| 17 def __run_cmd(cmd): | 17 def __run_cmd(cmd): |
| 18 return utils.system_output(cmd + ' 2>&1', retain_output=True, | 18 return utils.system_output(cmd + ' 2>&1', retain_output=True, |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 return len(mount_parts) > 0 and re.match(device, mount_parts[0]) | 85 return len(mount_parts) > 0 and re.match(device, mount_parts[0]) |
| 86 | 86 |
| 87 | 87 |
| 88 def is_mounted_on_tmpfs(device = chromeos_constants.CRYPTOHOME_INCOGNITO, | 88 def is_mounted_on_tmpfs(device = chromeos_constants.CRYPTOHOME_INCOGNITO, |
| 89 expected_mountpt = | 89 expected_mountpt = |
| 90 chromeos_constants.CRYPTOHOME_MOUNT_PT, | 90 chromeos_constants.CRYPTOHOME_MOUNT_PT, |
| 91 allow_fail = False): | 91 allow_fail = False): |
| 92 mount_parts = __get_mount_parts(device, allow_fail) | 92 mount_parts = __get_mount_parts(device, allow_fail) |
| 93 return (len(mount_parts) > 2 and device == mount_parts[0] and | 93 return (len(mount_parts) > 2 and device == mount_parts[0] and |
| 94 'tmpfs' == mount_parts[2]) | 94 'tmpfs' == mount_parts[2]) |
| OLD | NEW |