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

Unified Diff: ctest/ctest.py

Issue 6775011: Generate public key from update engine private key. (Closed) Base URL: http://git.chromium.org/git/crostestutils.git@master
Patch Set: Created 9 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ctest/ctest.py
diff --git a/ctest/ctest.py b/ctest/ctest.py
index 4b09f08ffbd384f8c32f584ca2339e2007adb6ea..1fa23c8fd68d59af88355d9e3928864876de6652 100755
--- a/ctest/ctest.py
+++ b/ctest/ctest.py
@@ -207,6 +207,21 @@ def GrabZipAndExtractImage(zip_url, download_folder, image_name) :
fh.close()
+def GeneratePublicKey(private_key_path):
+ """Returns the path to a generate public key from given private key."""
petkov 2011/03/29 23:16:48 s/generate/generated/
+ # Just output to local directory.
+ public_key_path = 'public_key.pem'
+ cros_lib.Info('Generating public key from private key.')
+ cros_lib.RunCommand(['/usr/bin/openssl',
+ 'rsa',
+ '-in', private_key_path,
+ '-pubout',
+ '-out', public_key_path,
+ ], print_cmd=False)
+ return public_key_path
+
+
+
def RunAUTestHarness(board, channel, zip_server_base,
no_graphics, type, remote, clean, test_results_root):
"""Runs the auto update test harness.
@@ -241,6 +256,9 @@ def RunAUTestHarness(board, channel, zip_server_base,
update_engine_path = os.path.join(crosutils_root, '..', 'platform',
'update_engine')
+ private_key_path = os.path.join(update_engine_path, 'unittest_key.pem')
+ public_key_path = GeneratePublicKey(private_key_path)
+
cmd = ['bin/cros_au_test_harness',
'--base_image=%s' % os.path.join(download_folder,
_IMAGE_TO_EXTRACT),
@@ -249,10 +267,8 @@ def RunAUTestHarness(board, channel, zip_server_base,
'--board=%s' % board,
'--type=%s' % type,
'--remote=%s' % remote,
- '--private_key=%s' % os.path.join(update_engine_path,
- 'unittest_key.pem'),
- '--public_key=%s' % os.path.join(update_engine_path,
- 'unittest_key.pub.pem'),
+ '--private_key=%s' % private_key_path,
+ '--public_key=%s' % public_key_path,
]
if test_results_root: cmd.append('--test_results_root=%s' % test_results_root)
if no_graphics: cmd.append('--no_graphics')
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698