tempest does not read the configuration file passed through '--config-file' option

Bug #1783751 reported by Vikram K S on 2018-07-26
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Masayuki Igawa

Bug Description

Tempest Version: tempest 17.2.0

tempest does not read the configuration file i.e. tempest.conf file passed through '--config-file' option. It simply skips and takes the configuration from default /etc/tempest.conf

Reproduction steps:
Move a working etc/tempest.conf to etc/custom_tempest.conf in a tempest workspace.

$tempest run --config-file etc/custom_tempest.conf --regex object_storage

which gives the following error:

Captured traceback:
    Traceback (most recent call last):
      File "/usr/lib/python2.7/site-packages/tempest/test.py", line 172, in setUpClass
        six.reraise(etype, value, trace)
      File "/usr/lib/python2.7/site-packages/tempest/test.py", line 157, in setUpClass
      File "/usr/lib/python2.7/site-packages/tempest/api/object_storage/base.py", line 73, in setup_credentials
        super(BaseObjectTest, cls).setup_credentials()
      File "/usr/lib/python2.7/site-packages/tempest/test.py", line 401, in setup_credentials
      File "/usr/lib/python2.7/site-packages/tempest/test.py", line 658, in get_client_manager
        cred_provider = cls._get_credentials_provider()
      File "/usr/lib/python2.7/site-packages/tempest/test.py", line 636, in _get_credentials_provider
      File "/usr/lib/python2.7/site-packages/tempest/common/credentials_factory.py", line 141, in get_credentials_provider
      File "/usr/lib/python2.7/site-packages/tempest/common/credentials_factory.py", line 73, in get_dynamic_provider_params
        fill_in=True, identity_version=identity_version)
      File "/usr/lib/python2.7/site-packages/tempest/common/credentials_factory.py", line 254, in get_configured_admin_credentials
        identity_version=identity_version, **params)
      File "/usr/lib/python2.7/site-packages/tempest/common/credentials_factory.py", line 298, in get_credentials
      File "/usr/lib/python2.7/site-packages/tempest/lib/auth.py", line 647, in get_credentials
        http_timeout=http_timeout, proxy_url=proxy_url)
      File "/usr/lib/python2.7/site-packages/tempest/lib/auth.py", line 265, in __init__
        super(KeystoneAuthProvider, self).__init__(credentials, scope)
      File "/usr/lib/python2.7/site-packages/tempest/lib/auth.py", line 93, in __init__
        raise exceptions.InvalidCredentials(message)
    tempest.lib.exceptions.InvalidCredentials: Invalid Credentials
    Details: Credentials are: {'username': None, 'project_name': None, 'project_domain_id': None, 'user_domain_id': None, 'tenant_id': None, 'user_domain_name': None, 'domain_name': None, 'tenant_name': None, 'user_id': None, 'project_id': None, 'domain_id': None, 'project_domain_name': None} Password is not defined.

Changed in tempest:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Manik Bindlish (manikbindlish19)

Fix proposed to branch: master
Review: https://review.openstack.org/586448

Changed in tempest:
assignee: Manik Bindlish (manikbindlish19) → Masayuki Igawa (igawa)
status: Confirmed → In Progress
Masayuki Igawa (igawa) wrote :

@Manik, I apologize I missed you're already assigned. So, feel free to take over this or upload your patch.

Reviewed: https://review.openstack.org/586448
Committed: https://git.openstack.org/cgit/openstack/tempest/commit/?id=79159f80a9c0fec65637d498079e1b8958df8fb7
Submitter: Zuul
Branch: master

commit 79159f80a9c0fec65637d498079e1b8958df8fb7
Author: Masayuki Igawa <email address hidden>
Date: Fri Jul 27 15:00:37 2018 +0900

    Fix to enable `--config-file` option

    This commit sets the `--config-file` path to the environment variables
    `TEMPEST_CONFIG_DIR` and `TEMPEST_CONFIG` to enable the option as a
    The `path` is passed to `set_config_path()` however, the running test
    process is a child process which is a different instance.

    Change-Id: I8a65ee0f82e41f9659b3f40e2685c0ee0f290342
    Related-Bug: #1783751

Reviewed: https://review.openstack.org/586950
Committed: https://git.openstack.org/cgit/openstack/tempest/commit/?id=321c85c87cf7cd7ac3c94c35c18ced71d6008c67
Submitter: Zuul
Branch: master

commit 321c85c87cf7cd7ac3c94c35c18ced71d6008c67
Author: Manik Bindlish <email address hidden>
Date: Mon Jul 30 06:48:24 2018 +0000

    Adding unit test of setting config path for "tempest run"

    It will check the positive and negative case for sending data
    and sending no data to ensure path variable is set properly.

    Partially-Implements: blueprint tempest-cli-unit-test-coverage

    Related-Bug: #1783751
    Change-Id: I996ec912ed39ecc3c3ca293c257126b910b3e958

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers