neutron-tempest-plugin: there is no way to create a subnet without a gateway and this breaks trunk tests
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
neutron |
Fix Released
|
Medium
|
Slawek Kaplonski |
Bug Description
This commit [0] fixed an issue with the subnet CIDR generation in tempest tests.
With the fix all subnets will get a gateway assigned regardless that it's attached to a router or not so it may happen that the gateway port doesn't exist. Normally, this shouldn't be a big deal but for trunk ports it's currently an issue with test_subport_
When dhclient runs, a new default gateway route is installed and the connectivity to the FIP is lost thus making the test to fail as it fails to execute/read any further commands:
I logged into the VM with virsh and checked the routes:
[root@tempest-
default via 10.100.0.17 dev eth0.10
default via 10.100.0.1 dev eth0 proto static metric 100
default via 10.100.0.17 dev eth0.10 proto static metric 400
10.100.0.0/28 dev eth0 proto kernel scope link src 10.100.0.5 metric 100
10.100.0.16/28 dev eth0.10 proto kernel scope link src 10.100.0.25
169.254.169.254 via 10.100.0.18 dev eth0.10 proto dhcp
169.254.169.254 via 10.100.0.2 dev eth0 proto dhcp metric 100
This shouldn't happen as the subnet is not even connected to a router and also 10.100.0.17 doesn't even exist in Neutron. Prior to [0] it didn't fail because old code would create the subnet with gateway=None and it was skipped (actually it will only setup a gateway automatically if gateway equals to '' [2] but it was None instead [3]).
Let's allow a way to have the ability to configure subnets without a gateway.
[0] https:/
[1] https:/
[2] https:/
[3] https:/
Changed in neutron: | |
assignee: | nobody → Slawek Kaplonski (slaweq) |
Changed in neutron: | |
importance: | Undecided → Medium |
status: | New → Confirmed |
Changed in neutron: | |
status: | Confirmed → In Progress |
There is indeed a regression and the patch for it looks very simple. It can be resumed by below points:
1) Restore the default value for gateway parameter as before in method create_subnet
gateway=''
2) In create_subnet method where gateway is assigned and restore old behavior:
if gateway is not None: 'gateway_ ip'] = str(gateway) or str(subnet_cidr.ip + 1)
kwargs[
3) Remove gateway_ip parameter in below call:
body = client. create_ subnet( id=network[ 'id'], str(subnet_ cidr), version= subnet_ cidr.version,
network_
cidr=
ip_
**kwargs)
4) Call it with parameter gateway=None in trunk_test.py (as it was before).