diff options
| author | Jenkins <jenkins@review.openstack.org> | 2013-05-29 23:59:38 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2013-05-29 23:59:38 +0000 |
| commit | 00f8eb93654681d393117e86fdee43cb9ee989b9 (patch) | |
| tree | 6909233a83bdd7495191f94fe64d8a01dd8dc2ac /nova/tests | |
| parent | 013bff3d66793ebf340a21bb7b450d7aa384dada (diff) | |
| parent | dd9c27f999221001bae9faa03571645824d2a681 (diff) | |
Merge "Delegate authentication to quantumclient"
Diffstat (limited to 'nova/tests')
| -rw-r--r-- | nova/tests/network/test_quantumv2.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/nova/tests/network/test_quantumv2.py b/nova/tests/network/test_quantumv2.py index ec1e88d86..3a2b8a7c4 100644 --- a/nova/tests/network/test_quantumv2.py +++ b/nova/tests/network/test_quantumv2.py @@ -19,6 +19,8 @@ import uuid import mox from oslo.config import cfg +from quantumclient import client as quantum_client +from quantumclient.common import exceptions as quantum_exceptions from quantumclient.v2_0 import client from nova.compute import flavors @@ -102,6 +104,17 @@ class TestQuantumClient(test.TestCase): self.mox.ReplayAll() quantumv2.get_client(my_context) + def test_cached_admin_client(self): + self.mox.StubOutWithMock(quantum_client.HTTPClient, "authenticate") + + # should be called one time only + quantum_client.HTTPClient.authenticate() + self.mox.ReplayAll() + + admin1 = quantumv2.get_client(None, admin=True) + admin2 = quantumv2.get_client(None, admin=True) + self.assertIs(admin1, admin2) + def test_withouttoken_keystone_connection_error(self): self.flags(quantum_auth_strategy='keystone') self.flags(quantum_url='http://anyhost/') @@ -1223,7 +1236,7 @@ class TestQuantumv2(test.TestCase): def test_list_floating_ips_without_l3_support(self): api = quantumapi.API() - QuantumNotFound = quantumv2.exceptions.QuantumClientException( + QuantumNotFound = quantum_exceptions.QuantumClientException( status_code=404) self.moxed_client.list_floatingips( fixed_ip_address='1.1.1.1', port_id=1).AndRaise(QuantumNotFound) |
