From 8807af323d5892163b3d08df8e3246e4e361f3ef Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Thu, 6 Sep 2018 16:07:08 +0200 Subject: [PATCH] qa/tasks/cram: tasks now must live in the repository Commit 0d8887652d53 ("qa/tasks/cram: use suite_repo repository for all cram jobs") removed hardcoded git.ceph.com links, but as it turned out it is still used for nightlies. There is no good way to accommodate the different URL schemes, so let's get rid of URLs altogether. Fixes: https://tracker.ceph.com/issues/27211 Signed-off-by: Ilya Dryomov (cherry picked from commit 592f566b4e270d3833ba896dabb193d5241dd5de) --- qa/suites/krbd/basic/tasks/krbd_blkroset.yaml | 2 +- .../krbd/basic/tasks/krbd_huge_image.yaml | 2 +- .../krbd/basic/tasks/krbd_msgr_segments.yaml | 2 +- .../krbd/basic/tasks/krbd_parent_overlap.yaml | 2 +- .../tasks/krbd_whole_object_discard.yaml | 2 +- qa/suites/krbd/unmap/tasks/unmap.yaml | 2 +- .../rbd/singleton/all/formatted-output.yaml | 2 +- qa/tasks/cram.py | 33 ++++++++----------- 8 files changed, 21 insertions(+), 26 deletions(-) diff --git a/qa/suites/krbd/basic/tasks/krbd_blkroset.yaml b/qa/suites/krbd/basic/tasks/krbd_blkroset.yaml index 3b401c1a34c5f..ac311874bedab 100644 --- a/qa/suites/krbd/basic/tasks/krbd_blkroset.yaml +++ b/qa/suites/krbd/basic/tasks/krbd_blkroset.yaml @@ -2,4 +2,4 @@ tasks: - cram: clients: client.0: - - '{gh_url}/raw/{branch}/qa/rbd/krbd_blkroset.t' + - qa/rbd/krbd_blkroset.t diff --git a/qa/suites/krbd/basic/tasks/krbd_huge_image.yaml b/qa/suites/krbd/basic/tasks/krbd_huge_image.yaml index 93dbdc1d71205..15ff033c7acf7 100644 --- a/qa/suites/krbd/basic/tasks/krbd_huge_image.yaml +++ b/qa/suites/krbd/basic/tasks/krbd_huge_image.yaml @@ -2,4 +2,4 @@ tasks: - cram: clients: client.0: - - '{gh_url}/raw/{branch}/qa/rbd/krbd_huge_image.t' + - qa/rbd/krbd_huge_image.t diff --git a/qa/suites/krbd/basic/tasks/krbd_msgr_segments.yaml b/qa/suites/krbd/basic/tasks/krbd_msgr_segments.yaml index 77f8dc282785d..cfa524e70f919 100644 --- a/qa/suites/krbd/basic/tasks/krbd_msgr_segments.yaml +++ b/qa/suites/krbd/basic/tasks/krbd_msgr_segments.yaml @@ -2,4 +2,4 @@ tasks: - cram: clients: client.0: - - '{gh_url}/raw/{branch}/qa/rbd/krbd_msgr_segments.t' + - qa/rbd/krbd_msgr_segments.t diff --git a/qa/suites/krbd/basic/tasks/krbd_parent_overlap.yaml b/qa/suites/krbd/basic/tasks/krbd_parent_overlap.yaml index eccfca4042abc..9bcf1fa3502eb 100644 --- a/qa/suites/krbd/basic/tasks/krbd_parent_overlap.yaml +++ b/qa/suites/krbd/basic/tasks/krbd_parent_overlap.yaml @@ -2,4 +2,4 @@ tasks: - cram: clients: client.0: - - '{gh_url}/raw/{branch}/qa/rbd/krbd_parent_overlap.t' + - qa/rbd/krbd_parent_overlap.t diff --git a/qa/suites/krbd/basic/tasks/krbd_whole_object_discard.yaml b/qa/suites/krbd/basic/tasks/krbd_whole_object_discard.yaml index 7594589a5524a..9c558a3cd2a85 100644 --- a/qa/suites/krbd/basic/tasks/krbd_whole_object_discard.yaml +++ b/qa/suites/krbd/basic/tasks/krbd_whole_object_discard.yaml @@ -2,4 +2,4 @@ tasks: - cram: clients: client.0: - - '{gh_url}/raw/{branch}/qa/rbd/krbd_whole_object_discard.t' + - qa/rbd/krbd_whole_object_discard.t diff --git a/qa/suites/krbd/unmap/tasks/unmap.yaml b/qa/suites/krbd/unmap/tasks/unmap.yaml index 47153cf4d36ff..435061b459ff4 100644 --- a/qa/suites/krbd/unmap/tasks/unmap.yaml +++ b/qa/suites/krbd/unmap/tasks/unmap.yaml @@ -2,4 +2,4 @@ tasks: - cram: clients: client.0: - - '{gh_url}/raw/{branch}/src/test/cli-integration/rbd/unmap.t' + - src/test/cli-integration/rbd/unmap.t diff --git a/qa/suites/rbd/singleton/all/formatted-output.yaml b/qa/suites/rbd/singleton/all/formatted-output.yaml index df1112d4e32af..7be94ef23027c 100644 --- a/qa/suites/rbd/singleton/all/formatted-output.yaml +++ b/qa/suites/rbd/singleton/all/formatted-output.yaml @@ -7,4 +7,4 @@ tasks: - cram: clients: client.0: - - '{gh_url}/raw/{branch}/src/test/cli-integration/rbd/formatted-output.t' + - src/test/cli-integration/rbd/formatted-output.t diff --git a/qa/tasks/cram.py b/qa/tasks/cram.py index edcb172267173..40f8253eec245 100644 --- a/qa/tasks/cram.py +++ b/qa/tasks/cram.py @@ -4,6 +4,8 @@ Cram tests import logging import os +from util.workunit import get_refspec_after_overrides + from teuthology import misc as teuthology from teuthology.parallel import parallel from teuthology.orchestra import run @@ -13,7 +15,7 @@ log = logging.getLogger(__name__) def task(ctx, config): """ - Run all cram tests from the specified urls on the specified + Run all cram tests from the specified paths on the specified clients. Each client runs tests in parallel. Limitations: @@ -27,9 +29,9 @@ def task(ctx, config): - cram: clients: client.0: - - http://download.ceph.com/qa/test.t - - http://download.ceph.com/qa/test2.t] - client.1: [http://download.ceph.com/qa/test.t] + - qa/test.t + - qa/test2.t] + client.1: [qa/test.t] branch: foo You can also run a list of cram tests on all clients:: @@ -38,7 +40,7 @@ def task(ctx, config): - ceph: - cram: clients: - all: [http://download.ceph.com/qa/test.t] + all: [qa/test.t] :param ctx: Context :param config: Configuration @@ -52,19 +54,10 @@ def task(ctx, config): 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' + refspec = get_refspec_after_overrides(config, overrides) git_url = teuth_config.get_ceph_qa_suite_git_url() - if git_url.endswith('.git'): - git_url = git_url[:-4] + log.info('Pulling tests from %s ref %s', git_url, refspec) try: for client, tests in clients.iteritems(): @@ -80,13 +73,14 @@ def task(ctx, config): 'install', 'cram==0.6', ], ) + clone_dir = '{tdir}/clone.{role}'.format(tdir=testdir, role=client) + remote.run(args=refspec.clone(git_url, clone_dir)) + for test in tests: - url = test.format(gh_url=git_url, branch=refspec) - log.info('fetching test %s for %s', url, client) assert test.endswith('.t'), 'tests must end in .t' remote.run( args=[ - 'wget', '-nc', '-nv', '-P', client_dir, '--', url, + 'cp', '--', os.path.join(clone_dir, test), client_dir, ], ) @@ -117,6 +111,7 @@ def task(ctx, config): args=[ 'rm', '-rf', '--', '{tdir}/virtualenv'.format(tdir=testdir), + clone_dir, run.Raw(';'), 'rmdir', '--ignore-fail-on-non-empty', client_dir, ], -- 2.39.5