]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
RBD: added optional YAML parameters to test xfstests from different repos
authorDouglas Fuller <dfuller@redhat.com>
Tue, 31 Mar 2015 15:52:52 +0000 (08:52 -0700)
committerDouglas Fuller <dfuller@redhat.com>
Wed, 8 Apr 2015 00:45:20 +0000 (17:45 -0700)
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 <dfuller@redhat.com>
tasks/chef.py
tasks/rbd.py

index 62ca8846212fb2afb4f64dc956bc42dfdd57c41d..9d50da9a8cf6636306da0decbfdc1a4b72cacbdf 100644 (file)
@@ -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',
                 ],
index bf5e77008cefcbf02aa3f1f0f97336e8f6366d5f..bdacaaabec690ccf76dd524d2ecc05d48863ed19 100644 (file)
@@ -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:')