'Make sure correct exception on bad size returned from LVM.
This test case ensures that the correct exception is raised when
the information returned for the existing LVs is not in the format
that the manage_existing code expects.'

def test_lvm_manage_existing_bad_size(self):

    self._setup_stubs_for_manage_existing()
    ref = {'source-name': 'fake_lv_bad_size'}
    vol = {'name': 'test', 'id': fake.VOLUME_ID, 'size': 2}
    with mock.patch.object(self.volume.driver.vg, 'get_volume', self._get_manage_existing_lvs):
        self.assertRaises(exception.VolumeBackendAPIException, self.volume.driver.manage_existing_get_size, vol, ref)
