From: Adam Wolfe Gordon Date: Mon, 23 Jul 2018 22:28:05 +0000 (-0600) Subject: Add validate-sha1 option to teuthology-suite X-Git-Tag: 1.1.0~283^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1194%2Fhead;p=teuthology.git Add validate-sha1 option to teuthology-suite 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 --- diff --git a/scripts/suite.py b/scripts/suite.py index 44b4fac74..2e8596f66 100644 --- a/scripts/suite.py +++ b/scripts/suite.py @@ -71,6 +71,9 @@ Standard arguments: to be ignored for scheduling purposes, but it will still be used for test running. + --validate-sha1 + Validate that git SHA1s passed to -S exist. + [default: true] Scheduler arguments: --owner Job owner diff --git a/teuthology/suite/__init__.py b/teuthology/suite/__init__.py index ad2d11030..d11b70029 100644 --- a/teuthology/suite/__init__.py +++ b/teuthology/suite/__init__.py @@ -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 diff --git a/teuthology/suite/run.py b/teuthology/suite/run.py index 5c01e39ce..c84171317 100644 --- a/teuthology/suite/run.py +++ b/teuthology/suite/run.py @@ -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,