'Test volume creation where only initial space-create is blocked.
This should actually pass because we are blocked byt return an error
in request-cancel, meaning that it got unblocked before we could kill
the space request.'

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

    ctxt = context.get_admin_context()
    extra_specs = {}
    type_ref = volume_types.create(ctxt, 'hgst-1', extra_specs)
    volume = {'id': '1', 'name': 'volume1', 'display_name': '', 'volume_type_id': type_ref['id'], 'size': 10}
    self._return_blocked = 1
    ret = self.driver.create_volume(volume)
    expected = {'redundancy': '0', 'group': 'xanadu', 'name': 'volume10', 'mode': '0777', 'user': 'kane', 'net': 'net1', 'storageserver': 'stor1:gbd0,stor2:gbd0,', 'size': '12'}
    self.assertDictEqual(expected, self.created)
    expected_pid = {'provider_id': 'volume10'}
    self.assertDictEqual(expected_pid, ret)
    self.assertTrue(self._request_cancel)
