]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
suite: add config.suite_verify_ceph_hash when no gitbuilder
authorLoic Dachary <ldachary@redhat.com>
Tue, 15 Sep 2015 10:50:49 +0000 (12:50 +0200)
committerloic <ldachary@redhat.com>
Sat, 31 Oct 2015 02:13:14 +0000 (11:13 +0900)
The suite_verify_ceph_hash configuration option is added to disable the
gitbuilder package verifications.

If True, teuthology-suite verifies that a package matching the ceph
branch exists in the gitbuilder. If False, no verification is done and
teuthology-suite assumes the packages are either not necessary to run
the task or they are created on demand.

Signed-off-by: Loic Dachary <loic@dachary.org>
docs/siteconfig.rst
teuthology/config.py
teuthology/suite.py
teuthology/test/test_suite.py

index 2c2b175bdeeab71bd71bc12639ad0f34409475e2..58c2071051339e2000f93529df302f6e9c5b253a 100644 (file)
@@ -119,6 +119,13 @@ Here is a sample configuration with many of the options set and documented::
     #           etc.
     baseurl_template: http://{host}/{proj}-{pkg_type}-{dist}-{arch}-{flavor}/{uri}
 
+    # If True, teuthology-suite verifies that a package matching the
+    # desired ceph branch exists in the gitbuilder. If False, no
+    # verification is done and teuthology-suite assumes the packages
+    # are either not necessary to run the task or they are created on
+    # demand.
+    suite_verify_ceph_hash: True
+
     # The OpenStack backend configuration, a dictionary interpreted as follows
     #
     openstack:
index 2a76f266b6262c570af32f8ac959b1e4c6d6a1d1..a9365a60997fa22f48c0bb981947b3489dc38abb 100644 (file)
@@ -150,6 +150,7 @@ class TeuthologyConfig(YamlConfig):
         'koji_task_url': 'https://kojipkgs.fedoraproject.org/work/',
         'baseurl_template': 'http://{host}/{proj}-{pkg_type}-{dist}-{arch}-{flavor}/{uri}',
         'teuthology_path': None,
+        'suite_verify_ceph_hash': True,
         'openstack': {
             'clone': 'git clone http://github.com/ceph/teuthology',
             'user-data': 'teuthology/openstack/openstack-{os_type}-{os_version}-user-data.txt',
index 4b9b4b3d4992e873f84a6e591324356ef10f375f..806be43d57c766a5a6e52ffb6d8386dc8e40e86c 100644 (file)
@@ -200,20 +200,27 @@ def create_initial_config(suite, suite_branch, ceph_branch, teuthology_branch,
         kernel_dict = dict()
 
     # Get the ceph hash
-    ceph_hash = get_hash('ceph', ceph_branch, kernel_flavor, machine_type,
-                         distro)
+    if config.suite_verify_ceph_hash:
+        ceph_hash = get_hash('ceph', ceph_branch, kernel_flavor, machine_type,
+                             distro)
+    else:
+        ceph_hash = git_ls_remote('ceph', ceph_branch)
+
     if not ceph_hash:
         exc = BranchNotFoundError(ceph_branch, 'ceph.git')
         schedule_fail(message=str(exc), name=name)
     log.info("ceph sha1: {hash}".format(hash=ceph_hash))
 
-    # Get the ceph package version
-    ceph_version = package_version_for_hash(ceph_hash, kernel_flavor,
-                                            distro, machine_type)
-    if not ceph_version:
-        schedule_fail("Packages for ceph hash '{ver}' not found".format(
-            ver=ceph_hash), name)
-    log.info("ceph version: {ver}".format(ver=ceph_version))
+    if config.suite_verify_ceph_hash:
+        # Get the ceph package version
+        ceph_version = package_version_for_hash(ceph_hash, kernel_flavor,
+                                                distro, machine_type)
+        if not ceph_version:
+            schedule_fail("Packages for ceph hash '{ver}' not found".format(
+                ver=ceph_hash), name)
+        log.info("ceph version: {ver}".format(ver=ceph_version))
+    else:
+        log.info('skipping ceph package verification')
 
     if teuthology_branch and teuthology_branch != 'master':
         if not git_branch_exists('teuthology', teuthology_branch):
index 87405ee57927c65d9e1411172bbfa1cd43b3bb75..d6e9a253fcb6e5924b018259af226094a9b1852c 100644 (file)
@@ -782,9 +782,34 @@ class TestSuiteMain(object):
                 fetch_repos=DEFAULT,
                 teuthology_schedule=DEFAULT,
                 sleep=DEFAULT,
+                get_arch=lambda x: 'x86_64',
+                git_ls_remote=lambda *args: '1234',
+                get_hash=DEFAULT,
+                package_version_for_hash=lambda *args: 'fake-9.5',
                 ) as m:
+            config.suite_verify_ceph_hash = False
             main(['--suite', suite_name,
                   '--suite-dir', 'teuthology/test',
                   '--throttle', throttle,
                   '--machine-type', machine_type])
             m['sleep'].assert_called_with(int(throttle))
+            m['get_hash'].assert_not_called()
+
+        with patch.multiple(
+                suite,
+                fetch_repos=DEFAULT,
+                teuthology_schedule=DEFAULT,
+                sleep=DEFAULT,
+                get_arch=lambda x: 'x86_64',
+                git_ls_remote=lambda *args: '1234',
+                get_hash=DEFAULT,
+                package_version_for_hash=lambda *args: 'fake-9.5',
+                ) as m:
+            config.suite_verify_ceph_hash = True
+            m['get_hash'].return_value = '12345'
+            main(['--suite', suite_name,
+                  '--suite-dir', 'teuthology/test',
+                  '--throttle', throttle,
+                  '--machine-type', machine_type])
+            m['sleep'].assert_called_with(int(throttle))
+            m['get_hash'].assert_called()