Config Params Conflict: test_build_agent_config unit test failure

Bug #1548628 reported by Franklin Naval
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
octavia
Fix Released
High
Franklin Naval

Bug Description

Result:
test_build_agent_config is failing because 'debug' is already being set in Tempest as an object.

Expected:
CONF.debug should be set as part of a configuration group, ex: CONF.health_manager.debug

More Info:

see: https://github.com/openstack/octavia/blob/master/octavia/amphorae/backends/agent/agent_jinja_cfg.py#L54

unit test: https://github.com/openstack/octavia/blob/master/octavia/tests/unit/amphorae/backends/agent/test_agent_jinja_cfg.py#L58

tempest log:
======================================================================
FAIL: octavia.tests.unit.amphorae.backends.agent.test_agent_jinja_cfg.AgentJinjaTestCase.test_build_agent_config
tags: worker-6
----------------------------------------------------------------------
Traceback (most recent call last):
  File "octavia/tests/unit/amphorae/backends/agent/test_agent_jinja_cfg.py", line 81, in test_build_agent_config
    self.assertEqual(expected_config, agent_cfg)
  File "/opt/stack/octavia/.tox/cover/local/lib/python2.7/site-packages/testtools/testcase.py", line 362, in assertEqual
    self.assertThat(observed, matcher, message)
  File "/opt/stack/octavia/.tox/cover/local/lib/python2.7/site-packages/testtools/testcase.py", line 447, in assertThat
    raise mismatch_error
testtools.matchers._impl.MismatchError: !=:
reference = '''\

[DEFAULT]
debug = False

[haproxy_amphora]
base_cert_dir = /var/lib/octavia/certs
base_path = /var/lib/octavia
bind_host = 0.0.0.0
bind_port = 9443
haproxy_cmd = /usr/sbin/haproxy
respawn_count = 2
respawn_interval = 2
use_upstart = True

[health_manager]
controller_ip_port_list = 192.0.2.10:5555
heartbeat_interval = 10
heartbeat_key = TEST

[amphora_agent]
agent_server_ca = /etc/octavia/certs/client_ca.pem
agent_server_cert = /etc/octavia/certs/server.pem
agent_server_network_dir = /etc/network/interfaces.d/
amphora_id = 453e7d80-71b3-4389-8f7a-d0b5d63b0032'''
actual = u'''\

[DEFAULT]
debug = <oslo_config.cfg.GroupAttr object at 0x7f2b0fdcd150>

[haproxy_amphora]
base_cert_dir = /var/lib/octavia/certs
base_path = /var/lib/octavia
bind_host = 0.0.0.0
bind_port = 9443
haproxy_cmd = /usr/sbin/haproxy
respawn_count = 2
respawn_interval = 2
use_upstart = True

[health_manager]
controller_ip_port_list = 192.0.2.10:5555
heartbeat_interval = 10
heartbeat_key = TEST

[amphora_agent]
agent_server_ca = /etc/octavia/certs/client_ca.pem
agent_server_cert = /etc/octavia/certs/server.pem
agent_server_network_dir = /etc/network/interfaces.d/
amphora_id = 453e7d80-71b3-4389-8f7a-d0b5d63b0032'''

Revision history for this message
Franklin Naval (franknaval) wrote :

This bug is blocking Scenario and API tests from running since it hits in the Sonar gate job, invoked by tox -ecover

Revision history for this message
Phillip Toohill (phillip-toohill) wrote :

Could you link the tempest config thats actually causing the issue. This is because tempest is setting a funky value for a very very common attribute. Why is tempest changing its functionality, what service needs it? We dont, this shouldnt affect us.

Changed in octavia:
importance: Undecided → High
Revision history for this message
Franklin Naval (franknaval) wrote :

The fix for this was to declare the OS_TEST_PATH in .testr.config as follows:
test_command=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 OS_LOG_CAPTURE=1 ${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./octavia/tests/unit} $LISTOPT $IDOPTION

Changed in octavia:
assignee: nobody → Franklin Naval (franknaval)
status: New → Fix Committed
Changed in octavia:
status: Fix Committed → Fix Released
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.