Incorrect assert in test_routers._verify_gateway_port under neutron tests

Bug #1714007 reported by Abhilash S
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Undecided
Dongcan Ye

Bug Description

_verify_gateway_port() has the following code, which seems to be trying to assert that the fixed ip of the port on the router is allocated from an appropriate public subnet. Since it only takes the first subnet of the public network, this will always fail if the ip of the port is in a different subnet.

        public_net_body = self.admin_client.show_network(
            CONF.network.public_network_id)
        public_subnet_id = public_net_body['network']['subnets'][0]
        self.assertIn(public_subnet_id,
                      [x['subnet_id'] for x in fixed_ips])

Similar bug: https://bugs.launchpad.net/tempest/+bug/1624057
The above bug has been fixed in openstack/tempest 14.0 onwards, however bug fix for same tests are not reflected under openstack/neutron tests.

This causes the following neutron tests to fail when having multiple public subnets :

neutron.tests.tempest.api.test_routers.RoutersTest.test_update_router_set_gateway_with_snat_explicit
neutron.tests.tempest.api.test_routers.RoutersTest.test_update_router_set_gateway_without_snat
neutron.tests.tempest.api.test_routers.RoutersTest.test_update_router_reset_gateway_without_snat

summary: - Incorrect assert in test_routers._verify_gateway_port
+ Incorrect assert in test_routers._verify_gateway_port under neutron
+ tests
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/507341

Changed in neutron:
assignee: nobody → Dongcan Ye (hellochosen)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/507341
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=3d1b33633fffcc2ea5731d381fe9123a623292b3
Submitter: Jenkins
Branch: master

commit 3d1b33633fffcc2ea5731d381fe9123a623292b3
Author: Dongcan Ye <email address hidden>
Date: Tue Sep 26 11:52:35 2017 +0800

    Fix _verify_gateway_port() in multiple subnets

    The original code asserts that gw port's fixed_ips allocated from
    the first subnet of external network. This will fails if external
    network have multiple subnets.

    Change-Id: I1a2d433b36a0cb72fc3e6dc3b377e0ca56fc6f7a
    Closes-Bug: #1714007

Changed in neutron:
status: In Progress → Fix Released
tags: added: neutron-proactive-backport-potential
tags: added: neutron-easy-proactive-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/pike)

Fix proposed to branch: stable/pike
Review: https://review.openstack.org/511837

tags: removed: neutron-easy-proactive-backport-potential neutron-proactive-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/pike)

Reviewed: https://review.openstack.org/511837
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=3d6729a5d2e2fcc08044c8cad6c3e213556cb522
Submitter: Jenkins
Branch: stable/pike

commit 3d6729a5d2e2fcc08044c8cad6c3e213556cb522
Author: Dongcan Ye <email address hidden>
Date: Tue Sep 26 11:52:35 2017 +0800

    Fix _verify_gateway_port() in multiple subnets

    The original code asserts that gw port's fixed_ips allocated from
    the first subnet of external network. This will fails if external
    network have multiple subnets.

    Change-Id: I1a2d433b36a0cb72fc3e6dc3b377e0ca56fc6f7a
    Closes-Bug: #1714007
    (cherry picked from commit 3d1b33633fffcc2ea5731d381fe9123a623292b3)

tags: added: in-stable-pike
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 12.0.0.0b1

This issue was fixed in the openstack/neutron 12.0.0.0b1 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 11.0.2

This issue was fixed in the openstack/neutron 11.0.2 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.