From 2533edde83b6eaddf556cb14a8980f0494874e85 Mon Sep 17 00:00:00 2001 From: Josh Durgin Date: Thu, 9 Jun 2011 14:02:44 -0700 Subject: [PATCH] Save ceph sha1 in coverage dir. This is needed to postprocess the coverage data. --- teuthology/misc.py | 2 +- teuthology/task/ceph.py | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/teuthology/misc.py b/teuthology/misc.py index f1243938f1417..6bed0014a1520 100644 --- a/teuthology/misc.py +++ b/teuthology/misc.py @@ -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: diff --git a/teuthology/task/ceph.py b/teuthology/task/ceph.py index 68c4ddbb9ecf1..36d20b0488bfe 100644 --- a/teuthology/task/ceph.py +++ b/teuthology/task/ceph.py @@ -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=[ -- 2.39.5