Skip to content

Commit

Permalink
Plugin aware extensions should also be reset at each test setup
Browse files Browse the repository at this point in the history
PluginAwareExtensionManager caches extension according plugin.
At each db plugin test setup, testing plugin and router are newly
created.
However, the extension manager held the extensions for first time
loaded plugin. Because of their cache.

So if a plugin conditional extension exists, it could not be loaded by
testing order.

Fixes bug 1043381.

Change-Id: Ic994aab61c3d67aa9d422594484049f41ff8b321
  • Loading branch information
Yusuke Muraoka committed Aug 28, 2012
1 parent 8fb4e6e commit 19e553e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions quantum/tests/unit/test_db_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
from quantum.db import api as db
from quantum.db import db_base_plugin_v2
from quantum.db import models_v2
from quantum.extensions.extensions import PluginAwareExtensionManager
from quantum.manager import QuantumManager
from quantum.openstack.common import cfg
from quantum.openstack.common import timeutils
Expand Down Expand Up @@ -63,6 +64,8 @@ def setUp(self, plugin=None):
db._MAKER = None
# Make sure at each test a new instance of the plugin is returned
QuantumManager._instance = None
# Make sure at each test according extensions for the plugin is loaded
PluginAwareExtensionManager._instance = None
# Save the attributes map in case the plugin will alter it
# loading extensions
# Note(salvatore-orlando): shallow copy is not good enough in
Expand Down

0 comments on commit 19e553e

Please sign in to comment.