Designate DNS – list zone exports API, filtering results.

Bug #1926058 reported by Arkady Shtempler
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Designate
Confirmed
Medium
Michael Chapman

Bug Description

According the documentation regarding "list zone exports API":
https://docs.openstack.org/api-ref/dns/?expanded=list-recordsets-in-a-zone-detail,list-all-recordsets-owned-by-project-detail,create-zone-detail,list-all-zone-exports-detail#list-all-zone-exports
it applies filtering listed exports, for example by status, but actually it doesn’t seem to be work.

Tempest test to run the scenario is available here (see patchset1): https://review.opendev.org/c/openstack/designate-tempest-plugin/+/785780

“test_list_zone_exports_filter_results” test fails with:

designate_tempest_plugin.tests.api.v2.test_zones_exports.ZonesExportTest.test_list_zone_exports_filter_results [13.781680s] ... FAILED
2021-04-11 16:28:14.145801 | controller |
2021-04-11 16:28:14.145831 | controller | Captured traceback:
2021-04-11 16:28:14.145858 | controller | ~~~~~~~~~~~~~~~~~~~
2021-04-11 16:28:14.145884 | controller | Traceback (most recent call last):
2021-04-11 16:28:14.145910 | controller |
2021-04-11 16:28:14.145936 | controller | File "/opt/stack/tempest/.tox/tempest/lib/python3.8/site-packages/designate_tempest_plugin/tests/api/v2/test_zones_exports.py", line 131, in test_list_zone_exports_filter_results
2021-04-11 16:28:14.145998 | controller | self.assertEqual(
2021-04-11 16:28:14.146024 | controller |
2021-04-11 16:28:14.146049 | controller | File "/opt/stack/tempest/.tox/tempest/lib/python3.8/site-packages/testtools/testcase.py", line 415, in assertEqual
2021-04-11 16:28:14.146073 | controller | self.assertThat(observed, matcher, message)
2021-04-11 16:28:14.146094 | controller |
2021-04-11 16:28:14.146116 | controller | File "/opt/stack/tempest/.tox/tempest/lib/python3.8/site-packages/testtools/testcase.py", line 502, in assertThat
2021-04-11 16:28:14.146138 | controller | raise mismatch_error
2021-04-11 16:28:14.146158 | controller |
2021-04-11 16:28:14.146188 | controller | testtools.matchers._impl.MismatchError: !=:
2021-04-11 16:28:14.146212 | controller | reference = []
2021-04-11 16:28:14.146240 | controller | actual = [{'created_at': '2021-04-11T16:28:01.000000',
2021-04-11 16:28:14.146264 | controller | 'id': '2cf20a65-7ee4-4c72-9c17-6884b52e8fbe',
2021-04-11 16:28:14.146287 | controller | 'links': {'export': 'http://10.176.193.228/v2/zones/tasks/exports/2cf20a65-7ee4-4c72-9c17-6884b52e8fbe/export',
2021-04-11 16:28:14.146351 | controller | 'self': 'http://10.176.193.228/v2/zones/tasks/exports/2cf20a65-7ee4-4c72-9c17-6884b52e8fbe'},
2021-04-11 16:28:14.146378 | controller | 'location': 'designate://v2/zones/tasks/exports/2cf20a65-7ee4-4c72-9c17-6884b52e8fbe/export',
2021-04-11 16:28:14.146402 | controller | 'message': None,
2021-04-11 16:28:14.146427 | controller | 'project_id': '209b5b90d84d44dabcebe9bfe148b75c',
2021-04-11 16:28:14.146453 | controller | 'status': 'COMPLETE',
2021-04-11 16:28:14.146477 | controller | 'updated_at': '2021-04-11T16:28:01.000000',
2021-04-11 16:28:14.146501 | controller | 'version': 2,
2021-04-11 16:28:14.146524 | controller | 'zone_id': '0e812f1a-7285-483c-a79c-fdaa200ddc77'}]
2021-04-11 16:28:14.146547 | controller | : Failed, filtered result is expected to be empty.
2021-04-11 16:28:14.146572 | controller |

Log: https://4c970d31e6335324d673-0d0b23b7f62d479822a1b52b605369e3.ssl.cf1.rackcdn.com/785780/1/check/designate-bind9/5f77d9b/job-output.txt

Changed in designate:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Michael Chapman (michaeltchapman) wrote :

I think the criterion being replaced instead of appended to is the issue.

https://opendev.org/openstack/designate/src/branch/master/designate/central/service.py#L2889

Changed in designate:
assignee: nobody → Michael Chapman (michaeltchapman)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to designate (stable/wallaby)

Reviewed: https://review.opendev.org/c/openstack/designate/+/798415
Committed: https://opendev.org/openstack/designate/commit/7b27055826fbc168ceeeb7a7a5e6cf65c2156ef4
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit 7b27055826fbc168ceeeb7a7a5e6cf65c2156ef4
Author: Michael Chapman <email address hidden>
Date: Wed May 5 16:54:18 2021 +1000

    Support filtering on zone import/export list

    List operations should add the task_type criterion to the user
    provided criterion.

    Added for stable/wallaby: Use the wallaby variant of the
    neutron-tempest-plugin-designate-scenario job since master has
    introduced new features in neutron.

    Change-Id: I983d930f975c109cce24a9587bba6db563b3f19f
    Closes-Bug: 1926058
    (cherry picked from commit fb9f0b33d338037365f5c9dae20f4f795b119d13)

tags: added: in-stable-wallaby
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/designate 12.0.1

This issue was fixed in the openstack/designate 12.0.1 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.