blob: 0fd5630ef9ac0523dfe4f77118e5f3e5dcf2ec43 [file] [log] [blame]
Chris Masone5e06f182010-03-23 08:29:52 -07001# 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
3# found in the LICENSE file.
4
5import logging, os, utils, time
Chris Masonee7dd0162010-03-23 13:50:58 -07006from autotest_lib.client.bin import chromeos_constants, test
Chris Masone5e06f182010-03-23 08:29:52 -07007from autotest_lib.client.common_lib import error
8
Chris Sosa10039272010-05-10 15:36:24 -07009def is_mounted(device=chromeos_constants.CRYPTOHOME_DEVICE,
10 expected_mountpt=chromeos_constants.CRYPTOHOME_MOUNT_PT,
11 allow_fail=False):
Will Drewry81ad6162010-04-01 10:26:07 -050012 mount_line = utils.system_output(
13 'grep %s /proc/$(pgrep cryptohomed)/mounts' % expected_mountpt,
Chris Sosa10039272010-05-10 15:36:24 -070014 ignore_status=allow_fail)
Bryan Yeung99ee6a52010-03-24 16:39:25 -040015 mount_parts = mount_line.split()
16 return len(mount_parts) > 0 and device == mount_parts[0]