test_gateway_chassis_with_bridge_mappings is incomplete

Bug #1844652 reported by Flavio Fernandes on 2019-09-19
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
networking-ovn
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
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

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

Changed in networking-ovn:
status: New → In Progress
description: updated
description: updated

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
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers