unit test fails after ./stack.sh

Bug #1777399 reported by Tetsuro Nakamura
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Blazar
Fix Released
Low
Unassigned

Bug Description

After installing aio OpenStack with Blazar using devstack,
tox -e py27 fails.

hoge@fuga:/opt/stack/blazar$ tox -e py27

-- snip --

FAIL: utils.test_trusts.TestTrusts.test_create_ctx_from_trust
tags: worker-0
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/stack/blazar/blazar/tests/utils/test_trusts.py", line 63, in test_create_ctx_from_trust
    self.assertEqual(fake_ctx_dict, ctx.__dict__)
  File "/opt/stack/blazar/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 411, in assertEqual
    self.assertThat(observed, matcher, message)
  File "/opt/stack/blazar/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 498, in assertThat
    raise mismatch_error
testtools.matchers._impl.MismatchError: !=:
reference = {'_BaseContext__values': {'auth_token': <MagicMock name='BlazarKeystoneClient().auth_token' id='139720682473680'>,
                          'project_id': <MagicMock name='BlazarKeystoneClient().tenant_id' id='139720566276752'>,
                          'project_name': 'admin',
                          'service_catalog': <MagicMock name='BlazarKeystoneClient().service_catalog.catalog.__getitem__()' id='139720564983056'>,
                          'user_name': 'admin'}}
actual = {'_BaseContext__values': {'auth_token': <MagicMock name='BlazarKeystoneClient().auth_token' id='139720682473680'>,
                          'project_id': <MagicMock name='BlazarKeystoneClient().tenant_id' id='139720566276752'>,
                          'project_name': 'service',
                          'service_catalog': <MagicMock name='BlazarKeystoneClient().service_catalog.catalog.__getitem__()' id='139720564983056'>,
                          'user_name': 'blazar'}}
Ran 483 tests in 22.167s (-3.541s)
FAILED (id=7, failures=1 (+1), skips=4)
error: testr failed (1)
ERROR: InvocationError for command '/opt/stack/blazar/.tox/py27/bin/lockutils-wrapper python setup.py testr --slowest --testr-args=' (exited with code 1)
___________________________________________________________________________________________________________________________ summary ___________________________________________________________________________________________________________________________
ERROR: py27: commands failed

hoge@fuga:/opt/stack/blazar$ cat /etc/blazar/blazar.conf

[DEFAULT]
rpc_backend = rabbit
transport_url = rabbit://stackrabbit:stack@127.0.0.1:5672/
use_syslog = False
debug = True
host = 127.0.0.1
os_region_name = RegionOne
identity_service = identity
os_admin_project_name = service
os_admin_username = blazar
os_admin_password = hogehoge
os_auth_prefix = identity
os_auth_port = 80
os_auth_host = 127.0.0.1
os_auth_version = v3

[keystone_authtoken]
memcached_servers = localhost:11211
cafile = /opt/stack/data/ca-bundle.pem
project_domain_name = Default
project_name = service
user_domain_name = Default
password = hogehoge
username = blazar
auth_url = http://127.0.0.1/identity
auth_type = password
signing_dir = /var/cache/blazar

[physical:host]
aggregate_freepool_name = freepool

[manager]
plugins = physical.host.plugin,virtual.instance.plugin

[api]
api_v2_controllers = oshosts,leases

[database]
connection = mysql+pymysql://root:stack@127.0.0.1/blazar?charset=utf8

description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to blazar (master)

Reviewed: https://review.openstack.org/576035
Committed: https://git.openstack.org/cgit/openstack/blazar/commit/?id=36259acf75e3308ead70c7cfcdbd5034a7d25b09
Submitter: Zuul
Branch: master

commit 36259acf75e3308ead70c7cfcdbd5034a7d25b09
Author: Tetsuro Nakamura <email address hidden>
Date: Mon Jun 18 15:04:13 2018 +0900

    Use parameters in config file for trust test

    ``create_ctx_from_trust`` creates a context using project_id
    and user_id that are set to blazar configuration file, but
    the test is fixed to use "admin", which can cause unpredictable
    unit test error on developer's local environment.

    This patch fixes the problem.

    Change-Id: Ied2451d8821dc0ac3f59fe838efec01453839909
    Closes-Bug: #1777399

Changed in blazar:
status: New → Fix Released
Changed in blazar:
milestone: none → rocky-3
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/blazar 2.0.0.0b3

This issue was fixed in the openstack/blazar 2.0.0.0b3 development milestone.

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.