test_alarm_redirect_keystone may fail with devstack

Bug #1497238 reported by ZhiQiang Fan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
Low
Rohit Jaiswal

Bug Description

I was testing code with devstack master for ceilometer minimum installation, devstack has configured (according to my local.conf) /etc/ceilometer/ceilometer.conf with [DEFAULT] dispatcher = gnocchi

Then when I tried to run tox -efunctional, the test_alarm_redirect_keystone failed:

     WARNING [ceilometer.api.controllers.v2.root] ceilometer-api started with aodh enabled. Alarms URLs will be redirected to aodh endpoint.
     WARNING [ceilometer.api.controllers.v2.root] ceilometer-api started with gnocchi enabled. The resources/meters/samples URLs are disabled.

    Traceback (most recent call last):
      File "ceilometer/tests/functional/api/v2/test_api_upgrade.py", line 115, in test_alarm_redirect_keystone
        self.ks.service_catalog.url_for.mock_calls)
      File "/opt/stack/ceilometer/.tox/functional/local/lib/python2.7/site-packages/testtools/testcase.py", line 350, in assertEqual
        self.assertThat(observed, matcher, message)
      File "/opt/stack/ceilometer/.tox/functional/local/lib/python2.7/site-packages/testtools/testcase.py", line 435, in assertThat
        raise mismatch_error
    testtools.matchers._impl.MismatchError: !=:
    reference = [call(service_type='alarming')]
    actual = [call(service_type='alarming'), call(service_type='metric')]

So I was bitten by /etc/ceilometer/ceilometer.conf AGAIN.

The minimum change is we override dispatcher option before that test is executed

ZhiQiang Fan (aji-zqfan)
Changed in ceilometer:
assignee: nobody → ZhiQiang Fan (aji-zqfan)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ceilometer (master)

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

Changed in ceilometer:
status: New → In Progress
Changed in ceilometer:
assignee: ZhiQiang Fan (aji-zqfan) → Rohit Jaiswal (rohit-jaiswal-3)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

Reviewed: https://review.openstack.org/225111
Committed: https://git.openstack.org/cgit/openstack/ceilometer/commit/?id=2efe1aaf602ea39264d64c6476cd338bdb0e0db2
Submitter: Jenkins
Branch: master

commit 2efe1aaf602ea39264d64c6476cd338bdb0e0db2
Author: ZhiQiang Fan <email address hidden>
Date: Fri Sep 18 04:23:17 2015 -0700

    Override dispatcher option for test_alarm_redirect_keystone

    test_alarm_redirect_keystone tests alarm requests are redirected
    properly, but dispatcher option is not overrided, so in devstack
    environment, the code execute route can ask Keystone for metric
    service, which will cause test fail.

    This patch overrides the dispatcher option with default value to
    make sure the test code running under expected configuration, which
    is useful especially when devstack is running in the same environment
    for developers.

    ref: https://github.com/openstack/ceilometer/blob/\
    1c6302854f54b67295d9f429ed092ca9766c363c/\
    ceilometer/api/controllers/v2/root.py#L112

    Change-Id: I3e141074744db43d4cd65957f6edbe2b825c0a97
    Closes-Bug: #1497238

Changed in ceilometer:
status: In Progress → Fix Committed
gordon chung (chungg)
Changed in ceilometer:
importance: Undecided → Low
milestone: none → liberty-rc1
Thierry Carrez (ttx)
Changed in ceilometer:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: liberty-rc1 → 5.0.0
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.