Merge "Remove unused and duplicate code"

This commit is contained in:
Jenkins
2013-09-17 21:18:56 +00:00
committed by Gerrit Code Review
2 changed files with 0 additions and 26 deletions

View File

@@ -1402,14 +1402,6 @@ class InstanceTestCase(test.TestCase, ModelsObjectComparatorMixin):
self.create_instance_with_args(context=context2, hostname='h2')
self.flags(osapi_compute_unique_server_name_scope=None)
def test_instance_get_all_with_meta(self):
inst = self.create_instance_with_args()
for inst in db.instance_get_all(self.ctxt):
meta = utils.metadata_to_dict(inst['metadata'])
self.assertEqual(meta, self.sample_data['metadata'])
sys_meta = utils.metadata_to_dict(inst['system_metadata'])
self.assertEqual(sys_meta, self.sample_data['system_metadata'])
def test_instance_get_all_by_filters_with_meta(self):
inst = self.create_instance_with_args()
for inst in db.instance_get_all_by_filters(self.ctxt, {}):
@@ -4576,12 +4568,6 @@ class NetworkTestCase(test.TestCase, ModelsObjectComparatorMixin):
network.id)
return network, instance
def test_network_in_use_on_host(self):
network, _ = self._get_associated_fixed_ip('host.net', '192.0.2.0/30',
'192.0.2.1')
self.assertTrue(db.network_in_use_on_host(self.ctxt, network.id,
'host.net'))
def test_network_get_associated_fixed_ips(self):
network, instance = self._get_associated_fixed_ip('host.net',
'192.0.2.0/30', '192.0.2.1')
@@ -4704,10 +4690,6 @@ class NetworkTestCase(test.TestCase, ModelsObjectComparatorMixin):
self._assertEqualListsOfObjects([net1, net2, net3],
db.network_get_all_by_host(self.ctxt, host))
def test_network_get_by_cidr_nonexistent(self):
self.assertRaises(exception.NetworkNotFoundForCidr,
db.network_get_by_cidr(self.ctxt, '192.0.2.0/29'))
def test_network_get_by_cidr(self):
cidr = '192.0.2.0/30'
cidr_v6 = '2001:db8:1::/64'

View File

@@ -2751,8 +2751,6 @@ class LibvirtConnTestCase(test.TestCase):
def test_check_can_live_migrate_dest_all_pass_with_block_migration(self):
instance_ref = db.instance_create(self.context, self.test_instance)
dest = "fake_host_2"
src = instance_ref['host']
conn = libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), False)
compute_info = {'disk_available_least': 400,
'cpu_info': 'asdf',
@@ -2779,8 +2777,6 @@ class LibvirtConnTestCase(test.TestCase):
def test_check_can_live_migrate_dest_all_pass_no_block_migration(self):
instance_ref = db.instance_create(self.context, self.test_instance)
dest = "fake_host_2"
src = instance_ref['host']
conn = libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), False)
compute_info = {'cpu_info': 'asdf'}
filename = "file"
@@ -2805,8 +2801,6 @@ class LibvirtConnTestCase(test.TestCase):
def test_check_can_live_migrate_dest_incompatible_cpu_raises(self):
instance_ref = db.instance_create(self.context, self.test_instance)
dest = "fake_host_2"
src = instance_ref['host']
conn = libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), False)
compute_info = {'cpu_info': 'asdf'}
@@ -2922,8 +2916,6 @@ class LibvirtConnTestCase(test.TestCase):
def test_check_can_live_migrate_source_with_dest_not_enough_disk(self):
instance_ref = db.instance_create(self.context, self.test_instance)
dest = "fake_host_2"
src = instance_ref['host']
conn = libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), False)
self.mox.StubOutWithMock(conn, "_check_shared_storage_test_file")