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
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:
- 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::
- ceph:
- cram:
clients:
- all: [http://download.ceph.com/qa/test.t]
+ all: [qa/test.t]
:param ctx: Context
:param config: Configuration
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():
'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,
],
)
args=[
'rm', '-rf', '--',
'{tdir}/virtualenv'.format(tdir=testdir),
+ clone_dir,
run.Raw(';'),
'rmdir', '--ignore-fail-on-non-empty', client_dir,
],