summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-10-16 00:54:54 +0000
committerGerrit Code Review <review@openstack.org>2018-10-16 00:54:54 +0000
commit04175b9e4aef4618b0da0c4018e91d355ae180d6 (patch)
tree5310edd0304ad0a3286215805498a9ab1e912d95
parent7c0462b275bf3797aa911ded18e0ffb70aa4cfe2 (diff)
parenta4c6c82876a3a18e2f3ca09506c431663e277d70 (diff)
Merge "Change configuration of neutron-tempest job"
-rw-r--r--.zuul.yaml48
-rw-r--r--networking_opencontrail/drivers/contrail_driver_base.py103
-rw-r--r--networking_opencontrail/drivers/drv_opencontrail.py11
-rw-r--r--networking_opencontrail/l3/opencontrail_rt_callback.py2
-rw-r--r--networking_opencontrail/ml2/mech_driver.py29
-rw-r--r--networking_opencontrail/tests/integration/test_manage_network.py14
-rw-r--r--networking_opencontrail/tests/unit/drivers/test_contrail_driver_base.py14
-rw-r--r--playbooks/zuul/noc-tempest.yaml41
-rw-r--r--roles/run-contrail/tasks/main.yml5
-rw-r--r--tempest-blacklist.txt52
10 files changed, 201 insertions, 118 deletions
diff --git a/.zuul.yaml b/.zuul.yaml
index 63deecf..1b26f31 100644
--- a/.zuul.yaml
+++ b/.zuul.yaml
@@ -64,18 +64,24 @@
64 networking-opencontrail: git://git.openstack.org/openstack/networking-opencontrail 64 networking-opencontrail: git://git.openstack.org/openstack/networking-opencontrail
65 devstack_base_dir: /opt/stack 65 devstack_base_dir: /opt/stack
66 devstack_localrc: 66 devstack_localrc:
67 DEBUG: True 67 DEBUG: true
68 ADMIN_PASSWORD: admin 68 ADMIN_PASSWORD: admin
69 HOST_IP: "{{hostvars['controller'].ansible_default_ipv4.address}}" 69 HOST_IP: "{{hostvars['controller'].ansible_default_ipv4.address}}"
70 SERVICE_HOST: "{{hostvars['controller'].ansible_default_ipv4.address}}" 70 SERVICE_HOST: "{{hostvars['controller'].ansible_default_ipv4.address}}"
71 OPENCONTRAIL_APISERVER_IP: "{{hostvars['controller'].ansible_default_ipv4.address}}" 71 OPENCONTRAIL_APISERVER_IP: "{{hostvars['controller'].ansible_default_ipv4.address}}"
72 OPENCONTRAIL_APISERVER_PORT: 8082 72 OPENCONTRAIL_APISERVER_PORT: 8082
73 Q_USE_SECGROUP: True 73 Q_USE_SECGROUP: true
74 Q_PLUGIN: ml2 74 Q_PLUGIN: ml2
75 ML2_L3_PLUGIN: opencontrail-router 75 ML2_L3_PLUGIN: opencontrail-router
76 NEUTRON_CREATE_INITIAL_NETWORKS: False 76 Q_ML2_TENANT_NETWORK_TYPE: vlan
77 Q_ML2_PLUGIN_MECHANISM_DRIVERS: opencontrail
78 NEUTRON_CREATE_INITIAL_NETWORKS: false
77 PUBLIC_PHYSICAL_NETWORK: public 79 PUBLIC_PHYSICAL_NETWORK: public
78 USE_SSL: False 80 PHYSICAL_NETWORK: default
81 PROVIDER_NETWORK_TYPE: vlan
82 USE_SSL: false
83 FLOATING_RANGE: 172.24.0.0/16
84 PUBLIC_NETWORK_GATEWAY: 172.24.0.1
79 devstack_services: 85 devstack_services:
80 # Shared services 86 # Shared services
81 dstat: true 87 dstat: true
@@ -135,16 +141,24 @@
135 DEFAULT: 141 DEFAULT:
136 router_scheduler_driver: neutron.scheduler.l3_agent_scheduler.LeastRoutersScheduler 142 router_scheduler_driver: neutron.scheduler.l3_agent_scheduler.LeastRoutersScheduler
137 router_auto_schedule: true 143 router_auto_schedule: true
144 enable_snat_by_default: false
145 quotas:
146 # A negative value means unlimited. (integer value)
147 quota_network: -1
148 quota_subnet: -1
149 quota_port: -1
150 quota_router: -1
151 quota_floatingip: -1
152 quota_security_group: -1
153 quota_security_group_rule: -1
138 $NEUTRON_CORE_PLUGIN_CONF: 154 $NEUTRON_CORE_PLUGIN_CONF:
139 ml2: 155 ml2:
140 type_drivers: vlan,vxlan 156 type_drivers: vlan,local
141 tenant_network_types: vlan,vxlan 157 tenant_network_types: vlan,local
142 extension_drivers: port_security 158 extension_drivers: port_security
143 mechanism_drivers: opencontrail,openvswitch,linuxbridge 159 mechanism_drivers: opencontrail,openvswitch,linuxbridge
144 ml2_type_vlan: 160 ml2_type_vlan:
145 network_vlan_ranges: public:1:1000 161 network_vlan_ranges: public:1:1000
146 ml2_type_vxlan:
147 vni_ranges: 1:1000
148 162
149- job: 163- job:
150 name: noc-integration 164 name: noc-integration
@@ -160,12 +174,11 @@
160 description: Tempest network tests 174 description: Tempest network tests
161 run: playbooks/zuul/noc-tempest.yaml 175 run: playbooks/zuul/noc-tempest.yaml
162 vars: 176 vars:
163 test-config: 177 devstack_local_conf:
164 $TEMPEST_CONFIG: 178 test-config:
165 network: 179 $TEMPEST_CONFIG:
166 project_networks_reachable: true 180 network:
167 neutron_plugin_options: 181 project_networks_reachable: true
168 available_type_drivers: vlan,vxlan
169 tox_envlist: all-plugin 182 tox_envlist: all-plugin
170 tempest_test_regex: (?x)^tempest\.(api|scenario).*$ 183 tempest_test_regex: (?x)^tempest\.(api|scenario).*$
171 tempest_test_blacklist: "{{devstack_base_dir}}/networking-opencontrail/tempest-blacklist.txt" 184 tempest_test_blacklist: "{{devstack_base_dir}}/networking-opencontrail/tempest-blacklist.txt"
@@ -175,6 +188,13 @@
175 parent: noc-tempest 188 parent: noc-tempest
176 description: Tempest neutron plugin tests 189 description: Tempest neutron plugin tests
177 vars: 190 vars:
191 devstack_local_conf:
192 test-config:
193 $TEMPEST_CONFIG:
194 network:
195 project_networks_reachable: true
196 neutron_plugin_options:
197 available_type_drivers: vlan,local
178 devstack_plugins: 198 devstack_plugins:
179 networking-opencontrail: git://git.openstack.org/openstack/networking-opencontrail 199 networking-opencontrail: git://git.openstack.org/openstack/networking-opencontrail
180 neutron-tempest-plugin: git://git.openstack.org/openstack/neutron-tempest-plugin 200 neutron-tempest-plugin: git://git.openstack.org/openstack/neutron-tempest-plugin
diff --git a/networking_opencontrail/drivers/contrail_driver_base.py b/networking_opencontrail/drivers/contrail_driver_base.py
index 20b2a73..232cf48 100644
--- a/networking_opencontrail/drivers/contrail_driver_base.py
+++ b/networking_opencontrail/drivers/contrail_driver_base.py
@@ -43,27 +43,27 @@ NEUTRON_CONTRAIL_PREFIX = 'NEUTRON'
43 43
44 44
45def _raise_contrail_error(info, obj_name): 45def _raise_contrail_error(info, obj_name):
46 exc_name = info.get('exception') 46 exc_name = info.get('exception')
47 if exc_name: 47 if exc_name:
48 if exc_name == 'BadRequest' and 'resource' not in info: 48 if exc_name == 'BadRequest' and 'resource' not in info:
49 info['resource'] = obj_name 49 info['resource'] = obj_name
50 if exc_name == 'VirtualRouterNotFound': 50 if exc_name == 'VirtualRouterNotFound':
51 raise exceptions.HttpResponseError(info) 51 raise exceptions.HttpResponseError(info)
52 if hasattr(l3, exc_name): 52 if hasattr(l3, exc_name):
53 raise getattr(l3, exc_name)(**info) 53 raise getattr(l3, exc_name)(**info)
54 if hasattr(securitygroup, exc_name): 54 if hasattr(securitygroup, exc_name):
55 raise getattr(securitygroup, exc_name)(**info) 55 raise getattr(securitygroup, exc_name)(**info)
56 if hasattr(allowedaddresspairs, exc_name): 56 if hasattr(allowedaddresspairs, exc_name):
57 raise getattr(allowedaddresspairs, exc_name)(**info) 57 raise getattr(allowedaddresspairs, exc_name)(**info)
58 if neutron_lib_exc and hasattr(neutron_lib_exc, exc_name): 58 if neutron_lib_exc and hasattr(neutron_lib_exc, exc_name):
59 raise getattr(neutron_lib_exc, exc_name)(**info) 59 raise getattr(neutron_lib_exc, exc_name)(**info)
60 # Few exceptions from neutron.common module are being moved 60 # Few exceptions from neutron.common module are being moved
61 # to neutron_lib.exceptions module leaving duplications. 61 # to neutron_lib.exceptions module leaving duplications.
62 # Neutron_lib must have precedence over neutron.common. 62 # Neutron_lib must have precedence over neutron.common.
63 # That's why this check must be done at the very end. 63 # That's why this check must be done at the very end.
64 if hasattr(neutron_exc, exc_name): 64 if hasattr(neutron_exc, exc_name):
65 raise getattr(neutron_exc, exc_name)(**info) 65 raise getattr(neutron_exc, exc_name)(**info)
66 raise neutron_lib_exc.NeutronException(**info) 66 raise neutron_lib_exc.NeutronException(**info)
67 67
68 68
69class OpenContrailDriversBase(object): 69class OpenContrailDriversBase(object):
@@ -168,28 +168,17 @@ class OpenContrailDriversBase(object):
168 def create_subnet(self, context, subnet): 168 def create_subnet(self, context, subnet):
169 """Creates a new subnet, and assigns it a symbolic name.""" 169 """Creates a new subnet, and assigns it a symbolic name."""
170 170
171 if subnet['subnet']['gateway_ip'] is None:
172 gateway = '0.0.0.0'
173 if subnet['subnet']['ip_version'] == 6:
174 gateway = '::'
175 subnet['subnet']['gateway_ip'] = gateway
176
177 if subnet['subnet']['host_routes'] != ATTR_NOT_SPECIFIED: 171 if subnet['subnet']['host_routes'] != ATTR_NOT_SPECIFIED:
178 if (len(subnet['subnet']['host_routes']) > 172 if (len(subnet['subnet']['host_routes']) >
179 cfg.CONF.max_subnet_host_routes): 173 cfg.CONF.max_subnet_host_routes):
180 raise neutron_lib_exc.HostRoutesExhausted( 174 raise neutron_lib_exc.HostRoutesExhausted(
181 subnet_id=subnet['subnet'].get('id', _('new subnet')), 175 subnet_id=subnet['subnet'].get('id', _('new subnet')),
182 quota=cfg.CONF.max_subnet_host_routes) 176 quota=cfg.CONF.max_subnet_host_routes)
183 177
184 subnet_created = self._create_resource('subnet', context, subnet) 178 return self._create_resource('subnet', context, subnet)
185 return self._make_subnet_dict(subnet_created)
186
187 def _make_subnet_dict(self, subnet):
188 return subnet
189 179
190 def _get_subnet(self, context, subnet_id, fields=None): 180 def _get_subnet(self, context, subnet_id, fields=None):
191 subnet = self._get_resource('subnet', context, subnet_id, fields) 181 return self._get_resource('subnet', context, subnet_id, fields)
192 return self._make_subnet_dict(subnet)
193 182
194 def get_subnet(self, context, subnet_id, fields=None): 183 def get_subnet(self, context, subnet_id, fields=None):
195 """Gets the attributes of a particular subnet.""" 184 """Gets the attributes of a particular subnet."""
@@ -199,8 +188,7 @@ class OpenContrailDriversBase(object):
199 def update_subnet(self, context, subnet_id, subnet): 188 def update_subnet(self, context, subnet_id, subnet):
200 """Updates the attributes of a particular subnet.""" 189 """Updates the attributes of a particular subnet."""
201 190
202 subnet = self._update_resource('subnet', context, subnet_id, subnet) 191 return self._update_resource('subnet', context, subnet_id, subnet)
203 return self._make_subnet_dict(subnet)
204 192
205 def delete_subnet(self, context, subnet_id): 193 def delete_subnet(self, context, subnet_id):
206 """Delete a subnet. 194 """Delete a subnet.
@@ -214,9 +202,7 @@ class OpenContrailDriversBase(object):
214 def get_subnets(self, context, filters=None, fields=None): 202 def get_subnets(self, context, filters=None, fields=None):
215 """Gets the list of subnets.""" 203 """Gets the list of subnets."""
216 204
217 return [self._make_subnet_dict(s) 205 return self._list_resource('subnet', context, filters, fields)
218 for s in self._list_resource(
219 'subnet', context, filters, fields)]
220 206
221 def get_subnets_count(self, context, filters=None): 207 def get_subnets_count(self, context, filters=None):
222 """Gets the count of subnets.""" 208 """Gets the count of subnets."""
@@ -256,16 +242,11 @@ class OpenContrailDriversBase(object):
256 # These ips are still on the port and haven't been removed 242 # These ips are still on the port and haven't been removed
257 prev_ips = [] 243 prev_ips = []
258 244
259 # the new_ips contain all of the fixed_ips that are to be updated
260 if len(new_ips) > cfg.CONF.max_fixed_ips_per_port:
261 msg = _('Exceeded maximim amount of fixed ips per port')
262 raise neutron_lib_exc.InvalidInput(error_message=msg)
263
264 # Remove all of the intersecting elements 245 # Remove all of the intersecting elements
265 for original_ip in original_ips[:]: 246 for original_ip in original_ips[:]:
266 for new_ip in new_ips[:]: 247 for new_ip in new_ips[:]:
267 if ('ip_address' in new_ip and 248 if ('ip_address' in new_ip
268 original_ip['ip_address'] == new_ip['ip_address']): 249 and original_ip['ip_address'] == new_ip['ip_address']):
269 original_ips.remove(original_ip) 250 original_ips.remove(original_ip)
270 new_ips.remove(new_ip) 251 new_ips.remove(new_ip)
271 prev_ips.append(original_ip) 252 prev_ips.append(original_ip)
@@ -275,10 +256,19 @@ class OpenContrailDriversBase(object):
275 def create_port(self, context, port): 256 def create_port(self, context, port):
276 """Creates a port on the specified Virtual Network.""" 257 """Creates a port on the specified Virtual Network."""
277 258
278 if (port['port'].get('port_security_enabled') is False and 259 if (port['port'].get('port_security_enabled') is False
279 port['port'].get('allowed_address_pairs') == []): 260 and port['port'].get('allowed_address_pairs') == []):
280 del port['port']['allowed_address_pairs'] 261 del port['port']['allowed_address_pairs']
281 262
263 if (port.get('data')
264 and not port['data'].get('resource', {}).get('tenant_id')
265 and context['tenant_id']):
266 port['data']['resource']['tenant_id'] = context['tenant_id']
267 elif (port.get('port')
268 and not port.get('port', {}).get('tenant_id')
269 and context.tenant_id):
270 port['port']['tenant_id'] = context.tenant_id
271
282 port = self._create_resource('port', context, port) 272 port = self._create_resource('port', context, port)
283 273
284 return port 274 return port
@@ -294,7 +284,6 @@ class OpenContrailDriversBase(object):
294 Updates the attributes of a port on the specified Virtual 284 Updates the attributes of a port on the specified Virtual
295 Network. 285 Network.
296 """ 286 """
297
298 original = self._get_port(context, port_id) 287 original = self._get_port(context, port_id)
299 if 'fixed_ips' in port['port']: 288 if 'fixed_ips' in port['port']:
300 added_ips, prev_ips = self._update_ips_for_port( 289 added_ips, prev_ips = self._update_ips_for_port(
@@ -305,8 +294,8 @@ class OpenContrailDriversBase(object):
305 if 'binding:host_id' in port['port']: 294 if 'binding:host_id' in port['port']:
306 original['binding:host_id'] = port['port']['binding:host_id'] 295 original['binding:host_id'] = port['port']['binding:host_id']
307 296
308 if (port['port'].get('port_security_enabled') is False and 297 if (port['port'].get('port_security_enabled') is False
309 port['port'].get('allowed_address_pairs') == []): 298 and port['port'].get('allowed_address_pairs') == []):
310 del port['port']['allowed_address_pairs'] 299 del port['port']['allowed_address_pairs']
311 300
312 return self._update_resource('port', context, port_id, port) 301 return self._update_resource('port', context, port_id, port)
@@ -344,11 +333,8 @@ class OpenContrailDriversBase(object):
344 port_status = port.get('status', PORT_STATUS_ACTIVE) 333 port_status = port.get('status', PORT_STATUS_ACTIVE)
345 334
346 for segment in context.segments_to_bind: 335 for segment in context.segments_to_bind:
347 context.set_binding( 336 context.set_binding(segment['id'], vif_type,
348 segment['id'], 337 vif_details, port_status)
349 vif_type,
350 vif_details,
351 port_status)
352 338
353 def get_ports(self, context, filters=None, fields=None): 339 def get_ports(self, context, filters=None, fields=None):
354 """Gets all ports. 340 """Gets all ports.
@@ -383,8 +369,7 @@ class OpenContrailDriversBase(object):
383 def update_router(self, context, router_id, router): 369 def update_router(self, context, router_id, router):
384 """Updates the attributes of a router.""" 370 """Updates the attributes of a router."""
385 371
386 return self._update_resource('router', context, router_id, 372 return self._update_resource('router', context, router_id, router)
387 router)
388 373
389 def delete_router(self, context, router_id): 374 def delete_router(self, context, router_id):
390 """Deletes a router.""" 375 """Deletes a router."""
diff --git a/networking_opencontrail/drivers/drv_opencontrail.py b/networking_opencontrail/drivers/drv_opencontrail.py
index c809a84..641fd32 100644
--- a/networking_opencontrail/drivers/drv_opencontrail.py
+++ b/networking_opencontrail/drivers/drv_opencontrail.py
@@ -198,7 +198,16 @@ class OpenContrailDrivers(driver_base.OpenContrailDriversBase):
198 data = json.dumps({'context': context_dict, 'data': data_dict}) 198 data = json.dumps({'context': context_dict, 'data': data_dict})
199 199
200 url_path = "%s/%s" % (self.PLUGIN_URL_PREFIX, obj_name) 200 url_path = "%s/%s" % (self.PLUGIN_URL_PREFIX, obj_name)
201 response = self._relay_request(url_path, data=data) 201 try:
202 response = self._relay_request(url_path, data=data)
203 except requests.exceptions.ConnectionError as exc:
204 # Catch connection error because SDN may not be ready
205 # to receive messages. This must not crash OpenStack.
206 # Common scenario is when OpenStack is up and running first
207 # and SDN comes up and synchronize data later.
208 LOG.error("Can't connect to remote host:\n{}".format(exc))
209 return requests.codes.unavailable, {'message': str(exc)}
210
202 try: 211 try:
203 return response.status_code, response.json() 212 return response.status_code, response.json()
204 except JSONDecodeError: 213 except JSONDecodeError:
diff --git a/networking_opencontrail/l3/opencontrail_rt_callback.py b/networking_opencontrail/l3/opencontrail_rt_callback.py
index a1747cd..fff9c80 100644
--- a/networking_opencontrail/l3/opencontrail_rt_callback.py
+++ b/networking_opencontrail/l3/opencontrail_rt_callback.py
@@ -240,7 +240,7 @@ class OpenContrailRouterHandler(common_db_mixin.CommonDbMixin,
240 with session.begin(subtransactions=True): 240 with session.begin(subtransactions=True):
241 try: 241 try:
242 super(OpenContrailRouterHandler, self).update_floatingip( 242 super(OpenContrailRouterHandler, self).update_floatingip(
243 context, floatingip_id, old_fip) 243 context, floatingip_id, {'floatingip': old_fip})
244 except Exception as e: 244 except Exception as e:
245 LOG.error("Failed to repair floating ip %(id)s: " 245 LOG.error("Failed to repair floating ip %(id)s: "
246 "%(err)s", {"id": floatingip_id, "err": e}) 246 "%(err)s", {"id": floatingip_id, "err": e})
diff --git a/networking_opencontrail/ml2/mech_driver.py b/networking_opencontrail/ml2/mech_driver.py
index 6eb3334..95f1778 100644
--- a/networking_opencontrail/ml2/mech_driver.py
+++ b/networking_opencontrail/ml2/mech_driver.py
@@ -44,8 +44,7 @@ class OpenContrailMechDriver(api.MechanismDriver):
44 44
45 def create_network_postcommit(self, context): 45 def create_network_postcommit(self, context):
46 """Create a network in OpenContrail.""" 46 """Create a network in OpenContrail."""
47 network = {} 47 network = {'network': context.current}
48 network['network'] = context.current
49 try: 48 try:
50 self.drv.create_network(context._plugin_context, network) 49 self.drv.create_network(context._plugin_context, network)
51 except Exception: 50 except Exception:
@@ -67,8 +66,7 @@ class OpenContrailMechDriver(api.MechanismDriver):
67 66
68 def update_network_postcommit(self, context): 67 def update_network_postcommit(self, context):
69 """Update an existing network in OpenContrail.""" 68 """Update an existing network in OpenContrail."""
70 network = {} 69 network = {'network': context.current}
71 network['network'] = context.current
72 try: 70 try:
73 self.drv.update_network(context._plugin_context, 71 self.drv.update_network(context._plugin_context,
74 network['network']['id'], network) 72 network['network']['id'], network)
@@ -80,8 +78,7 @@ class OpenContrailMechDriver(api.MechanismDriver):
80 78
81 def create_subnet_postcommit(self, context): 79 def create_subnet_postcommit(self, context):
82 """Create a subnet in OpenContrail.""" 80 """Create a subnet in OpenContrail."""
83 subnet = {} 81 subnet = {'subnet': context.current}
84 subnet['subnet'] = context.current
85 try: 82 try:
86 self.drv.create_subnet(context._plugin_context, subnet) 83 self.drv.create_subnet(context._plugin_context, subnet)
87 except Exception: 84 except Exception:
@@ -103,8 +100,7 @@ class OpenContrailMechDriver(api.MechanismDriver):
103 100
104 def update_subnet_postcommit(self, context): 101 def update_subnet_postcommit(self, context):
105 """Update a subnet in OpenContrail.""" 102 """Update a subnet in OpenContrail."""
106 subnet = {} 103 subnet = {'subnet': context.current}
107 subnet['subnet'] = context.current
108 try: 104 try:
109 self.drv.update_subnet(context._plugin_context, 105 self.drv.update_subnet(context._plugin_context,
110 subnet['subnet']['id'], subnet) 106 subnet['subnet']['id'], subnet)
@@ -116,9 +112,7 @@ class OpenContrailMechDriver(api.MechanismDriver):
116 112
117 def create_port_postcommit(self, context): 113 def create_port_postcommit(self, context):
118 """Create a port in OpenContrail.""" 114 """Create a port in OpenContrail."""
119 port = {} 115 port = {'port': dict(context.current)}
120 port['port'] = dict(context.current)
121
122 try: 116 try:
123 self.drv.create_port(context._plugin_context, port) 117 self.drv.create_port(context._plugin_context, port)
124 except Exception: 118 except Exception:
@@ -129,9 +123,7 @@ class OpenContrailMechDriver(api.MechanismDriver):
129 123
130 def update_port_postcommit(self, context): 124 def update_port_postcommit(self, context):
131 """Update a port in OpenContrail.""" 125 """Update a port in OpenContrail."""
132 port = {} 126 port = {'port': dict(context.current)}
133 port['port'] = dict(context.current)
134
135 try: 127 try:
136 self.drv.update_port(context._plugin_context, 128 self.drv.update_port(context._plugin_context,
137 port['port']['id'], port) 129 port['port']['id'], port)
@@ -158,8 +150,7 @@ class OpenContrailMechDriver(api.MechanismDriver):
158 150
159 def create_security_group(self, context, sg): 151 def create_security_group(self, context, sg):
160 """Create a Security Group in OpenContrail.""" 152 """Create a Security Group in OpenContrail."""
161 sec_g = {} 153 sec_g = {'security_group': sg}
162 sec_g['security_group'] = sg
163 try: 154 try:
164 self.drv.create_security_group(context, sec_g) 155 self.drv.create_security_group(context, sec_g)
165 except Exception: 156 except Exception:
@@ -175,8 +166,7 @@ class OpenContrailMechDriver(api.MechanismDriver):
175 166
176 def update_security_group(self, context, sg_id, sg): 167 def update_security_group(self, context, sg_id, sg):
177 """Update a Security Group in OpenContrail.""" 168 """Update a Security Group in OpenContrail."""
178 sec_g = {} 169 sec_g = {'security_group': sg}
179 sec_g['security_group'] = sg
180 try: 170 try:
181 self.drv.update_security_group(context, sg_id, sec_g) 171 self.drv.update_security_group(context, sg_id, sec_g)
182 except Exception: 172 except Exception:
@@ -184,8 +174,7 @@ class OpenContrailMechDriver(api.MechanismDriver):
184 174
185 def create_security_group_rule(self, context, sgr): 175 def create_security_group_rule(self, context, sgr):
186 """Create a Security Group Rule in OpenContrail.""" 176 """Create a Security Group Rule in OpenContrail."""
187 sgr_r = {} 177 sgr_r = {'security_group_rule': sgr}
188 sgr_r['security_group_rule'] = sgr
189 try: 178 try:
190 self.drv.create_security_group_rule(context, sgr_r) 179 self.drv.create_security_group_rule(context, sgr_r)
191 except Exception: 180 except Exception:
diff --git a/networking_opencontrail/tests/integration/test_manage_network.py b/networking_opencontrail/tests/integration/test_manage_network.py
index 62c2469..729343c 100644
--- a/networking_opencontrail/tests/integration/test_manage_network.py
+++ b/networking_opencontrail/tests/integration/test_manage_network.py
@@ -18,7 +18,7 @@ from networking_opencontrail.tests.base import IntegrationTestCase
18 18
19 19
20class TestManageNetwork(IntegrationTestCase): 20class TestManageNetwork(IntegrationTestCase):
21 def test_create_vlan_network(self): 21 def test_create_vlan_network_and_subnet(self):
22 """Create vlan network using openstack CLI. 22 """Create vlan network using openstack CLI.
23 23
24 Check if network exists in OpenContrail and all properties are 24 Check if network exists in OpenContrail and all properties are
@@ -33,13 +33,21 @@ class TestManageNetwork(IntegrationTestCase):
33 'admin_state_up': True, 33 'admin_state_up': True,
34 }, 34 },
35 }) 35 })
36 contrail_network = self.contrail_network_get(network['network']['id']) 36 self.neutron.create_subnet({
37 'subnet': {
38 'name': 'test_subnet_1',
39 'cidr': '192.168.2.0/24',
40 'network_id': network['network']['id'],
41 'gateway_ip': None,
42 'ip_version': 4,
43 }
44 })
37 45
46 contrail_network = self.contrail_network_get(network['network']['id'])
38 expected_network_subdict = { 47 expected_network_subdict = {
39 'segmentation_id': network['network']['provider:segmentation_id'], 48 'segmentation_id': network['network']['provider:segmentation_id'],
40 'physical_network': network['network']['provider:physical_network'] 49 'physical_network': network['network']['provider:physical_network']
41 } 50 }
42
43 self.assertDictEqual(contrail_network['provider_properties'], 51 self.assertDictEqual(contrail_network['provider_properties'],
44 expected_network_subdict) 52 expected_network_subdict)
45 53
diff --git a/networking_opencontrail/tests/unit/drivers/test_contrail_driver_base.py b/networking_opencontrail/tests/unit/drivers/test_contrail_driver_base.py
index 63ae68e..a489277 100644
--- a/networking_opencontrail/tests/unit/drivers/test_contrail_driver_base.py
+++ b/networking_opencontrail/tests/unit/drivers/test_contrail_driver_base.py
@@ -748,20 +748,6 @@ class PortTestCases(test_extensions_base.ExtensionTestCase):
748 port_id, port) 748 port_id, port)
749 749
750 @mock.patch("oslo_config.cfg.CONF") 750 @mock.patch("oslo_config.cfg.CONF")
751 def test_update_port_fixed_ips_error(self, config):
752 config.max_fixed_ips_per_port = 0
753 drv = self._get_drv()
754 drv._update_resource = mock.Mock()
755 port = self._get_port(fixed_ips=["127.0.0.1"])
756 port_id = port['port']['id']
757 drv._get_port = mock.Mock()
758 drv._get_port.return_value = port['port']
759 context = mock.Mock()
760
761 self.assertRaises(exceptions.InvalidInput, drv.update_port,
762 context, port_id, port)
763
764 @mock.patch("oslo_config.cfg.CONF")
765 def test_update_port_fixed_ips(self, config): 751 def test_update_port_fixed_ips(self, config):
766 config.max_fixed_ips_per_port = 10 752 config.max_fixed_ips_per_port = 10
767 drv = self._get_drv() 753 drv = self._get_drv()
diff --git a/playbooks/zuul/noc-tempest.yaml b/playbooks/zuul/noc-tempest.yaml
index fee6bde..3ccead1 100644
--- a/playbooks/zuul/noc-tempest.yaml
+++ b/playbooks/zuul/noc-tempest.yaml
@@ -8,6 +8,47 @@
8 8
9# We run tests only on one node, regardless how many nodes are in the system 9# We run tests only on one node, regardless how many nodes are in the system
10- hosts: tempest 10- hosts: tempest
11 pre_tasks:
12 - set_fact:
13 devstack_openrc: "{{ devstack_base_dir }}/devstack/openrc"
14 tempest_conf: "{{ devstack_base_dir }}/tempest/etc/tempest.conf"
15
16 - name: Create Public external network
17 # DevStack has been configured to not create default networks while stacking
18 # This will cause oslo.config to pass empty string instead of UUID
19 # to every test which needs public network.
20 shell: |
21 set -e
22 set -x
23 source {{ devstack_openrc }} admin admin; \
24 openstack network create --provider-network-type vlan \
25 --provider-segment 1200 \
26 --provider-physical-network public \
27 --external --share --enable --default ext-public
28 args:
29 executable: /bin/bash
30
31 - name: Create subnet with IPv4 for ext-public network
32 shell: |
33 set -e
34 set -x
35 source {{ devstack_openrc }} admin admin; \
36 openstack subnet create --subnet-range 192.168.0.0/16 \
37 --network ext-public \
38 --ip-version 4 --dhcp ep-subnet
39 args:
40 executable: /bin/bash
41
42 - name: Set ext-public network as tempest public_network_id
43 become: yes
44 shell: |
45 set -e
46 set -x
47 source {{ devstack_openrc }} admin admin; \
48 ext_net_id=$(openstack network list --name ext-public -c ID -f value)
49 sed -i "s/^public_network_id.*/public_network_id = $ext_net_id/" {{ tempest_conf }}
50 args:
51 executable: /bin/bash
11 roles: 52 roles:
12 - setup-tempest-run-dir 53 - setup-tempest-run-dir
13 - setup-tempest-data-dir 54 - setup-tempest-data-dir
diff --git a/roles/run-contrail/tasks/main.yml b/roles/run-contrail/tasks/main.yml
index 46812e7..b7ec2cf 100644
--- a/roles/run-contrail/tasks/main.yml
+++ b/roles/run-contrail/tasks/main.yml
@@ -16,6 +16,11 @@
16 retries: 30 16 retries: 30
17 delay: 5 17 delay: 5
18 18
19- name: Copy vrouter
20 become: yes
21 shell: |
22 docker cp vrouter_vrouter-agent_1:/usr/bin/vrouter-port-control /usr/bin/
23
19- name: Run contrail-status 24- name: Run contrail-status
20 shell: | 25 shell: |
21 contrail-status 26 contrail-status
diff --git a/tempest-blacklist.txt b/tempest-blacklist.txt
index 9155b0f..840878b 100644
--- a/tempest-blacklist.txt
+++ b/tempest-blacklist.txt
@@ -1,7 +1,8 @@
1# Exclude slow tests 1# Exclude slow tests
2.*\[.*\bslow\b.*\] 2.*\[.*\bslow\b.*\]
3.*\[.*\bsmoke\b.*\]
3 4
4# Exclude stuff less releated to networking, to reduce gate load 5# Exclude stuff less related to networking, to reduce gate load
5tempest\.api\.compute.* 6tempest\.api\.compute.*
6tempest\.api\.identity.* 7tempest\.api\.identity.*
7tempest\.api\.image.* 8tempest\.api\.image.*
@@ -14,10 +15,49 @@ tempest\.scenario\.test_shelve_instance.*
14tempest\.scenario\.test_snapshot.* 15tempest\.scenario\.test_snapshot.*
15tempest\.scenario\.test_stamp.* 16tempest\.scenario\.test_stamp.*
16tempest\.scenario\.test_volume.* 17tempest\.scenario\.test_volume.*
18.*reboot.*
19.*instance.*
20.*vms.*
21
22# Exclude tests which exhaust hardware resources
23tempest\.scenario\.test_network_basic_ops\.TestNetworkBasicOps\.test_network_basic_ops
24tempest\.scenario\.test_network_basic_ops\.TestNetworkBasicOps\.test_hotplug_nic
25neutron_tempest_plugin\.scenario\.test_security_groups\.NetworkSecGroupTest\.test_default_sec_grp_scenarios
26neutron_tempest_plugin\.scenario\.test_security_groups\.NetworkSecGroupTest\.test_ip_prefix.*
27neutron_tempest_plugin\.scenario\.test_security_groups\.NetworkSecGroupTest\.test_multiple_ports_secgroup_inheritance
28neutron_tempest_plugin\.scenario\.test_security_groups\.NetworkSecGroupTest\.test_protocol_number_rule
29neutron_tempest_plugin\.scenario\.test_security_groups\.NetworkSecGroupTest\.test_remote_group
30neutron_tempest_plugin\.scenario\.test_security_groups\.NetworkSecGroupTest\.test_two_sec_groups
31neutron_tempest_plugin\.scenario\.test_floatingip.*test_east_west.*
32neutron_tempest_plugin\.scenario\.test_floatingip\.FloatingIPPortDetailsTest\.test_floatingip_port_details
33neutron_tempest_plugin\.scenario\.test_portsecurity\.PortSecurityTest\.test_port_security_removed_added
34.*traffic.*
17 35
18# Exclude not supported features 36# Exclude not supported features
19neutron_tempest_plugin\.api.*RBAC.* 37.*snat.*
20neutron_tempest_plugin\.api.*dns.* 38.*RBAC.*
21neutron_tempest_plugin\.api.*logging.* 39.*dns.*
22neutron_tempest_plugin\.api.*qos.* 40.*logging.*
23neutron_tempest_plugin\.api\.test_trunk.* 41.*trunk.*
42.*qos.*
43.*revision.*
44.*timestamp.*
45.*_ha.*
46neutron_tempest_plugin.*TrunkTestJSON.*
47neutron_tempest_plugin\.scenario\.test_floatingip\.FloatingIPQosTest
48neutron_tempest_plugin\.api\.test_routers\.DvrRoutersTestToCentralized\.test_convert_centralized_router
49neutron_tempest_plugin\.api\.test_routers\.DvrRoutersTest\.test_create_distributed_router
50neutron_tempest_plugin\.api\.test_routers\.HaRoutersTest.*
51
52# vRouter cannot set port’s status to ACTIVE as openvswitch does
53# neutron_tempest_plugin\.api\.admin\.test_dhcp_agent_scheduler\.DHCPAgentSchedulersTestJSON\.test_dhcp_port_status_active
54neutron_tempest_plugin\.api\.test_routers\.RoutersTest\.test_router_interface_status
55neutron_tempest_plugin\.api\.test_routers\.RoutersIpV6Test\.test_router_interface_status
56
57# vRouter does not behave as L3Agent. Tests expect to L3Agent service running
58neutron_tempest_plugin\.api\.admin\.test_l3_agent_scheduler\.L3AgentSchedulerTestJSON
59tempest\.api\.network\.admin\.test_l3_agent_scheduler\.L3AgentSchedulerTestJSON
60
61# There is a conflict between how Neutron and vnc_openstack behave
62# Vnc_openstack does not allow adding new fixed ip for already existed port
63tempest\.scenario\.test_network_v6\.TestGettingAddress\.test_dualnet_multi_prefix_slaac