diff --git a/scripts/suite.py b/scripts/suite.py index 3cf858db67..c1ae44eb03 100644 --- a/scripts/suite.py +++ b/scripts/suite.py @@ -85,6 +85,9 @@ purposes, but it will still be used for test running. The must have `qa/suite` sub-directory. + --teuthology-repo + Use this repository for teuthology run + [default: {default_teuthology_repo}] --validate-sha1 Validate that git SHA1s passed to -S exist. [default: true] @@ -222,6 +225,8 @@ config.get_ceph_git_url()), default_suite_repo=defaults('--suite-repo', config.get_ceph_qa_suite_git_url()), + default_teuthology_repo=defaults('--teuthology-repo', + config.get_teuthology_git_url()), default_ceph_branch=defaults('--ceph-branch', 'main'), default_job_threshold=config.job_threshold, ) diff --git a/teuthology/dispatcher/__init__.py b/teuthology/dispatcher/__init__.py index 59f8ae3279..5db54bac78 100644 --- a/teuthology/dispatcher/__init__.py +++ b/teuthology/dispatcher/__init__.py @@ -247,9 +247,12 @@ def prep_job(job_config, log_file_path, archive_dir): # store that value. teuthology_branch = job_config.get('teuthology_branch', 'main') job_config['teuthology_branch'] = teuthology_branch + teuthology_repo = job_config.get('teuthology_repo') + if teuthology_repo: + teuth_config.teuthology_git_url = teuthology_repo teuthology_sha1 = job_config.get('teuthology_sha1') if not teuthology_sha1: - repo_url = repo_utils.build_git_url('teuthology', 'ceph') + repo_url = teuth_config.get_teuthology_git_url() try: teuthology_sha1 = repo_utils.ls_remote(repo_url, teuthology_branch) except Exception as exc: diff --git a/teuthology/suite/__init__.py b/teuthology/suite/__init__.py index 8a17cf5f10..cff42f8c11 100644 --- a/teuthology/suite/__init__.py +++ b/teuthology/suite/__init__.py @@ -24,8 +24,10 @@ def override_arg_defaults(name, default, env=os.environ): env_arg = { '--ceph-repo' : 'TEUTH_CEPH_REPO', '--suite-repo' : 'TEUTH_SUITE_REPO', + '--teuthology-repo' : 'TEUTH_REPO', '--ceph-branch' : 'TEUTH_CEPH_BRANCH', '--suite-branch' : 'TEUTH_SUITE_BRANCH', + '--teuthology-branch' : 'TEUTH_BRANCH', } if name in env_arg and env_arg[name] in env.keys(): variable = env_arg[name] @@ -79,6 +81,10 @@ def process_args(args): value = expand_short_repo_name( value, config.get_ceph_qa_suite_git_url()) + elif key == 'teuthology_repo': + value = expand_short_repo_name( + value, + config.get_teuthology_git_url()) elif key in ('validate_sha1', 'filter_fragments', 'kdb'): value = strtobool(value) conf[key] = value diff --git a/teuthology/suite/placeholder.py b/teuthology/suite/placeholder.py index f812fccac2..41fae20fc6 100644 --- a/teuthology/suite/placeholder.py +++ b/teuthology/suite/placeholder.py @@ -47,6 +47,7 @@ def _substitute(input_dict, values_dict): 'branch': Placeholder('ceph_branch'), 'expire': Placeholder('expire'), 'sha1': Placeholder('ceph_hash'), + 'teuthology_repo': Placeholder('teuthology_repo'), 'teuthology_branch': Placeholder('teuthology_branch'), 'teuthology_sha1': Placeholder('teuthology_sha1'), 'archive_upload': Placeholder('archive_upload'), diff --git a/teuthology/suite/run.py b/teuthology/suite/run.py index 984231dfb1..524853673c 100644 --- a/teuthology/suite/run.py +++ b/teuthology/suite/run.py @@ -52,6 +52,8 @@ def __init__(self, args): config.ceph_git_url = self.args.ceph_repo if self.args.suite_repo: config.ceph_qa_suite_git_url = self.args.suite_repo + if self.args.teuthology_repo: + config.teuthology_git_url = self.args.teuthology_repo self.base_config = self.create_initial_config() @@ -123,6 +125,7 @@ def create_initial_config(self): ceph_repo=config.get_ceph_git_url(), teuthology_branch=teuthology_branch, teuthology_sha1=teuthology_sha1, + teuthology_repo=config.get_teuthology_git_url(), machine_type=self.args.machine_type, distro=self.os.name, distro_version=self.os.version, diff --git a/teuthology/suite/test/test_placeholder.py b/teuthology/suite/test/test_placeholder.py index 31b51755d2..aa81c4feb2 100644 --- a/teuthology/suite/test/test_placeholder.py +++ b/teuthology/suite/test/test_placeholder.py @@ -13,6 +13,7 @@ def test_substitute_placeholders(self): ceph_branch='ceph_branch', ceph_hash='ceph_hash', teuthology_branch='teuthology_branch', + teuthology_repo='https://example.com/ceph/teuthology.git', teuthology_sha1='teuthology_sha1', machine_type='machine_type', distro='distro', @@ -41,6 +42,7 @@ def test_null_placeholders_dropped(self): ceph_branch='ceph_branch', ceph_hash='ceph_hash', teuthology_branch='teuthology_branch', + teuthology_repo='https://example.com/ceph/teuthology.git', teuthology_sha1='teuthology_sha1', machine_type='machine_type', archive_upload='archive_upload', diff --git a/teuthology/suite/test/test_run_.py b/teuthology/suite/test/test_run_.py index a3e6d12b34..f711e6be7c 100644 --- a/teuthology/suite/test/test_run_.py +++ b/teuthology/suite/test/test_run_.py @@ -338,6 +338,7 @@ def test_successful_schedule( 'suite_sha1', 'tasks', 'teuthology_branch', + 'teuthology_repo', 'teuthology_sha1', 'timestamp', 'user',