'Test for nova.virt.libvirt.libvirt_driver.LibvirtConnection
.migrate_disk_and_power_off.'

def _test_migrate_disk_and_power_off_resize_check(self, expected_exc):

    instance = self._create_instance()
    disk_info = list(fake_disk_info_byname(instance).values())
    def fake_get_instance_disk_info(instance, xml=None, block_device_info=None):
        return disk_info
    def fake_destroy(instance):
        pass
    def fake_get_host_ip_addr():
        return '10.0.0.1'
    self.stubs.Set(self.drvr, '_get_instance_disk_info', fake_get_instance_disk_info)
    self.stubs.Set(self.drvr, '_destroy', fake_destroy)
    self.stubs.Set(self.drvr, 'get_host_ip_addr', fake_get_host_ip_addr)
    flavor = {'root_gb': 10, 'ephemeral_gb': 20}
    flavor_obj = objects.Flavor(**flavor)
    self.assertRaises(expected_exc, self.drvr.migrate_disk_and_power_off, None, instance, '10.0.0.1', flavor_obj, None)
