summaryrefslogtreecommitdiffstats
path: root/nova/test.py
diff options
context:
space:
mode:
authorSergey Skripnick <sskripnick@mirantis.com>2013-05-18 14:07:03 +0300
committerSergey Skripnick <sskripnick@mirantis.com>2013-05-24 09:57:00 +0300
commit2b92ca1de7ad10d2777ac44b95da55467cca7a21 (patch)
treee47fef2516cc76dbe75becee66dc9ad666b6211a /nova/test.py
parent6994e19b68785539a4ea6522a7e898ee6d8b09d6 (diff)
downloadnova-2b92ca1de7ad10d2777ac44b95da55467cca7a21.tar.gz
nova-2b92ca1de7ad10d2777ac44b95da55467cca7a21.tar.xz
nova-2b92ca1de7ad10d2777ac44b95da55467cca7a21.zip
Moved sample network creation out of unittest base class constructor.
This sample networks only needed in: nova.tests.api.ec2.test_cloud nova.tests.integrated.test_api_samples nova.tests.network.test_manager nova.tests.test_libvirt nova.tests.test_xenapi Moreover, base class constructor is not good place for sample data creation. Database should be empty before runing tests. Fixes: bug 1181502 Change-Id: I8dcaa5b36a1da0c0928c9445c556d788d463844e
Diffstat (limited to 'nova/test.py')
-rw-r--r--nova/test.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/nova/test.py b/nova/test.py
index 6dad0784a..9a6874007 100644
--- a/nova/test.py
+++ b/nova/test.py
@@ -87,7 +87,6 @@ class Database(fixtures.Fixture):
if os.path.exists(testdb):
return
db_migrate.db_sync()
- self.post_migrations()
if sql_connection == "sqlite://":
conn = self.engine.connect()
self._DB = "".join(line for line in conn.connection.iterdump())
@@ -107,8 +106,13 @@ class Database(fixtures.Fixture):
shutil.copyfile(paths.state_path_rel(self.sqlite_clean_db),
paths.state_path_rel(self.sqlite_db))
- def post_migrations(self):
- """Any addition steps that are needed outside of the migrations."""
+
+class SampleNetworks(fixtures.Fixture):
+
+ """Create sample networks in the database."""
+
+ def setUp(self):
+ super(SampleNetworks, self).setUp()
ctxt = context.get_admin_context()
network = network_manager.VlanManager()
bridge_interface = CONF.flat_interface or CONF.vlan_interface