'Test exception when set-apphost can\'t connect volume to host.'

@mock.patch('socket.gethostbyname', return_value='123.123.123.123')
def test_add_cinder_apphosts_fails(self, mock_ghn):

    ctxt = context.get_admin_context()
    extra_specs = {}
    type_ref = volume_types.create(ctxt, 'hgst-1', extra_specs)
    orig = {'id': '1', 'name': 'volume1', 'display_name': '', 'volume_type_id': type_ref['id'], 'size': 10, 'provider_id': 'space_orig'}
    clone = {'id': '2', 'name': 'clone1', 'display_name': '', 'volume_type_id': type_ref['id'], 'size': 10}
    self._fail_set_apphosts = True
    self.assertRaises(exception.VolumeDriverException, self.driver.create_cloned_volume, clone, orig)
