summaryrefslogtreecommitdiffstats
path: root/nova/test.py
diff options
context:
space:
mode:
authorVishvananda Ishaya <vishvananda@gmail.com>2011-02-23 01:13:41 -0800
committerVishvananda Ishaya <vishvananda@gmail.com>2011-02-23 01:13:41 -0800
commit2bec58e35ab1f2df543e50d399433f76e98210d7 (patch)
tree04c395d982f88353646da2ce3e65c1c773b5adbd /nova/test.py
parent60ed7c9c52306d08b1ad3e759e173931b0a495a8 (diff)
downloadnova-2bec58e35ab1f2df543e50d399433f76e98210d7.tar.gz
nova-2bec58e35ab1f2df543e50d399433f76e98210d7.tar.xz
nova-2bec58e35ab1f2df543e50d399433f76e98210d7.zip
move db creation into fixtures and clean db for each test
Diffstat (limited to 'nova/test.py')
-rw-r--r--nova/test.py17
1 files changed, 2 insertions, 15 deletions
diff --git a/nova/test.py b/nova/test.py
index bff43b6c7..42accffa7 100644
--- a/nova/test.py
+++ b/nova/test.py
@@ -26,15 +26,14 @@ import datetime
import unittest
import mox
+import shutil
import stubout
from nova import context
from nova import db
from nova import fakerabbit
from nova import flags
-from nova import log as logging
from nova import rpc
-from nova.network import manager as network_manager
FLAGS = flags.FLAGS
@@ -64,15 +63,7 @@ class TestCase(unittest.TestCase):
# now that we have some required db setup for the system
# to work properly.
self.start = datetime.datetime.utcnow()
- ctxt = context.get_admin_context()
- if db.network_count(ctxt) != 5:
- network_manager.VlanManager().create_networks(ctxt,
- FLAGS.fixed_range,
- 5, 16,
- FLAGS.fixed_range_v6,
- FLAGS.vlan_start,
- FLAGS.vpn_start,
- )
+ shutil.copyfile("clean.sqlite", "tests.sqlite")
# emulate some of the mox stuff, we can't use the metaclass
# because it screws with our generators
@@ -93,9 +84,6 @@ class TestCase(unittest.TestCase):
self.mox.VerifyAll()
# NOTE(vish): Clean up any ips associated during the test.
ctxt = context.get_admin_context()
- db.fixed_ip_disassociate_all_by_timeout(ctxt, FLAGS.host,
- self.start)
- db.network_disassociate_all(ctxt)
rpc.Consumer.attach_to_eventlet = self.originalAttach
for x in self.injected:
try:
@@ -106,7 +94,6 @@ class TestCase(unittest.TestCase):
if FLAGS.fake_rabbit:
fakerabbit.reset_all()
- db.security_group_destroy_all(ctxt)
super(TestCase, self).tearDown()
finally:
self.reset_flags()