diff options
| author | Jason Kölker <jason@koelker.net> | 2011-05-23 18:20:18 -0500 |
|---|---|---|
| committer | Jason Kölker <jason@koelker.net> | 2011-05-23 18:20:18 -0500 |
| commit | 65091eb4b9718c35fdcb3d3d070dffcc4fb820a3 (patch) | |
| tree | f706fd53c5e608fdeba69e1e51d7d3c307af3c48 /nova/tests | |
| parent | a4c648a190e3f93b95aaa694f263125147f95633 (diff) | |
uhhh yea
Diffstat (limited to 'nova/tests')
| -rw-r--r-- | nova/tests/test_cloud.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/nova/tests/test_cloud.py b/nova/tests/test_cloud.py index c45bdd12c..3c29a1178 100644 --- a/nova/tests/test_cloud.py +++ b/nova/tests/test_cloud.py @@ -70,7 +70,7 @@ class CloudTestCase(test.TestCase): self.project = self.manager.create_project('proj', 'admin', 'proj') self.context = context.RequestContext(user=self.user, project=self.project) - host = self.network.get_network_host(self.context.elevated()) + host = self.network.host def fake_show(meh, context, id): return {'id': 1, 'properties': {'kernel_id': 1, 'ramdisk_id': 1, @@ -80,9 +80,9 @@ class CloudTestCase(test.TestCase): self.stubs.Set(local.LocalImageService, 'show_by_name', fake_show) def tearDown(self): - network_ref = db.project_get_network(self.context, - self.project.id) - db.network_disassociate(self.context, network_ref['id']) + networks = db.project_get_networks(self.context, self.project.id) + for network in networks: + db.network_disassociate(self.context, network['id']) self.manager.delete_project(self.project) self.manager.delete_user(self.user) self.compute.kill() @@ -124,7 +124,12 @@ class CloudTestCase(test.TestCase): 'host': self.network.host}) self.cloud.allocate_address(self.context) inst = db.instance_create(self.context, {'host': self.compute.host}) - fixed = self.network.allocate_fixed_ip(self.context, inst['id']) + networks = db.network_get_all(self.context) + print networks + print self.network.allocate_for_instance(self.context, inst) + + fixed = self.network.allocate_fixed_ip(self.context, inst, + networks[0]) ec2_id = ec2utils.id_to_ec2_id(inst['id']) self.cloud.associate_address(self.context, instance_id=ec2_id, |
