Fix swift functional test "test_create_store"

Bug #1292170 reported by Stuart McLaren
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Medium
Zhi Yan Liu

Bug Description

Running this test:

GLANCE_TEST_SWIFT_CONF=/etc/glance/glance-api.conf ./run_tests.sh glance.tests.functional.store.test_swift.TestSwiftStore.test_create_store

gives this failure

======================================================================
FAIL: glance.tests.functional.store.test_swift.TestSwiftStore.test_create_store
----------------------------------------------------------------------
Traceback (most recent call last):
_StringException: Traceback (most recent call last):
  File "glance/tests/functional/store/__init__.py", line 75, in test_create_store
    self.assertEqual(count, 7)
  File "/home/ubuntu/git/glance/.venv/local/lib/python2.7/site-packages/testtools/testcase.py", line 321, in assertEqual
    self.assertThat(observed, matcher, message)
  File "/home/ubuntu/git/glance/.venv/local/lib/python2.7/site-packages/testtools/testcase.py", line 406, in assertThat
    raise mismatch_error
MismatchError: 6 != 7

Ran 2 tests in 7.188s

Revision history for this message
Stuart McLaren (stuart-mclaren) wrote :

in create_stores glance.store.swift.Store is a known store which seems to be already registered:

glance.store.swift.Store
Store <function Store at 0x3b480c8> already registered

so the six stores registered are:

glance.store.rbd.Store
glance.store.s3.Store
glance.store.sheepdog.Store
glance.store.cinder.Store
glance.store.gridfs.Store
glance.store.vmware_datastore.Store

Revision history for this message
Arnaud Legendre (arnaudleg) wrote :

Stuart -- Could you share the values that you have for known_stores and default_store in your glance-api.conf?
I have not been able to reproduce the same behavior with the latest version of the trunk.

Revision history for this message
Stuart McLaren (stuart-mclaren) wrote :

Hi Arnaud,

Thanks for looking into this.

I'm running devstack with the following localrc:

ADMIN_PASSWORD=xxx
MYSQL_PASSWORD=xxx
RABBIT_PASSWORD=xxx
SERVICE_PASSWORD=xxx
SERVICE_TOKEN=xxx
FLAT_INTERFACE=br100
ENABLED_SERVICES=${ENABLED_SERVICES},swift,ceilometer-acompute,ceilometer-acentral,ceilometer-collector,ceilometer-api,s-proxy
SWIFT_HASH=xxx
HOST_IP=10.0.0.18

This generated the following glance-api.conf

https://region-a.geo-1.objects.hpcloudsvc.com/v1/61624292678963/public_tmp/glance-api.conf

Revision history for this message
Zhi Yan Liu (lzy-dev) wrote :

Hi Stuart,

Actually in you devstack environment, glance-api service is using default known_stores setting as following, so I'm sure the swift store is disabled since there are only filesystem and http two store drivers are enabled by default.

# List of which store classes and store class locations are
# currently known to glance at startup.
# Existing but disabled stores:
# glance.store.rbd.Store,
# glance.store.s3.Store,
# glance.store.swift.Store,
# glance.store.sheepdog.Store,
# glance.store.cinder.Store,
# glance.store.gridfs.Store,
# glance.store.vmware_datastore.Store,
#known_stores = glance.store.filesystem.Store,
# glance.store.http.Store

And according to your fix https://review.openstack.org/#/c/80373 , I think the key reason of why we could not reproduce it by default is that those swift related test cases are disabled by default, since there is not a valid swift backend be configured for testing which GLANCE_TEST_SWIFT_CONF presented. @Arnaud

Revision history for this message
Stuart McLaren (stuart-mclaren) wrote :

Hi Zhi,

"I'm sure the swift store is disabled"

My (possibly wrong) interpretation of this change:

commit b82e0b2c6fb1b34f7bf56b3cba8b7abc38022b8c
Author: Flavio Percoco <email address hidden>
Date: Wed Mar 12 13:57:02 2014 +0100

    Provide an upgrade period for enabling stores

is that stores are configured automagically when their settings are present even if
they are not present in known_stores.

Revision history for this message
Zhi Yan Liu (lzy-dev) wrote :

Hi Stuart

Oh it got merged, hm forward and revert so fast :( Sorry. Actually I'm afraid that I think it will break the test cases of other stores which under disabled status currently - those test cases need special environment variable to enable. This bug for swift testing should be a special case.

And I think the answer within the second part of my above last comments is still reasonable.

btw, I'm digging on this issue, and TBH Stuart I think your current fix approach (PS#3) is too straightforward that added the swift special code in glance/tests/functional/store/__init__.py common place. IMO it will be better if we fix this common issue in a common way.

Let me know if miss anything.

Revision history for this message
Zhi Yan Liu (lzy-dev) wrote :

An alternative solution for me: https://review.openstack.org/#/c/80674

Changed in glance:
status: New → In Progress
Revision history for this message
Arnaud Legendre (arnaudleg) wrote :

I have tested with other stores (s3 and vmware). Zhi's patch fixes tempest tests.

Changed in glance:
importance: Undecided → Medium
assignee: nobody → Zhi Yan Liu (lzy-dev)
tags: added: icehouse-rc-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/80674
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=4617f058c00523861f106376160442fe2ac1c39c
Submitter: Jenkins
Branch: master

commit 4617f058c00523861f106376160442fe2ac1c39c
Author: Zhi Yan Liu <email address hidden>
Date: Sat Mar 15 03:00:02 2014 +0800

    Fix swift functional test "test_create_store"

    Fix "test_create_store" when a real swift store is used
    via the GLANCE_TEST_SWIFT_CONF environment variable.

    Fixes bug: 1292170
    Change-Id: I500c1d0caee30449146b732b1105b20b7a0d5d05
    Signed-off-by: Zhi Yan Liu <email address hidden>

Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in glance:
milestone: none → icehouse-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in glance:
milestone: icehouse-rc1 → 2014.1
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.