]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
suite: add --suite-relpath option
authorZack Cerza <zack@redhat.com>
Wed, 30 Nov 2016 21:03:52 +0000 (14:03 -0700)
committerZack Cerza <zack@redhat.com>
Fri, 2 Dec 2016 17:27:10 +0000 (10:27 -0700)
Signed-off-by: Zack Cerza <zack@redhat.com>
scripts/suite.py
teuthology/suite/__init__.py
teuthology/suite/placeholder.py
teuthology/suite/run.py
teuthology/suite/test/test_placeholder.py
teuthology/suite/test/test_run_.py

index 76d1e5d1218f08401c6dd62af1cada24d8180611..beabcc36d00a2130bd7e1de6657ad6bd90204e12 100644 (file)
@@ -59,6 +59,9 @@ Standard arguments:
                               Distro version to run against
   --suite-repo <suite_repo>   Use tasks and suite definition in this repository
                               [default: {default_suite_repo}]
+  --suite-relpath <suite_relpath>
+                              Look for tasks and suite definitions in this
+                              subdirectory of the suite repo.
   --suite-branch <suite_branch>
                               Use this suite branch instead of the ceph branch
   --suite-dir <suite_dir>     Use this alternative directory as-is when
index 3949e4fb61c1e03adca8f14ef8c9eb1066d210ed..9bd5d175869687439ac03536f4b744d9d17a7598 100644 (file)
@@ -35,6 +35,8 @@ def process_args(args):
         key = rename_args.get(key) or key
         if key == 'suite' and value is not None:
             value = normalize_suite_name(value)
+        if key == 'suite_relpath' and value is None:
+            value = ''
         elif key in ('limit', 'priority', 'num', 'newest'):
             value = int(value)
         elif key == 'subset' and value is not None:
index fe068c94070ff33b1d7dd7c26677b0e87210c237..de346e4f55f386dabbf8e28c146192072a03e104 100644 (file)
@@ -97,6 +97,7 @@ dict_templ = {
     },
     'suite': Placeholder('suite'),
     'suite_repo': Placeholder('suite_repo'),
+    'suite_relpath': Placeholder('suite_relpath'),
     'suite_branch': Placeholder('suite_branch'),
     'suite_sha1': Placeholder('suite_hash'),
     'tasks': [],
index 13225f70e257a55160fad8e7beb003a4132fb21b..c09e89f019b428c10fe6b406a7391df673586696 100644 (file)
@@ -107,6 +107,7 @@ class Run(object):
             archive_upload=config.archive_upload,
             archive_upload_key=config.archive_upload_key,
             suite_repo=config.get_ceph_qa_suite_git_url(),
+            suite_relpath=self.args.suite_relpath,
         )
         return self.build_base_config()
 
@@ -441,9 +442,12 @@ class Run(object):
         name = self.name
         arch = util.get_arch(self.base_config.machine_type)
         suite_name = self.base_config.suite
-        suite_path = os.path.join(
-            self.suite_repo_path, 'suites',
-            self.base_config.suite.replace(':', '/'))
+        suite_path = os.path.normpath(os.path.join(
+            self.suite_repo_path,
+            self.args.suite_relpath,
+            'suites',
+            self.base_config.suite.replace(':', '/'),
+        ))
         log.debug('Suite %s in %s' % (suite_name, suite_path))
         configs = [
             (combine_path(suite_name, item[0]), item[1]) for item in
index 03d04d35da6c035b3c3ae7ec41b6c5ea0a94c808..297b44c27f90a7d02da592864f63b1ef6144e8df 100644 (file)
@@ -19,6 +19,7 @@ class TestPlaceholder(object):
             archive_upload='archive_upload',
             archive_upload_key='archive_upload_key',
             suite_repo='https://example.com/ceph/suite.git',
+            suite_relpath='',
         )
         output_dict = substitute_placeholders(dict_templ, input_dict)
         assert output_dict['suite'] == 'suite'
@@ -42,6 +43,7 @@ class TestPlaceholder(object):
             distro=None,
             distro_version=None,
             suite_repo='https://example.com/ceph/suite.git',
+            suite_relpath='',
         )
         output_dict = substitute_placeholders(dict_templ, input_dict)
         assert 'os_type' not in output_dict
index c6d87fb1749f8a6e608d74bfaa148e146e8c272f..b3b3db798ec5d538017a56c33ad329dc38735737 100644 (file)
@@ -20,6 +20,7 @@ class TestRun(object):
         self.args_dict = dict(
             suite='suite',
             suite_branch='suite_branch',
+            suite_relpath='',
             ceph_branch='ceph_branch',
             ceph_sha1='ceph_sha1',
             email='address@example.com',
@@ -178,6 +179,7 @@ class TestScheduleSuite(object):
     def setup(self):
         self.args_dict = dict(
             suite='suite',
+            suite_relpath='',
             suite_dir='suite_dir',
             suite_branch='master',
             ceph_branch='ceph_branch',