summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorGary Kotton <gkotton@redhat.com>2012-12-09 15:57:05 +0000
committerGary Kotton <gkotton@redhat.com>2012-12-09 19:35:17 +0000
commit02797aab3c78961c0cf100df4367df61654bedc1 (patch)
treecb956d28b256f9b71e614c6cd38fd591a81f2eb5 /nova/tests
parent85f857e62a5edacbf467c19add6e51565ae3669f (diff)
Use admin user to read Quantum port.
This is part of blueprint vif-plugging-improvements. The port vif_type is only returned from Quantum when the user is an admin user. This patch ensures that when Nova reads the ports the user is an admin user. Change-Id: I4d1a2bfc6e3ae4ad63fe5c72eda32137713b31c6
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/network/test_quantumv2.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/nova/tests/network/test_quantumv2.py b/nova/tests/network/test_quantumv2.py
index 8ceaa4c99..6cb0728a2 100644
--- a/nova/tests/network/test_quantumv2.py
+++ b/nova/tests/network/test_quantumv2.py
@@ -270,10 +270,16 @@ class TestQuantumv2(test.TestCase):
def test_get_instance_nw_info_1(self):
"""Test to get one port in one network and subnet."""
+ quantumv2.get_client(mox.IgnoreArg(),
+ admin=True).MultipleTimes().AndReturn(
+ self.moxed_client)
self._get_instance_nw_info(1)
def test_get_instance_nw_info_2(self):
"""Test to get one port in each of two networks and subnets."""
+ quantumv2.get_client(mox.IgnoreArg(),
+ admin=True).MultipleTimes().AndReturn(
+ self.moxed_client)
self._get_instance_nw_info(2)
def test_get_instance_nw_info_with_nets(self):
@@ -294,6 +300,9 @@ class TestQuantumv2(test.TestCase):
network_id='my_netid1',
device_owner='network:dhcp').AndReturn(
{'ports': self.dhcp_port_data1})
+ quantumv2.get_client(mox.IgnoreArg(),
+ admin=True).MultipleTimes().AndReturn(
+ self.moxed_client)
self.mox.ReplayAll()
nw_inf = api.get_instance_nw_info(self.context,
self.instance,
@@ -317,6 +326,9 @@ class TestQuantumv2(test.TestCase):
{'networks': self.nets1})
self.moxed_client.list_networks(
shared=True).AndReturn({'networks': []})
+ quantumv2.get_client(mox.IgnoreArg(),
+ admin=True).MultipleTimes().AndReturn(
+ self.moxed_client)
self.mox.ReplayAll()
nw_inf = api.get_instance_nw_info(self.context,