diff options
author | Vishvananda Ishaya <vishvananda@yahoo.com> | 2010-09-28 10:34:32 -0700 |
---|---|---|
committer | Vishvananda Ishaya <vishvananda@yahoo.com> | 2010-09-28 10:34:32 -0700 |
commit | e4cb0d3a93ddc4cae40c4a8c570c7e7d2a0061ff (patch) | |
tree | 42b766585af28a25233fc3c2347b595fe0863aa8 /nova/test.py | |
parent | 9febbe9188ac1e0019d362d34331f32b5f295037 (diff) | |
download | nova-e4cb0d3a93ddc4cae40c4a8c570c7e7d2a0061ff.tar.gz nova-e4cb0d3a93ddc4cae40c4a8c570c7e7d2a0061ff.tar.xz nova-e4cb0d3a93ddc4cae40c4a8c570c7e7d2a0061ff.zip |
get rid of network indexes and make networks into a pool
Diffstat (limited to 'nova/test.py')
-rw-r--r-- | nova/test.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/nova/test.py b/nova/test.py index c392c8a84..a491c2902 100644 --- a/nova/test.py +++ b/nova/test.py @@ -31,8 +31,10 @@ from tornado import ioloop from twisted.internet import defer from twisted.trial import unittest +from nova import db from nova import fakerabbit from nova import flags +from nova.network import manager as network_manager FLAGS = flags.FLAGS @@ -56,6 +58,13 @@ class TrialTestCase(unittest.TestCase): def setUp(self): # pylint: disable-msg=C0103 """Run before each test method to initialize test environment""" super(TrialTestCase, self).setUp() + # NOTE(vish): We need a better method for creating fixtures for tests + # now that we have some required db setup for the system + # to work properly. + if db.network_count(None) != 5: + network_manager.VlanManager().create_networks(None, 5, 16, + FLAGS.vlan_start, + FLAGS.vpn_start) # emulate some of the mox stuff, we can't use the metaclass # because it screws with our generators @@ -71,6 +80,7 @@ class TrialTestCase(unittest.TestCase): self.stubs.UnsetAll() self.stubs.SmartUnsetAll() self.mox.VerifyAll() + db.network_disassociate_all(None) if FLAGS.fake_rabbit: fakerabbit.reset_all() |