]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
Add validate-sha1 option to teuthology-suite 1194/head
authorAdam Wolfe Gordon <awg@digitalocean.com>
Mon, 23 Jul 2018 22:28:05 +0000 (16:28 -0600)
committerAdam Wolfe Gordon <awg@digitalocean.com>
Fri, 23 Nov 2018 18:35:35 +0000 (11:35 -0700)
Allow users to skip validation of SHA1s passed to -S when submitting
jobs via teuthology-suite. This is useful when testing against
non-GitHub repos, since teuthology can't validate refs for a plain git
repository.

Signed-off-by: Adam Wolfe Gordon <awg@digitalocean.com>
scripts/suite.py
teuthology/suite/__init__.py
teuthology/suite/run.py

index 44b4fac74d697d19910b9979384dc3204250eae5..2e8596f668d9a853ab040bef62ed47ff3e89d975 100644 (file)
@@ -71,6 +71,9 @@ Standard arguments:
                               <suite_branch> to be ignored for scheduling
                               purposes, but it will still be used for test
                               running.
+  --validate-sha1 <bool>
+                              Validate that git SHA1s passed to -S exist.
+                              [default: true]
 
 Scheduler arguments:
   --owner <owner>             Job owner
index ad2d1103089edf46021ceecdb624e390e3f54c1b..d11b70029a65035014df7d92acf12a74d12532c1 100644 (file)
@@ -6,6 +6,7 @@ import logging
 import os
 import random
 import time
+from distutils.util import strtobool
 
 import teuthology
 from ..config import config, YamlConfig
@@ -56,6 +57,8 @@ def process_args(args):
             value = expand_short_repo_name(
                 value,
                 config.get_ceph_qa_suite_git_url())
+        elif key in ('validate_sha1'):
+            value = strtobool(value)
         conf[key] = value
     return conf
 
index 5c01e39ceba6621aff2209685965c85296d0441d..c84171317bfbe8d5922e5803e5e10812b5a152f8 100644 (file)
@@ -151,7 +151,9 @@ class Run(object):
         repo_name = self.ceph_repo_name
 
         if self.args.ceph_sha1:
-            ceph_hash = util.git_validate_sha1(repo_name, self.args.ceph_sha1)
+            ceph_hash = self.args.ceph_sha1
+            if self.args.validate_sha1:
+                ceph_hash = util.git_validate_sha1(repo_name, ceph_hash)
             if not ceph_hash:
                 exc = CommitNotFoundError(
                     self.args.ceph_sha1,