]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Save ceph sha1 in coverage dir.
authorJosh Durgin <josh.durgin@dreamhost.com>
Thu, 9 Jun 2011 21:02:44 +0000 (14:02 -0700)
committerTommi Virtanen <tommi.virtanen@dreamhost.com>
Fri, 10 Jun 2011 00:17:47 +0000 (17:17 -0700)
This is needed to postprocess the coverage data.

teuthology/misc.py
teuthology/task/ceph.py

index f1243938f1417f72db7a8f26efe63338974cd4c5..6bed0014a15207458517b3883bc26252f818ef52 100644 (file)
@@ -38,7 +38,7 @@ def get_ceph_binary_url(branch=None, tag=None, flavor=None):
     sha1_fp.close()
     log.debug('Using ceph sha1 %s', sha1)
     bindir_url = urlparse.urljoin(BASE, 'sha1/{sha1}/'.format(sha1=sha1))
-    return bindir_url
+    return (sha1, bindir_url)
 
 def feed_many_stdins(fp, processes):
     while True:
index 68c4ddbb9ecf18f2e201459409183e01d1428506..36d20b0488bfe2fdc73568fdb33d3dee29685ac8 100644 (file)
@@ -109,7 +109,7 @@ def task(ctx, config):
                     )
 
     log.info('Untarring ceph binaries...')
-    ceph_bindir_url = teuthology.get_ceph_binary_url(
+    sha1, ceph_bindir_url = teuthology.get_ceph_binary_url(
         branch=config.get('branch'),
         tag=config.get('tag'),
         flavor=flavor,
@@ -152,6 +152,21 @@ def task(ctx, config):
     teuthology.feed_many_stdins_and_close(conf_fp, writes)
     run.wait(writes)
 
+    version_fp = StringIO()
+    version_fp.write(sha1 + '\n')
+    version_fp.seek(0)
+    writes = ctx.cluster.run(
+        args=[
+            'python',
+            '-c',
+            'import shutil, sys; shutil.copyfileobj(sys.stdin, file(sys.argv[1], "wb"))',
+            '/tmp/cephtest/coverage/ceph_version',
+            ],
+        stdin=run.PIPE,
+        wait=False,
+        )
+    teuthology.feed_many_stdins_and_close(version_fp, writes)
+
     log.info('Setting up mon.0...')
     ctx.cluster.only('mon.0').run(
         args=[