refstack-client doesn't recognize primary credential properly when using 'project_name' to set project name

Bug #1791017 reported by xinliang on 2018-09-06
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
refstack
Undecided
Unassigned

Bug Description

accounts.yaml:
- username: 'test'
  project_name: 'test'
  password: 'choose-a-password'

- password: 'a_big_secret'
  project_name: 'swift-test1'
  username: 'swiftop-01'
  roles:
    - '_member_'

The test credential has create private network and router connect to external network.
It should be the primary credential for running non-swift tests.

And swift-test1 credential is for running swift tests, which without any network setting.

$ refstack-client test -c tempest.conf -v -- --regex tempest.api.compute.servers.test_create_server.ServersTestJSON
2018-09-06 14:55:15,667 refstack_client:320 WARNING Problems retrieving CPID from Keystone using v3 endpoint (http://192.168.12.5:5000/v3/auth/tokens) with error (Invalid request with error code: 400. Error message: Invalid input for field
 'scope/project/name': None is not of type 'string'

Failed validating 'type' in schema['properties']['scope']['properties']['project']['properties']['name']:
    {'type': 'string'}

On instance['scope']['project']['name']:
    None)
2018-09-06 14:55:15,668 refstack_client:326 INFO Creating hash from endpoint to use as CPID.
2018-09-06 14:55:15,668 refstack_client:494 INFO Starting Tempest test...
running=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-500} \
OS_TEST_LOCK_PATH=${OS_TEST_LOCK_PATH:-${TMPDIR:-'/tmp'}} \
${PYTHON:-python} -m subunit.run discover -t ${OS_TOP_LEVEL:-./} ${OS_TEST_PATH:-./tempest/test_discover} --list
running=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-500} \
OS_TEST_LOCK_PATH=${OS_TEST_LOCK_PATH:-${TMPDIR:-'/tmp'}} \
${PYTHON:-python} -m subunit.run discover -t ${OS_TOP_LEVEL:-./} ${OS_TEST_PATH:-./tempest/test_discover} --load-list /tmp/tmpr5omC8
{0} setUpClass (tempest.api.compute.servers.test_create_server.ServersTestJSON) [0.000000s] ... FAILED

==============================
Failed 1 tests - output below:
==============================

setUpClass (tempest.api.compute.servers.test_create_server.ServersTestJSON)
---------------------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
Traceback (most recent call last):
      File "/home/cloudadmin/test/refstack-client/.tempest/tempest/test.py", line 172, in setUpClass
        six.reraise(etype, value, trace)
      File "/home/cloudadmin/test/refstack-client/.tempest/tempest/test.py", line 165, in setUpClass
        cls.resource_setup()
      File "/home/cloudadmin/test/refstack-client/.tempest/tempest/api/compute/servers/test_create_server.py", line 64, in resource_setup
        volume_backed=cls.volume_backed)
      File "/home/cloudadmin/test/refstack-client/.tempest/tempest/api/compute/base.py", line 190, in create_test_server
        **kwargs)
      File "/home/cloudadmin/test/refstack-client/.tempest/tempest/common/compute.py", line 258, in create_test_server
        server['id'])
      File "/home/cloudadmin/test/refstack-client/.tempest/.venv/local/lib/python2.7/site-packages/oslo_utils/excutils.py", line 220, in __exit__
        self.force_reraise()
      File "/home/cloudadmin/test/refstack-client/.tempest/.venv/local/lib/python2.7/site-packages/oslo_utils/excutils.py", line 196, in force_reraise
        six.reraise(self.type_, self.value, self.tb)
      File "/home/cloudadmin/test/refstack-client/.tempest/tempest/common/compute.py", line 235, in create_test_server
        _setup_validation_fip()
      File "/home/cloudadmin/test/refstack-client/.tempest/tempest/common/compute.py", line 214, in _setup_validation_fip
        raise ValueError('Unable to setup floating IP for validation: '
    ValueError: Unable to setup floating IP for validation: port not found on tenant network

======
Totals
======
Ran: 1 tests in 19.0000 sec.
 - Passed: 0
 - Skipped: 0
 - Expected Fail: 0
 - Unexpected Success: 0
 - Failed: 1
Sum of execute time for each test: 0.0000 sec.

It is failed because it use swift-test1 credential, which without any network setting, to run the test not test credential. Compute test use primary credential to run test which means refstack-client doesn't recognize test as the primary credential.

When changing accounts.yaml using tenant_name, the compute test can pass.
- username: 'test'
  tenant_name: 'test'
  password: 'choose-a-password'

- password: 'a_big_secret'
  tenant_name: 'swift-test1'
  username: 'swiftop-01'
  roles:
    - '_member_'

$ refstack-client test -c tempest.conf -v -- --regex tempest.api.compute.servers.test_create_server.ServersTestJSON
2018-09-06 15:04:36,868 refstack_client:494 INFO Starting Tempest test...
running=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-500} \
OS_TEST_LOCK_PATH=${OS_TEST_LOCK_PATH:-${TMPDIR:-'/tmp'}} \
${PYTHON:-python} -m subunit.run discover -t ${OS_TOP_LEVEL:-./} ${OS_TEST_PATH:-./tempest/test_discover} --list
running=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-500} \
OS_TEST_LOCK_PATH=${OS_TEST_LOCK_PATH:-${TMPDIR:-'/tmp'}} \
${PYTHON:-python} -m subunit.run discover -t ${OS_TOP_LEVEL:-./} ${OS_TEST_PATH:-./tempest/test_discover} --load-list /tmp/tmpFr7DlP
{0} tempest.api.compute.servers.test_create_server.ServersTestJSON.test_host_name_is_same_as_server_name [16.294031s] ... ok
{0} tempest.api.compute.servers.test_create_server.ServersTestJSON.test_list_servers [0.424345s] ... ok
{0} tempest.api.compute.servers.test_create_server.ServersTestJSON.test_list_servers_with_detail [0.393961s] ... ok
{0} tempest.api.compute.servers.test_create_server.ServersTestJSON.test_verify_created_server_vcpus [0.204041s] ... ok
{0} tempest.api.compute.servers.test_create_server.ServersTestJSON.test_verify_server_details [0.000896s] ... ok

======
Totals
======
Ran: 5 tests in 54.0000 sec.
 - Passed: 5
 - Skipped: 0
 - Expected Fail: 0
 - Unexpected Success: 0
 - Failed: 0
Sum of execute time for each test: 17.3173 sec.

tempest.conf: http://paste.openstack.org/show/729583/
tempest.log: see attached

xinliang (xin3liang) wrote :
xinliang (xin3liang) wrote :

Credential without any roles/types setting should be recognize as primary, right?

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

Other bug subscribers

Bug attachments