test_gateway_chassis_with_bridge_mappings is incomplete

Bug #1844652 reported by Flavio Fernandes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
networking-ovn
Fix Released
Undecided
Flavio Fernandes

Bug Description

The functional test test_gateway_chassis_with_bridge_mappings is written in a way that exercises changing the external gateway for a virtual router.
It essentially does:

  openstack router set router1 --external-gateway public_net1
  openstack router set router1 --external-gateway public_net2
  openstack router set router1 --external-gateway public_net3

It should also unset in between the sets, to exercise
update router where gateway is cleared.

  openstack router set router1 --external-gateway public_net1

  openstack router unset router1 --external-gateway

  openstack router set router1 --external-gateway public_net2
  openstack router set router1 --external-gateway public_net3

The test is located at:

  https://github.com/openstack/networking-ovn/blob/e07d4316c9a2c9912d47b8e36e2d81807f8dabe3/networking_ovn/tests/functional/test_router.py#L192

One way to run it is by invoking the command on a 'stacked' system:

  cd /opt/stack/networking-ovn && \
  tox -e dsvm-functional -- \
  networking_ovn.tests.functional.test_router.TestRouter.test_gateway_chassis_with_bridge_mappings

Changed in networking-ovn:
assignee: nobody → Flavio Fernandes (ffernand)
summary: - test_gateway_chassis_with_bridge_mappings is wrong
+ test_gateway_chassis_with_bridge_mappings is incomplete
description: updated
Revision history for this message
Flavio Fernandes (ffernand) wrote :

Steps to exercise this codepath:

PRJ=$(openstack project show demo -f value -c id)
openstack router create --project $PRJ router2 >/dev/null
RTR=$(openstack router show router2 -f value -c id)

# this external network may already exist..
openstack network create public --external --default --provider-network-type flat --provider-physical-network public >/dev/null 2>&1 || true
EXT_NET_ID=$(openstack network show public -f value -c id)

openstack network create --external --provider-network-type geneve public2 >/dev/null 2>&1
EXT_NET_ID2=$(openstack network show public2 -f value -c id)
openstack subnet create --ip-version 4 --network $EXT_NET_ID2 --subnet-range 192.168.111.0/24 --no-dhcp public2-subnet1 >/dev/null

openstack router set --external-gateway $EXT_NET_ID $RTR
openstack router show $RTR | grep -i external

openstack router set --external-gateway $EXT_NET_ID2 $RTR
openstack router show $RTR | grep -i external

openstack router unset --external-gateway $RTR
openstack router show $RTR | grep -i external

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to networking-ovn (master)

Fix proposed to branch: master
Review: https://review.opendev.org/683237

Changed in networking-ovn:
status: New → In Progress
Revision history for this message
Flavio Fernandes (ffernand) wrote :
description: updated
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to networking-ovn (master)

Reviewed: https://review.opendev.org/683237
Committed: https://git.openstack.org/cgit/openstack/networking-ovn/commit/?id=5cffa92daa822116c1862dcd11ad156be444df75
Submitter: Zuul
Branch: master

commit 5cffa92daa822116c1862dcd11ad156be444df75
Author: Flavio Fernandes <email address hidden>
Date: Thu Sep 19 14:58:05 2019 -0400

    test_router: Verify the creation and removal of a lrp

    Add test to ensure that logical router port associated
    with an external network is created and removed as
    needed: test_logical_router_port_creation. With that,
    the test exercises the code-path where a gateway is
    removed before a new one is set. In terms of OpenStack
    workflow, that would look like:

      openstack router set --external-gateway $EXT_NET_ID $RTR
      openstack router unset --external-gateway $RTR
      openstack router set --external-gateway $EXT_NET_ID2 $RTR

    Also changed test_gateway_chassis_with_bridge_mappings
    to include docstring and have a lower bound count to the
    mocked objects it uses.

    Change-Id: Ib3edc101e9ee0fb53386fac0ae7f272ab3b3646b
    Signed-off-by: Flavio Fernandes <email address hidden>
    Related-Bug: #1843485
    Closes-Bug: #1844652

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

Fix proposed to branch: stable/train
Review: https://review.opendev.org/728559

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to networking-ovn (stable/stein)

Fix proposed to branch: stable/stein
Review: https://review.opendev.org/728562

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to networking-ovn (stable/rocky)

Fix proposed to branch: stable/rocky
Review: https://review.opendev.org/728563

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to networking-ovn (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.opendev.org/728565

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to networking-ovn (stable/train)

Reviewed: https://review.opendev.org/728559
Committed: https://git.openstack.org/cgit/openstack/networking-ovn/commit/?id=b9ab95036b3bbaf1a87b1c4beeed11f80036e8a0
Submitter: Zuul
Branch: stable/train

commit b9ab95036b3bbaf1a87b1c4beeed11f80036e8a0
Author: Flavio Fernandes <email address hidden>
Date: Thu Sep 19 14:58:05 2019 -0400

    test_router: Verify the creation and removal of a lrp

    Add test to ensure that logical router port associated
    with an external network is created and removed as
    needed: test_logical_router_port_creation. With that,
    the test exercises the code-path where a gateway is
    removed before a new one is set. In terms of OpenStack
    workflow, that would look like:

      openstack router set --external-gateway $EXT_NET_ID $RTR
      openstack router unset --external-gateway $RTR
      openstack router set --external-gateway $EXT_NET_ID2 $RTR

    Also changed test_gateway_chassis_with_bridge_mappings
    to include docstring and have a lower bound count to the
    mocked objects it uses.

    Change-Id: Ib3edc101e9ee0fb53386fac0ae7f272ab3b3646b
    Signed-off-by: Flavio Fernandes <email address hidden>
    Related-Bug: #1843485
    Closes-Bug: #1844652
    (cherry picked from commit 5cffa92daa822116c1862dcd11ad156be444df75)

tags: added: in-stable-train
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to networking-ovn (stable/rocky)

Reviewed: https://review.opendev.org/728563
Committed: https://git.openstack.org/cgit/openstack/networking-ovn/commit/?id=f3577c72f154bcce882a4ff28d51dca53ae4f4cc
Submitter: Zuul
Branch: stable/rocky

commit f3577c72f154bcce882a4ff28d51dca53ae4f4cc
Author: Flavio Fernandes <email address hidden>
Date: Thu Sep 19 14:58:05 2019 -0400

    test_router: Verify the creation and removal of a lrp

    Add test to ensure that logical router port associated
    with an external network is created and removed as
    needed: test_logical_router_port_creation. With that,
    the test exercises the code-path where a gateway is
    removed before a new one is set. In terms of OpenStack
    workflow, that would look like:

      openstack router set --external-gateway $EXT_NET_ID $RTR
      openstack router unset --external-gateway $RTR
      openstack router set --external-gateway $EXT_NET_ID2 $RTR

    Also changed test_gateway_chassis_with_bridge_mappings
    to include docstring and have a lower bound count to the
    mocked objects it uses.

    Change-Id: Ib3edc101e9ee0fb53386fac0ae7f272ab3b3646b
    Signed-off-by: Flavio Fernandes <email address hidden>
    Related-Bug: #1843485
    Closes-Bug: #1844652
    (cherry picked from commit 5cffa92daa822116c1862dcd11ad156be444df75)
    (cherry picked from commit b9ab95036b3bbaf1a87b1c4beeed11f80036e8a0)

tags: added: in-stable-rocky
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to networking-ovn (stable/queens)

Reviewed: https://review.opendev.org/728565
Committed: https://git.openstack.org/cgit/openstack/networking-ovn/commit/?id=5d9dacf52265c2de00dbd568190e05354f84703a
Submitter: Zuul
Branch: stable/queens

commit 5d9dacf52265c2de00dbd568190e05354f84703a
Author: Flavio Fernandes <email address hidden>
Date: Thu Sep 19 14:58:05 2019 -0400

    test_router: Verify the creation and removal of a lrp

    Add test to ensure that logical router port associated
    with an external network is created and removed as
    needed: test_logical_router_port_creation. With that,
    the test exercises the code-path where a gateway is
    removed before a new one is set. In terms of OpenStack
    workflow, that would look like:

      openstack router set --external-gateway $EXT_NET_ID $RTR
      openstack router unset --external-gateway $RTR
      openstack router set --external-gateway $EXT_NET_ID2 $RTR

    Also changed test_gateway_chassis_with_bridge_mappings
    to include docstring and have a lower bound count to the
    mocked objects it uses.

    Change-Id: Ib3edc101e9ee0fb53386fac0ae7f272ab3b3646b
    Signed-off-by: Flavio Fernandes <email address hidden>
    Related-Bug: #1843485
    Closes-Bug: #1844652
    (cherry picked from commit 5cffa92daa822116c1862dcd11ad156be444df75)
    (cherry picked from commit b9ab95036b3bbaf1a87b1c4beeed11f80036e8a0)
    (cherry picked from commit f3577c72f154bcce882a4ff28d51dca53ae4f4cc)

tags: added: in-stable-queens
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to networking-ovn (stable/stein)

Reviewed: https://review.opendev.org/728562
Committed: https://git.openstack.org/cgit/openstack/networking-ovn/commit/?id=23a0316193be494c8fba7f223ad40624698c05dc
Submitter: Zuul
Branch: stable/stein

commit 23a0316193be494c8fba7f223ad40624698c05dc
Author: Flavio Fernandes <email address hidden>
Date: Thu Sep 19 14:58:05 2019 -0400

    test_router: Verify the creation and removal of a lrp

    Add test to ensure that logical router port associated
    with an external network is created and removed as
    needed: test_logical_router_port_creation. With that,
    the test exercises the code-path where a gateway is
    removed before a new one is set. In terms of OpenStack
    workflow, that would look like:

      openstack router set --external-gateway $EXT_NET_ID $RTR
      openstack router unset --external-gateway $RTR
      openstack router set --external-gateway $EXT_NET_ID2 $RTR

    Also changed test_gateway_chassis_with_bridge_mappings
    to include docstring and have a lower bound count to the
    mocked objects it uses.

    Change-Id: Ib3edc101e9ee0fb53386fac0ae7f272ab3b3646b
    Signed-off-by: Flavio Fernandes <email address hidden>
    Related-Bug: #1843485
    Closes-Bug: #1844652
    (cherry picked from commit 5cffa92daa822116c1862dcd11ad156be444df75)
    (cherry picked from commit b9ab95036b3bbaf1a87b1c4beeed11f80036e8a0)

tags: added: in-stable-stein
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/networking-ovn queens-eol

This issue was fixed in the openstack/networking-ovn queens-eol release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/networking-ovn rocky-eol

This issue was fixed in the openstack/networking-ovn rocky-eol release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/networking-ovn stein-eol

This issue was fixed in the openstack/networking-ovn stein-eol 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.