cram: support fetching from sha1 branch, tag, commit hash

Signed-off-by: Venky Shankar <vshankar@redhat.com>
This commit is contained in:
Venky Shankar 2016-12-09 15:11:49 +05:30
parent 79c2db9bea
commit d2f0d74598
3 changed files with 15 additions and 3 deletions

View File

@ -2,4 +2,4 @@ tasks:
- cram:
clients:
client.0:
- http://git.ceph.com/?p=ceph.git;a=blob_plain;f=src/test/cli-integration/rbd/unmap.t
- http://git.ceph.com/?p=ceph.git;a=blob_plain;hb={branch};f=src/test/cli-integration/rbd/unmap.t

View File

@ -7,4 +7,4 @@ tasks:
- cram:
clients:
client.0:
- http://git.ceph.com/?p=ceph.git;a=blob_plain;f=src/test/cli-integration/rbd/formatted-output.t
- http://git.ceph.com/?p=ceph.git;a=blob_plain;hb={branch};f=src/test/cli-integration/rbd/formatted-output.t

View File

@ -29,6 +29,7 @@ def task(ctx, config):
- http://ceph.com/qa/test.t
- http://ceph.com/qa/test2.t]
client.1: [http://ceph.com/qa/test.t]
branch: foo
You can also run a list of cram tests on all clients::
@ -49,6 +50,17 @@ def task(ctx, config):
config['clients'])
testdir = teuthology.get_testdir(ctx)
overrides = ctx.config.get('overrides', {})
teuthology.deep_merge(config, overrides.get('workunit', {}))
refspec = config.get('branch')
if refspec is None:
refspec = config.get('tag')
if refspec is None:
refspec = config.get('sha1')
if refspec is None:
refspec = 'HEAD'
try:
for client, tests in clients.iteritems():
(remote,) = ctx.cluster.only(client).remotes.iterkeys()
@ -68,7 +80,7 @@ def task(ctx, config):
assert test.endswith('.t'), 'tests must end in .t'
remote.run(
args=[
'wget', '-nc', '-nv', '-P', client_dir, '--', test,
'wget', '-nc', '-nv', '-P', client_dir, '--', test.format(branch=refspec),
],
)