From: Douglas Fuller Date: Tue, 31 Mar 2015 15:52:52 +0000 (-0700) Subject: RBD: added optional YAML parameters to test xfstests from different repos X-Git-Tag: v10.2.6~165^2^2~508^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7b855dea090570196ae8fd55616d9071425ddcb9;p=ceph.git RBD: added optional YAML parameters to test xfstests from different repos These variables are needed because ceph-qa-suite bootstraps ceph-qa-chef via http download of solo-from/scratch/run. This adds a variable to override the default script. It also adds variables to the rbd task to override the versions of run_xfstests_krbd.sh and run_xfstests.sh downloaded by the default task. variables added ====== 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 git upstream branch for ceph-qa-chef -rbd.xfstests: client.0: xfstests_branch: # to choose a different git upstream branch for xfstests xfstests_url: # override git base URL for run_xfstests{_krbd}.sh Signed-off-by: Douglas Fuller --- diff --git a/tasks/chef.py b/tasks/chef.py index 62ca8846212..9d50da9a8cf 100644 --- a/tasks/chef.py +++ b/tasks/chef.py @@ -11,9 +11,23 @@ log = logging.getLogger(__name__) 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=[ @@ -21,8 +35,10 @@ def task(ctx, config): # '-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', ], diff --git a/tasks/rbd.py b/tasks/rbd.py index bf5e77008ce..bdacaaabec6 100644 --- a/tasks/rbd.py +++ b/tasks/rbd.py @@ -289,6 +289,7 @@ def run_xfstests_one_client(ctx, role, properties): tests = properties.get('tests') randomize = properties.get('randomize') + (remote,) = ctx.cluster.only(role).remotes.keys() # Fetch the test script @@ -296,13 +297,16 @@ def run_xfstests_one_client(ctx, role, properties): 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)) @@ -319,6 +323,7 @@ def run_xfstests_one_client(ctx, role, properties): 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), @@ -366,6 +371,8 @@ def xfstests(ctx, config): 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 } @@ -423,6 +430,8 @@ def xfstests(ctx, config): 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:')