import argparse
import sys
+import os
import teuthology.openstack
parser.add_argument(
'-c', '--ceph',
help='The ceph branch to run against',
- default='master',
+ default=os.getenv('TEUTH_CEPH_BRANCH', 'master'),
)
parser.add_argument(
'-k', '--kernel',
parser.add_argument(
'--suite-branch',
help='Use this suite branch instead of the ceph branch',
+ default=os.getenv('TEUTH_SUITE_BRANCH', 'master'),
)
parser.add_argument(
'-e', '--email',
parser.add_argument(
'--ceph-repo',
help=("Query this repository for Ceph branch and SHA1"),
+ default=os.getenv('TEUTH_CEPH_REPO', 'https://github.com/ceph/ceph'),
)
parser.add_argument(
'--suite-repo',
help=("Use tasks and suite definition in this repository"),
+ default=os.getenv('TEUTH_SUITE_REPO', 'https://github.com/ceph/ceph'),
)
return parser
parser.add_argument(
'--teuthology-git-url',
help="git clone url for teuthology",
+ default=os.getenv('TEUTH_REPO', 'https://github.com/ceph/teuthology'),
)
parser.add_argument(
'--teuthology-branch',
help="use this teuthology branch instead of master",
- default='master',
+ default=os.getenv('TEUTH_BRANCH', 'master'),
)
parser.add_argument(
'--upload',
import sys
import teuthology.suite
+from teuthology.suite import override_arg_defaults as defaults
from teuthology.config import config
doc = """
usage: teuthology-suite --help
- teuthology-suite [-v | -vv ] --machine-type <type> --ceph <ceph> --suite <suite> [options] [<config_yaml>...]
- teuthology-suite [-v | -vv ] --machine-type <type> --ceph <ceph> --rerun <name> [options] [<config_yaml>...]
+ teuthology-suite [-v | -vv ] --machine-type <type> --suite <suite> [options] [<config_yaml>...]
+ teuthology-suite [-v | -vv ] --machine-type <type> --rerun <name> [options] [<config_yaml>...]
Run a suite of ceph integration tests. A suite is a directory containing
facets. A facet is a directory containing config snippets. Running a suite
The suite to schedule
--wait Block until the suite is finished
-c <ceph>, --ceph <ceph> The ceph branch to run against
+ [default: {default_ceph_branch}]
-S <sha1>, --sha1 <sha1> The ceph sha1 to run against (overrides -c)
If both -S and -c are supplied, -S wins, and
there is no validation that sha1 is contained
[default: basic]
-t <branch>, --teuthology-branch <branch>
The teuthology branch to run against.
- [default: master]
+ [default: {default_teuthology_branch}]
-m <type>, --machine-type <type>
Machine type [default: {default_machine_type}]
-d <distro>, --distro <distro>
[default: qa]
--suite-branch <suite_branch>
Use this suite branch instead of the ceph branch
+ [default: {default_suite_branch}]
--suite-dir <suite_dir> Use this alternative directory as-is when
assembling jobs from yaml fragments. This causes
<suite_branch> to be ignored for scheduling
""".format(
default_machine_type=config.default_machine_type,
default_results_timeout=config.results_timeout,
- default_ceph_repo=config.get_ceph_git_url(),
- default_suite_repo=config.get_ceph_qa_suite_git_url(),
+ default_ceph_repo=defaults('--ceph-repo',
+ config.get_ceph_git_url()),
+ default_suite_repo=defaults('--suite-repo',
+ config.get_ceph_qa_suite_git_url()),
+ default_ceph_branch=defaults('--ceph-branch', 'master'),
+ default_suite_branch=defaults('--suite-branch', 'master'),
+ default_teuthology_branch=defaults('--teuthology-branch', 'master'),
)
log = logging.getLogger(__name__)
+def override_arg_defaults(name, default, env=os.environ):
+ env_arg = {
+ '--ceph-repo' : 'TEUTH_CEPH_REPO',
+ '--suite-repo' : 'TEUTH_SUITE_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]
+ value = env[variable]
+ log.debug("Default value for '{arg}' is overridden "
+ "from environment with: {val}"
+ .format(arg=name, val=value))
+ return value
+ else:
+ return default
+
+
def process_args(args):
conf = YamlConfig()
rename_args = {