Smoke test fails when the external network has multiple IPv4 subnets

Bug #1856671 reported by Martin Kopec on 2019-12-17
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tempest
High
Lukas Piwowarski

Bug Description

Tempest smoke test expects that the external network has only on IPv4 subnet.

tempest.scenario.test_network_basic_ops.TestNetworkBasicOps.test_network_basic_ops[compute,id-f323b3ba-82f8-4db7-8ea6-6a895869ec49,netw
ork,smoke]
---------------------------------------------------------------------------------------------------------------------------------------
----------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):
      File "/usr/lib/python2.7/site-packages/tempest/common/utils/__init__.py", line 88, in wrapper
        return f(*func_args, **func_kwargs)
      File "/usr/lib/python2.7/site-packages/tempest/scenario/test_network_basic_ops.py", line 409, in test_network_basic_ops
        self._check_network_external_connectivity()
      File "/usr/lib/python2.7/site-packages/tempest/scenario/test_network_basic_ops.py", line 342, in _check_network_external_connecti
vity
        "Found %d IPv4 subnets" % len(v4_subnets))
      File "/usr/lib/python2.7/site-packages/testtools/testcase.py", line 350, in assertEqual
        self.assertThat(observed, matcher, message)
      File "/usr/lib/python2.7/site-packages/testtools/testcase.py", line 435, in assertThat
        raise mismatch_error
    testtools.matchers._impl.MismatchError: 1 != 3: Found 3 IPv4 subnets

The test fails due to this condition in the test:
https://github.com/openstack/tempest/blob/ab3f72b21497bdc913cf92673d858e5767a5dd93/tempest/scenario/test_network_basic_ops.py#L349

From what I've gathered so far the condition is there for historical reasons, a few years back it just didn't work with multiple subnets, not just the tests, the whole OpenStack or something like that but that was 6 years ago.

I believe that now the test could be modified so that we're not limited to having just one subnet in the tested environment.

Martin Kopec (mkopec) on 2019-12-17
Changed in tempest:
assignee: nobody → Martin Kopec (mkopec)
Martin Kopec (mkopec) wrote :

lukas-piwowarski is currently working on this.

Changed in tempest:
status: New → Confirmed

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

Changed in tempest:
assignee: Martin Kopec (mkopec) → Lukas Piwowarski (lukas-piwowarski)
status: Confirmed → In Progress
Martin Kopec (mkopec) wrote :

Thanks, the patch works, see the attachment.

Martin Kopec (mkopec) on 2020-03-04
Changed in tempest:
importance: Undecided → High

Reviewed: https://review.opendev.org/705215
Committed: https://git.openstack.org/cgit/openstack/tempest/commit/?id=2385e0417beaf6ca83adbd64b1cb174daf89add7
Submitter: Zuul
Branch: master

commit 2385e0417beaf6ca83adbd64b1cb174daf89add7
Author: Lukas Piwowarski <email address hidden>
Date: Fri Jan 31 12:28:20 2020 +0000

    Add subnet_id option

    When tested network contained more than one subnet then test failed
    due to assert call.

    Subnet_id option specifies which subnet should be used for testing
    when more than one subnet in network is present. If subnet_id is
    specified then each created VM is assigned a floating IP within
    the range of the subnet.

    Closes-Bug: 1856671
    Change-Id: Ie4d44b16595055201e12f10982fc78683a12d41a

Changed in tempest:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers