1
# vim: tabstop=4 shiftwidth=4 softtabstop=4
3
# Copyright 2010 United States Government as represented by the
4
# Administrator of the National Aeronautics and Space Administration.
7
# Licensed under the Apache License, Version 2.0 (the "License"); you may
8
# not use this file except in compliance with the License. You may obtain
9
# a copy of the License at
11
# http://www.apache.org/licenses/LICENSE-2.0
13
# Unless required by applicable law or agreed to in writing, software
14
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16
# License for the specific language governing permissions and limitations
19
Unit Tests for remote procedure calls using carrot
22
from nova import log as logging
23
from nova.rpc import impl_carrot
24
from nova.tests.rpc import common
27
LOG = logging.getLogger(__name__)
30
class RpcCarrotTestCase(common.BaseRpcTestCase):
32
self.rpc = impl_carrot
33
super(RpcCarrotTestCase, self).setUp(supports_timeouts=False)
35
def test_connectionpool_single(self):
36
"""Test that ConnectionPool recycles a single connection."""
37
conn1 = self.rpc.ConnectionPool.get()
38
self.rpc.ConnectionPool.put(conn1)
39
conn2 = self.rpc.ConnectionPool.get()
40
self.rpc.ConnectionPool.put(conn2)
41
self.assertEqual(conn1, conn2)