From c1f950236b2f1ba3b588fc638ebf8cb785c36e08 Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Thu, 11 Oct 2018 16:21:35 -0400 Subject: [PATCH] qa/tasks: qemu task now uses a relative path in suite repo for test This makes it easier to re-run tests against a suite branch without requiring a full ceph-ci build and repo. Signed-off-by: Jason Dillaman --- qa/suites/rbd/maintenance/qemu/xfstests.yaml | 2 +- .../workloads/devstack-tempest-gate.yaml | 2 +- qa/suites/rbd/qemu/workloads/qemu_bonnie.yaml | 2 +- .../rbd/qemu/workloads/qemu_fsstress.yaml | 2 +- .../qemu/workloads/qemu_iozone.yaml.disabled | 2 +- .../rbd/qemu/workloads/qemu_xfstests.yaml | 2 +- qa/tasks/qemu.py | 34 +++++++++---------- 7 files changed, 22 insertions(+), 24 deletions(-) diff --git a/qa/suites/rbd/maintenance/qemu/xfstests.yaml b/qa/suites/rbd/maintenance/qemu/xfstests.yaml index 38022f6b915..135103b3497 100644 --- a/qa/suites/rbd/maintenance/qemu/xfstests.yaml +++ b/qa/suites/rbd/maintenance/qemu/xfstests.yaml @@ -10,5 +10,5 @@ io_workload: type: block disks: 3 time_wait: 120 - test: http://git.ceph.com/?p={repo};a=blob_plain;hb={branch};f=qa/run_xfstests_qemu.sh + test: qa/run_xfstests_qemu.sh exclude_arch: armv7l diff --git a/qa/suites/rbd/openstack/workloads/devstack-tempest-gate.yaml b/qa/suites/rbd/openstack/workloads/devstack-tempest-gate.yaml index 26ddda9edcc..5e168462a97 100644 --- a/qa/suites/rbd/openstack/workloads/devstack-tempest-gate.yaml +++ b/qa/suites/rbd/openstack/workloads/devstack-tempest-gate.yaml @@ -7,7 +7,7 @@ tasks: disks: - image_size: 30720 - image_size: 30720 - test: http://git.ceph.com/?p={repo};a=blob_plain;hb={branch};f=qa/workunits/rbd/run_devstack_tempest.sh + test: qa/workunits/rbd/run_devstack_tempest.sh image_url: https://cloud-images.ubuntu.com/releases/16.04/release/ubuntu-16.04-server-cloudimg-amd64-disk1.img cloud_config_archive: - type: text/cloud-config diff --git a/qa/suites/rbd/qemu/workloads/qemu_bonnie.yaml b/qa/suites/rbd/qemu/workloads/qemu_bonnie.yaml index e06a5870e8e..0ef9ebb65f4 100644 --- a/qa/suites/rbd/qemu/workloads/qemu_bonnie.yaml +++ b/qa/suites/rbd/qemu/workloads/qemu_bonnie.yaml @@ -2,5 +2,5 @@ tasks: - qemu: all: clone: true - test: http://git.ceph.com/?p={repo};a=blob_plain;hb={branch};f=qa/workunits/suites/bonnie.sh + test: qa/workunits/suites/bonnie.sh exclude_arch: armv7l diff --git a/qa/suites/rbd/qemu/workloads/qemu_fsstress.yaml b/qa/suites/rbd/qemu/workloads/qemu_fsstress.yaml index a78801df25b..95f51480552 100644 --- a/qa/suites/rbd/qemu/workloads/qemu_fsstress.yaml +++ b/qa/suites/rbd/qemu/workloads/qemu_fsstress.yaml @@ -2,5 +2,5 @@ tasks: - qemu: all: clone: true - test: http://git.ceph.com/?p={repo};a=blob_plain;hb={branch};f=qa/workunits/suites/fsstress.sh + test: qa/workunits/suites/fsstress.sh exclude_arch: armv7l diff --git a/qa/suites/rbd/qemu/workloads/qemu_iozone.yaml.disabled b/qa/suites/rbd/qemu/workloads/qemu_iozone.yaml.disabled index c436ba1f6dc..e159e208e8f 100644 --- a/qa/suites/rbd/qemu/workloads/qemu_iozone.yaml.disabled +++ b/qa/suites/rbd/qemu/workloads/qemu_iozone.yaml.disabled @@ -1,6 +1,6 @@ tasks: - qemu: all: - test: http://git.ceph.com/?p={repo};a=blob_plain;h={branch};f=qa/workunits/suites/iozone.sh + test: qa/workunits/suites/iozone.sh image_size: 20480 exclude_arch: armv7l diff --git a/qa/suites/rbd/qemu/workloads/qemu_xfstests.yaml b/qa/suites/rbd/qemu/workloads/qemu_xfstests.yaml index 2fc6fb695e5..198f798d470 100644 --- a/qa/suites/rbd/qemu/workloads/qemu_xfstests.yaml +++ b/qa/suites/rbd/qemu/workloads/qemu_xfstests.yaml @@ -4,5 +4,5 @@ tasks: clone: true type: block disks: 3 - test: http://git.ceph.com/?p={repo};a=blob_plain;hb={branch};f=qa/run_xfstests_qemu.sh + test: qa/run_xfstests_qemu.sh exclude_arch: armv7l diff --git a/qa/tasks/qemu.py b/qa/tasks/qemu.py index d6f256f7c7b..ccb41a6dfba 100644 --- a/qa/tasks/qemu.py +++ b/qa/tasks/qemu.py @@ -15,6 +15,8 @@ from tasks import rbd from teuthology.orchestra import run from teuthology.config import config as teuth_config +from util.workunit import get_refspec_after_overrides + log = logging.getLogger(__name__) DEFAULT_NUM_DISKS = 2 @@ -102,24 +104,20 @@ def generate_iso(ctx, config): # use ctx.config instead of config, because config has been # through teuthology.replace_all_with_clients() - refspec = ctx.config.get('branch') - if refspec is None: - refspec = ctx.config.get('tag') - if refspec is None: - refspec = ctx.config.get('sha1') - if refspec is None: - refspec = 'HEAD' - - # hack: the git_url is always ceph-ci or ceph - git_url = teuth_config.get_ceph_git_url() - repo_name = 'ceph.git' - if git_url.count('ceph-ci'): - repo_name = 'ceph-ci.git' + refspec = get_refspec_after_overrides(ctx.config, {}) + + git_url = teuth_config.get_ceph_qa_suite_git_url() + log.info('Pulling tests from %s ref %s', git_url, refspec) for client, client_config in config.iteritems(): assert 'test' in client_config, 'You must specify a test to run' - test_url = client_config['test'].format(repo=repo_name, branch=refspec) + test = client_config['test'] + (remote,) = ctx.cluster.only(client).remotes.keys() + + clone_dir = '{tdir}/clone.{role}'.format(tdir=testdir, role=client) + remote.run(args=refspec.clone(git_url, clone_dir)) + src_dir = os.path.dirname(__file__) userdata_path = os.path.join(testdir, 'qemu', 'userdata.' + client) metadata_path = os.path.join(testdir, 'qemu', 'metadata.' + client) @@ -181,11 +179,10 @@ def generate_iso(ctx, config): test_file = '{tdir}/qemu/{client}.test.sh'.format(tdir=testdir, client=client) - log.info('fetching test %s for %s', test_url, client) + log.info('fetching test %s for %s', test, client) remote.run( args=[ - 'wget', '-nv', '-O', test_file, - test_url, + 'cp', '--', os.path.join(clone_dir, test), test_file, run.Raw('&&'), 'chmod', '755', test_file, ], @@ -210,11 +207,12 @@ def generate_iso(ctx, config): (remote,) = ctx.cluster.only(client).remotes.keys() remote.run( args=[ - 'rm', '-f', + 'rm', '-rf', '{tdir}/qemu/{client}.iso'.format(tdir=testdir, client=client), os.path.join(testdir, 'qemu', 'userdata.' + client), os.path.join(testdir, 'qemu', 'metadata.' + client), '{tdir}/qemu/{client}.test.sh'.format(tdir=testdir, client=client), + '{tdir}/clone.{client}'.format(tdir=testdir, client=client), ], ) -- 2.39.5