Smoke test fails when the external network has multiple IPv4 subnets

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

Bug Description

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


Captured traceback:
    Traceback (most recent call last):
      File "/usr/lib/python2.7/site-packages/tempest/common/utils/", line 88, in wrapper
        return f(*func_args, **func_kwargs)
      File "/usr/lib/python2.7/site-packages/tempest/scenario/", line 409, in test_network_basic_ops
      File "/usr/lib/python2.7/site-packages/tempest/scenario/", line 342, in _check_network_external_connecti
        "Found %d IPv4 subnets" % len(v4_subnets))
      File "/usr/lib/python2.7/site-packages/testtools/", line 350, in assertEqual
        self.assertThat(observed, matcher, message)
      File "/usr/lib/python2.7/site-packages/testtools/", 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:

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

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

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