| OLD | NEW |
| 1 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved. | 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 | 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 dbus | 5 import dbus |
| 6 import dbus.glib | 6 import dbus.glib |
| 7 import gobject | 7 import gobject |
| 8 import logging | 8 import logging |
| 9 import random | 9 import random |
| 10 import string | 10 import string |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 def setup(self): | 23 def setup(self): |
| 24 os.chdir(self.srcdir) | 24 os.chdir(self.srcdir) |
| 25 utils.make('OUT_DIR=.') | 25 utils.make('OUT_DIR=.') |
| 26 | 26 |
| 27 | 27 |
| 28 def run_once(self): | 28 def run_once(self): |
| 29 sm = self.connect_to_session_manager() | 29 sm = self.connect_to_session_manager() |
| 30 | 30 |
| 31 # Initial policy setup. | 31 # Initial policy setup. |
| 32 priv = self.known_privkey() | 32 priv = ownership.known_privkey() |
| 33 pub = self.known_pubkey() | 33 pub = ownership.known_pubkey() |
| 34 self.push_policy(self.generate_policy(priv, pub, self._poldata), sm) | 34 self.push_policy(self.generate_policy(priv, pub, self._poldata), sm) |
| 35 | 35 |
| 36 # Force re-key the device | 36 # Force re-key the device |
| 37 (priv, pub) = ownership.pairgen_as_data() | 37 (priv, pub) = ownership.pairgen_as_data() |
| 38 self.push_policy(self.generate_policy(priv, pub, self._poldata), sm) | 38 self.push_policy(self.generate_policy(priv, pub, self._poldata), sm) |
| 39 | 39 |
| 40 # Rotate key gracefully. | 40 # Rotate key gracefully. |
| 41 username = ''.join(random.sample(string.ascii_uppercase,6)) + "@foo.com" | 41 username = ''.join(random.sample(string.ascii_uppercase,6)) + "@foo.com" |
| 42 password = ''.join(random.sample(string.ascii_uppercase,6)) | 42 password = ''.join(random.sample(string.ascii_uppercase,6)) |
| 43 cryptohome.remove_vault(username) | 43 cryptohome.remove_vault(username) |
| (...skipping 10 matching lines...) Expand all Loading... |
| 54 old_key=priv), | 54 old_key=priv), |
| 55 sm) | 55 sm) |
| 56 | 56 |
| 57 if not sm.StopSession(''): | 57 if not sm.StopSession(''): |
| 58 raise error.TestFail('Could not stop session for random user') | 58 raise error.TestFail('Could not stop session for random user') |
| 59 | 59 |
| 60 | 60 |
| 61 def cleanup(self): | 61 def cleanup(self): |
| 62 cryptohome.unmount_vault() | 62 cryptohome.unmount_vault() |
| 63 super(login_RemoteOwnership, self).cleanup() | 63 super(login_RemoteOwnership, self).cleanup() |
| OLD | NEW |