diff --git a/README.md b/README.md index 77d3d93..fdfebe3 100644 --- a/README.md +++ b/README.md @@ -54,8 +54,10 @@ Options: --private-key TEXT Private key needed to access VMs in case the default is not enough. --sequential Run APITest commands sequentially from a - single client. [default: False] - --help Show this message and exit. [default: False] + single client. + --idmci-lifetime INTEGER Lifetime in hours of IdM-CI hosts. [default: + 8] + --help Show this message and exit. ``` ## Capturing results diff --git a/src/ipaperftest/core/constants.py b/src/ipaperftest/core/constants.py index 1b7681b..9aa8cde 100644 --- a/src/ipaperftest/core/constants.py +++ b/src/ipaperftest/core/constants.py @@ -54,7 +54,9 @@ def getLevelName(level): - playbook: init/testrunner-dir.yaml - name: provision steps: - - playbook: provision/mrack-up.yaml + - extra_vars: + lifetime: {lifetime} + playbook: provision/mrack-up.yaml - name: prep steps: - playbook: prep/redhat-base.yaml diff --git a/src/ipaperftest/core/main.py b/src/ipaperftest/core/main.py index 78687d4..8b0a171 100644 --- a/src/ipaperftest/core/main.py +++ b/src/ipaperftest/core/main.py @@ -154,6 +154,11 @@ def run(self, ctx): help="Run APITest commands sequentially from a single client.", is_flag=True ) +@click.option( + "--idmci-lifetime", + help="Lifetime in hours of IdM-CI hosts.", + default=8, +) @click.pass_context def main( ctx, @@ -170,7 +175,8 @@ def main( results_format="json", results_output_file=None, custom_repo_url="", - provider="idmci" + provider="idmci", + idmci_lifetime=8, ): tests = RunTest(['ipaperftest.registry']) diff --git a/src/ipaperftest/providers/idmci.py b/src/ipaperftest/providers/idmci.py index 1f3bff7..013bc56 100644 --- a/src/ipaperftest/providers/idmci.py +++ b/src/ipaperftest/providers/idmci.py @@ -80,7 +80,8 @@ def generate_metadata(self, ctx, machine_configs, domain): file_contents = IDMCI_METADATA_TEMPLATE.format( domain=domain.lower(), - hosts=hosts_metadata + hosts=hosts_metadata, + lifetime=ctx.params['idmci_lifetime'] ) with open("runner_metadata/metadata.yaml", "w") as f: f.write(file_contents)