From 8a6fba1d955710b59a267c1b1766fb545ab1ab38 Mon Sep 17 00:00:00 2001 From: Adam Wolfe Gordon Date: Mon, 23 Jul 2018 16:28:05 -0600 Subject: [PATCH] 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 --- scripts/suite.py | 3 +++ teuthology/suite/__init__.py | 3 +++ teuthology/suite/run.py | 4 +++- 3 files changed, 9 insertions(+), 1 deletion(-) 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, -- 2.47.3