def task(ctx, config):
"""
Run chef-solo on all nodes.
+
+ Optional parameters:
+ tasks:
+ -chef
+ script_url: # override default location for solo-from-scratch for Chef
+ chef_repo: # override default Chef repo used by solo-from-scratch
+ chef_branch: # to choose a different upstream branch for ceph-qa-chef
"""
log.info('Running chef-solo...')
+ if config is None:
+ config = {}
+
+ assert isinstance(config, dict), "chef - need config"
+ chef_script = config.get('script_url', 'http://ceph.com/git/?p=ceph-qa-chef.git;a=blob_plain;f=solo/solo-from-scratch;hb=HEAD')
+ chef_repo = config.get('chef_repo', "")
+ chef_branch = config.get('chef_branch', "")
run.wait(
ctx.cluster.run(
args=[
# '-q',
'-O-',
# 'https://raw.github.com/ceph/ceph-qa-chef/master/solo/solo-from-scratch',
- 'http://ceph.com/git/?p=ceph-qa-chef.git;a=blob_plain;f=solo/solo-from-scratch;hb=HEAD',
+ chef_script,
run.Raw('|'),
+ run.Raw('CHEF_REPO={repo}'.format(repo=chef_repo)),
+ run.Raw('CHEF_BRANCH={branch}'.format(branch=chef_branch)),
'sh',
'-x',
],
tests = properties.get('tests')
randomize = properties.get('randomize')
+
(remote,) = ctx.cluster.only(role).remotes.keys()
# Fetch the test script
test_script = 'run_xfstests_krbd.sh'
test_path = os.path.join(test_root, test_script)
- git_branch = 'master'
- test_url = 'https://raw.github.com/ceph/ceph/{branch}/qa/{script}'.format(branch=git_branch, script=test_script)
+ git_branch = properties.get('xfstests_branch', 'master')
+ xfstests_url = properties.get('xfstests_url', 'https://raw.github.com/ceph/ceph/{branch}/qa'.format(branch=git_branch))
+ xfstests_krbd_url = xfstests_url + '/' + test_script
+
+ log.info('Fetching {script} for {role} from {url}'.format(
+ script=test_script,
+ role=role,
+ url=xfstests_krbd_url))
- log.info('Fetching {script} for {role} from {url}'.format(script=test_script,
- role=role,
- url=test_url))
- args = [ 'wget', '-O', test_path, '--', test_url ]
+ args = [ 'wget', '-O', test_path, '--', xfstests_krbd_url ]
remote.run(args=args)
log.info('Running xfstests on {role}:'.format(role=role))
args = [
'/usr/bin/sudo',
'TESTDIR={tdir}'.format(tdir=testdir),
+ 'URL_BASE={url}'.format(url=xfstests_url),
'adjust-ulimits',
'ceph-coverage',
'{tdir}/archive/coverage'.format(tdir=testdir),
fs_type: 'xfs'
tests: 'generic/100 xfs/003 xfs/005 xfs/006 generic/015'
randomize: true
+ xfstests_branch: master
+ xfstests_url: 'https://raw.github.com/ceph/branch/master/qa'
"""
if config is None:
config = { 'all': None }
fs_type=properties.get('fs_type', 'xfs'),
randomize=properties.get('randomize', False),
tests=properties.get('tests'),
+ xfstests_url=properties.get('xfstests_url'),
+ xfstests_branch=properties.get('xfstests_branch')
)
log.info('Setting up xfstests using RBD images:')