← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1863707] [NEW] [neutron-tempest-plugin] test_trunk.TrunkTestInheritJSONBase.test_add_subport fails if unordered

 

Public bug reported:

Tested vs OpenStack master + OVN:
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/neutron_tempest_plugin/api/test_trunk.py", line 238, in test_add_subport
    self.assertEqual(expected_subports, trunk['sub_ports'])
  File "/usr/lib/python3.8/site-packages/testtools/testcase.py", line 411, in assertEqual
    self.assertThat(observed, matcher, message)
  File "/usr/lib/python3.8/site-packages/testtools/testcase.py", line 498, in assertThat
    raise mismatch_error
testtools.matchers._impl.MismatchError: !=:
reference = [{'port_id': '6eb624a9-368c-472c-a3ce-26608e77d2e7',
  'segmentation_id': 3,
  'segmentation_type': 'vlan'},
 {'port_id': '7a06845b-f379-4143-90f7-e664a8a602ec',
  'segmentation_id': 2,
  'segmentation_type': 'vlan'}]
actual    = [{'port_id': '7a06845b-f379-4143-90f7-e664a8a602ec',
  'segmentation_id': 2,
  'segmentation_type': 'vlan'},
 {'port_id': '6eb624a9-368c-472c-a3ce-26608e77d2e7',
  'segmentation_id': 3,
  'segmentation_type': 'vlan'}]

A straightforward proposal would be:
diff --git a/neutron_tempest_plugin/api/test_trunk.py b/neutron_tempest_plugin/api/test_trunk.py
index 823a95d..bc8ec82 100644
--- a/neutron_tempest_plugin/api/test_trunk.py
+++ b/neutron_tempest_plugin/api/test_trunk.py
@@ -235,7 +235,8 @@ class TrunkTestInheritJSONBase(TrunkTestJSONBase):
                               'segmentation_id': segmentation_id2}]
 
         # Validate that subport got segmentation details from the network
-        self.assertEqual(expected_subports, trunk['sub_ports'])
+        self.assertin(expected_subports[0], trunk['sub_ports'])
+        self.assertin(expected_subports[1], trunk['sub_ports'])

** Affects: neutron
     Importance: Undecided
     Assignee: Cédric OLLIVIER (m.col)
         Status: In Progress

** Summary changed:

- [neutron-tempest-plugin] test_trunk.TrunkTestInheritJSONBase.test_add_subport forces ordering
+ [neutron-tempest-plugin] test_trunk.TrunkTestInheritJSONBase.test_add_subport fails if unordered list

** Summary changed:

- [neutron-tempest-plugin] test_trunk.TrunkTestInheritJSONBase.test_add_subport fails if unordered list
+ [neutron-tempest-plugin] test_trunk.TrunkTestInheritJSONBase.test_add_subport fails if unordered

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1863707

Title:
  [neutron-tempest-plugin]
  test_trunk.TrunkTestInheritJSONBase.test_add_subport fails if
  unordered

Status in neutron:
  In Progress

Bug description:
  Tested vs OpenStack master + OVN:
  Traceback (most recent call last):
    File "/usr/lib/python3.8/site-packages/neutron_tempest_plugin/api/test_trunk.py", line 238, in test_add_subport
      self.assertEqual(expected_subports, trunk['sub_ports'])
    File "/usr/lib/python3.8/site-packages/testtools/testcase.py", line 411, in assertEqual
      self.assertThat(observed, matcher, message)
    File "/usr/lib/python3.8/site-packages/testtools/testcase.py", line 498, in assertThat
      raise mismatch_error
  testtools.matchers._impl.MismatchError: !=:
  reference = [{'port_id': '6eb624a9-368c-472c-a3ce-26608e77d2e7',
    'segmentation_id': 3,
    'segmentation_type': 'vlan'},
   {'port_id': '7a06845b-f379-4143-90f7-e664a8a602ec',
    'segmentation_id': 2,
    'segmentation_type': 'vlan'}]
  actual    = [{'port_id': '7a06845b-f379-4143-90f7-e664a8a602ec',
    'segmentation_id': 2,
    'segmentation_type': 'vlan'},
   {'port_id': '6eb624a9-368c-472c-a3ce-26608e77d2e7',
    'segmentation_id': 3,
    'segmentation_type': 'vlan'}]

  A straightforward proposal would be:
  diff --git a/neutron_tempest_plugin/api/test_trunk.py b/neutron_tempest_plugin/api/test_trunk.py
  index 823a95d..bc8ec82 100644
  --- a/neutron_tempest_plugin/api/test_trunk.py
  +++ b/neutron_tempest_plugin/api/test_trunk.py
  @@ -235,7 +235,8 @@ class TrunkTestInheritJSONBase(TrunkTestJSONBase):
                                 'segmentation_id': segmentation_id2}]
   
           # Validate that subport got segmentation details from the network
  -        self.assertEqual(expected_subports, trunk['sub_ports'])
  +        self.assertin(expected_subports[0], trunk['sub_ports'])
  +        self.assertin(expected_subports[1], trunk['sub_ports'])

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1863707/+subscriptions


Follow ups