Home | History | Annotate | Download | only in platform_CryptohomeSyncStress
      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
      3 # found in the LICENSE file.
      4 
      5 import dbus
      6 from autotest_lib.client.bin import test
      7 from autotest_lib.client.common_lib import error
      8 from autotest_lib.client.common_lib.cros import chrome
      9 
     10 class platform_CryptohomeSyncStress(test.test):
     11     """
     12     This test is intended to be used from platform_CryptohomeSyncStressServer.
     13     """
     14     version = 1
     15 
     16     def run_once(self, username=None, password=None):
     17         # log in.
     18         with chrome.Chrome(username=username, password=password):
     19 
     20             # make sure cryptohome is mounted
     21             bus = dbus.SystemBus()
     22             proxy = bus.get_object('org.chromium.Cryptohome',
     23                                    '/org/chromium/Cryptohome')
     24             cryptohome = dbus.Interface(proxy, 'org.chromium.CryptohomeInterface')
     25 
     26             ismounted = cryptohome.IsMounted()
     27             if not ismounted:
     28                 raise error.TestFail('Cryptohome failed to mount.')
     29 
     30             self.job.set_state('client_fail', False)
     31