Container validator unit tests fail for non localhost host_href

Bug #1505315 reported by Elvin Tubillara
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Barbican
Fix Released
Medium
Elvin Tubillara

Bug Description

The following unit tests fail when host_href in /etc/barbican.conf is not set to 'localhost:9311':

FAIL:barbican.tests.api.controllers.test_containers.WhenCreatingContainersUsingContainersResource.test_should_throw_exception_when_secret_ref_doesnt_exist
FAIL: barbican.tests.common.test_validators.WhenTestingContainerValidator.test_should_validate_all_fields
FAIL: barbican.tests.common.test_validators.WhenTestingContainerValidator.test_should_validate_empty_name
FAIL: barbican.tests.common.test_validators.WhenTestingContainerValidator.test_should_validate_no_name

This problem appears when devstack is setup on virtualbox and the following appears in /etc/barbican.conf:
host_href = http://10.0.2.15:9311

A quick hack is to change the host_href to 'localhost:9311' and run the tests again. But I think the tests should be changed themselves to accommodate the host_href variable.

summary: - Certificate validator tests fail for non localhost host_href
+ Certificate validator unit tests fail for non localhost host_href
summary: - Certificate validator unit tests fail for non localhost host_href
+ Container validator unit tests fail for non localhost host_href
description: updated
Changed in barbican:
assignee: nobody → Elvin Tubillara (edtubill)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to barbican (master)

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

Changed in barbican:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to barbican (master)

Reviewed: https://review.openstack.org/234398
Committed: https://git.openstack.org/cgit/openstack/barbican/commit/?id=526e7bd05f078db08fc87ab7ace8efc728384e6c
Submitter: Jenkins
Branch: master

commit 526e7bd05f078db08fc87ab7ace8efc728384e6c
Author: edtubill <email address hidden>
Date: Tue Oct 13 11:44:10 2015 -0500

    Change unit tests in test_utils.py and test_contaiers.py to use CONF.set_override

    On some machines that have devstack installed, the host_href variable
    inside /etc/barbican.conf is set to a non 'http://localhost' value
    (http://10.0.2.15 for virtualbox). When test_utils.py sets the host_href
    variable, it causes other tests to fail because it causes set_override
    to not work. When test_validators overrides the host_href variable it gets
    back the CONF variable (non localhost value) instead of
    the override. To fix this problem, test_utils.py should
    also use set_override and use clear_override. The tests inside
    test_containers are also missing the set_override and clear_override.

    Change-Id: Icb24737ad1cda097803fe30a5a000f8591f183f4
    Closes-bug: #1505315

Changed in barbican:
status: In Progress → Fix Committed
Changed in barbican:
status: Fix Committed → Fix Released
Changed in barbican:
milestone: none → mitaka-1
importance: Undecided → Medium
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.