diff --git a/README.rst b/README.rst index b72fbb1..42f7ae6 100644 --- a/README.rst +++ b/README.rst @@ -16,5 +16,8 @@ Usage You can use the Docker container which is published to ``vexxhost/tempest-pushgateway`` and provide your OpenStack creentials in the environment, alternatively you can simply install this locally and call ``tempest-pushgateway`` directly. The -only requirement is to set ``TEMPEST_PROMETHEUS`` environment variable to point -towards your Prometheus Pushgateway. +tool is entirely configured using environment variables: + +- ``TEMPEST_PROMETHEUS`` (required): Prometheus Pushgateway address +- ``TEMPEST_HORIZON_URL``: URL for Horizon if ``python-tempestconf`` fails to + detect it. diff --git a/tempest_pushgateway/__init__.py b/tempest_pushgateway/__init__.py index 77038bc..8ab9b14 100644 --- a/tempest_pushgateway/__init__.py +++ b/tempest_pushgateway/__init__.py @@ -97,11 +97,21 @@ def main(): tempest_conf = tempfile.NamedTemporaryFile(mode='w+') accounts_file = tempfile.NamedTemporaryFile(mode='w+') + overrides = [ + ('validation', 'connect_method', 'fixed'), + ] + + if os.getenv('TEMPEST_HORIZON_URL'): + url = os.getenv('TEMPEST_HORIZON_URL') + overrides.append(('service_available', 'horizon', 'True')) + overrides.append(('dashboard', 'dashboard_url', url)) + overrides.append(('dashboard', 'login_url', url + '/auth/login/')) + cloud_creds = tempestconf.get_cloud_creds(args) tempestconf.config_tempest( cloud_creds=cloud_creds, convert_to_raw=True, create_accounts_file=accounts_file.name, debug=True, non_admin=True, - out=tempest_conf.name, remove=[ + out=tempest_conf.name, overrides=overrides, remove=[ 'network.floating_network_name' ] ) diff --git a/tox.ini b/tox.ini index 7641909..c3a8aa9 100644 --- a/tox.ini +++ b/tox.ini @@ -2,6 +2,7 @@ usedevelop = True passenv = OS_* + TEMPEST_* deps = -rtest-requirements.txt -rrequirements.txt