Bug 2247268 - test_floatingip_port_details fails when there are custom availability zones
Summary: test_floatingip_port_details fails when there are custom availability zones
Keywords:
Status: POST
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: python-neutron-tests-tempest
Version: 17.1 (Wallaby)
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: z3
: 17.1
Assignee: Roman Safronov
QA Contact: Eran Kuris
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-10-31 15:43 UTC by Roman Safronov
Modified: 2024-03-25 13:00 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
OpenStack gerrit 899714 0 None NEW Check device_owner with actual availability zone 2023-10-31 15:55:58 UTC
Red Hat Issue Tracker OSP-30140 0 None None None 2023-10-31 15:44:05 UTC

Description Roman Safronov 2023-10-31 15:43:28 UTC
Description of problem:
test_floatingip_port_details checks device_owner port field with a hard-coded default value of 'compute:nova'
In case there are custom availability zones the test fails with something like:

 Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/neutron_tempest_plugin/scenario/test_floatingip.py", line 246, in test_floatingip_port_details
    self._check_port_details(
  File "/usr/lib/python3.9/site-packages/neutron_tempest_plugin/scenario/test_floatingip.py", line 275, in _check_port_details
    self.assertEqual(device_owner, port_details['device_owner'])
  File "/usr/lib/python3.9/site-packages/testtools/testcase.py", line 391, in assertEqual
    self.assertThat(observed, matcher, message)
  File "/usr/lib/python3.9/site-packages/testtools/testcase.py", line 478, in assertThat
    raise mismatch_error
testtools.matchers._impl.MismatchError: 'compute:nova' != 'compute:ovn-migration-zone-1'


Version-Release number of selected component (if applicable):
RHOS-17.1-RHEL-9-20230925.n.1
python3-neutron-tests-tempest-2.1.0-1.20230508090955.el9ost.noarch

How reproducible:
100% in case availability zones have names different from default compute:nova

Steps to Reproduce:
1. Deploy OSP environment
2. Create custom availability zones (see example below) note: my environment had 4 compute nodes but it's possible to reproduce the same issue with 2 compute nodes as well

openstack aggregate create --zone ovn-migration-zone-0 ovn-migration-agg-0
openstack aggregate add host ovn-migration-agg-0 compute-0.redhat.local
openstack aggregate add host ovn-migration-agg-0 compute-1.redhat.local
openstack aggregate create --zone ovn-migration-zone-1 ovn-migration-agg-1
openstack aggregate add host ovn-migration-agg-1 compute-2.redhat.local
openstack aggregate add host ovn-migration-agg-1 compute-3.redhat.local

After this we have this:
(overcloud) [stack@undercloud-0 tempest_17.1]$ openstack host list
+---------------------------+-----------+----------------------+
| Host Name                 | Service   | Zone                 |
+---------------------------+-----------+----------------------+
| controller-2.redhat.local | conductor | internal             |
| controller-2.redhat.local | scheduler | internal             |
| controller-0.redhat.local | scheduler | internal             |
| controller-1.redhat.local | scheduler | internal             |
| controller-0.redhat.local | conductor | internal             |
| controller-1.redhat.local | conductor | internal             |
| compute-0.redhat.local    | compute   | ovn-migration-zone-0 |
| compute-1.redhat.local    | compute   | ovn-migration-zone-0 |
| compute-3.redhat.local    | compute   | ovn-migration-zone-1 |
| compute-2.redhat.local    | compute   | ovn-migration-zone-1 |
+---------------------------+-----------+----------------------+


3. run tempest test neutron_tempest_plugin.scenario.test_floatingip.FloatingIPPortDetailsTest.test_floatingip_port_details



Actual results:
test_floatingip_port_details fails when there are custom availability zones
with MismatchError e.g.
testtools.matchers._impl.MismatchError: 'compute:nova' != 'compute:ovn-migration-zone-1'


Expected results:
test_floatingip_port_details is passing even when custom availability zones are configured

Additional info:

For a reference, without custom availability zones config (i.e. by default) this output is as follows:
(overcloud) [stack@undercloud-0 tempest_17.1]$ openstack host list
+---------------------------+-----------+----------+
| Host Name                 | Service   | Zone     |
+---------------------------+-----------+----------+
| controller-2.redhat.local | conductor | internal |
| controller-2.redhat.local | scheduler | internal |
| controller-0.redhat.local | scheduler | internal |
| controller-1.redhat.local | scheduler | internal |
| controller-0.redhat.local | conductor | internal |
| controller-1.redhat.local | conductor | internal |
| compute-0.redhat.local    | compute   | nova     |
| compute-1.redhat.local    | compute   | nova     |
| compute-3.redhat.local    | compute   | nova     |
| compute-2.redhat.local    | compute   | nova     |
+---------------------------+-----------+----------+

Comment 1 Roman Safronov 2023-10-31 15:58:07 UTC
possible fix https://review.opendev.org/c/openstack/neutron-tempest-plugin/+/899714


Note You need to log in before you can comment on or make changes to this bug.