Use subnet without dhcp in portforwarding functional tests

In functional tests of portforwarding service plugin, there are
some new IP addresses from existing subnet used in couple of tests.
Recently we added specific function which should always find some
unused IP address to not fail tests because of IP address conflicts.

Unfortunatelly IP allocation of DHCP port is done "in background"
when port is created and I saw at least once in logs that IP address
found by _find_new_ip() method was the same IP which was allocated
to DHCP port in the meantime.

To avoid such problems in the future this patch disables dhcp for
subnet created in this test module. It is not necessary for this
tests and will avoid allocating one additional IP address by neutron
server.

Change-Id: I2766ffe1851e1efa93382a6d4698be0b5d31c96c
This commit is contained in:
Slawek Kaplonski 2019-02-19 10:19:03 +01:00
parent 53d3967827
commit 56ac61fac0

View File

@ -95,8 +95,9 @@ class PortForwardingTestCase(PortForwardingTestCaseBase):
self.fmt, self.ext_net['id'], '172.24.2.0/24').json['subnet']
self.net = self._create_network(self.fmt, 'private', True).json[
'network']
self.subnet = self._create_subnet(self.fmt, self.net['id'],
'10.0.0.0/24').json['subnet']
self.subnet = self._create_subnet(
self.fmt, self.net['id'], '10.0.0.0/24',
enable_dhcp=False).json['subnet']
self._set_router_gw(self.router['id'], self.ext_net['id'])
self._add_router_interface(self.router['id'], self.subnet['id'])
self.fip = self._create_floatingip(self.ext_net['id'])