Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Side by Side Diff: client/site_tests/login_RemoteOwnership/login_RemoteOwnership.py

Issue 6880288: [autotest] Add test for the re-taking of ownership after the owner key is lost (Closed) Base URL: http://git.chromium.org/git/autotest.git@master
Patch Set: improve comment Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « client/site_tests/login_OwnershipTaken/login_OwnershipTaken.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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()
OLDNEW
« no previous file with comments | « client/site_tests/login_OwnershipTaken/login_OwnershipTaken.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698