Fixed tests

This commit is contained in:
Anton Beloglazov 2012-10-05 17:14:13 +10:00
parent 717512f5ad
commit 2bca0e3dc4
2 changed files with 7 additions and 3 deletions

View File

@ -337,8 +337,10 @@ def execute_underload(config, state, host):
if log.isEnabledFor(logging.INFO):
log.info('Underload: obtained a new placement %s', str(placement))
for vm, host in placement.items():
state['nova'].servers.live_migrate(vm, host, False, False)
for vm, host in placement.items():
state['nova'].servers.live_migrate(vm, host, False, False)
if log.isEnabledFor(logging.INFO):
log.info('Started migration of VM %s to %s', vm, host)
# TODO: initiate VM migrations according to the obtained placement

View File

@ -150,9 +150,11 @@ class LocalManager(TestCase):
uuid=str_(of='abc123-', min_length=36, max_length=36)
):
with MockTransaction:
def raise_libvirt_error():
raise libvirt.libvirtError(None)
connection = libvirt.virConnect()
expect(connection).lookupByUUIDString(uuid). \
and_return(None).once()
and_call(lambda _: raise_libvirt_error())
assert manager.get_max_ram(connection, uuid) is None
def test_vm_mhz_to_percentage(self):