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
# 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)
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,
],
(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),
],
)