From d2f0d745987a2e2eee4e1822146aad8da5d42708 Mon Sep 17 00:00:00 2001 From: Venky Shankar Date: Fri, 9 Dec 2016 15:11:49 +0530 Subject: [PATCH] cram: support fetching from sha1 branch, tag, commit hash Signed-off-by: Venky Shankar --- suites/krbd/unmap/tasks/unmap.yaml | 2 +- suites/rbd/singleton/all/formatted-output.yaml | 2 +- tasks/cram.py | 14 +++++++++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/suites/krbd/unmap/tasks/unmap.yaml b/suites/krbd/unmap/tasks/unmap.yaml index b9f0546f5fe49..f56c560260682 100644 --- a/suites/krbd/unmap/tasks/unmap.yaml +++ b/suites/krbd/unmap/tasks/unmap.yaml @@ -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 diff --git a/suites/rbd/singleton/all/formatted-output.yaml b/suites/rbd/singleton/all/formatted-output.yaml index c78424c2b179d..526cc038febb0 100644 --- a/suites/rbd/singleton/all/formatted-output.yaml +++ b/suites/rbd/singleton/all/formatted-output.yaml @@ -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 diff --git a/tasks/cram.py b/tasks/cram.py index 05138af4de03a..f1d63a3e91191 100644 --- a/tasks/cram.py +++ b/tasks/cram.py @@ -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), ], ) -- 2.39.5