mirror of
https://github.com/VinylDNS/vinyldns
synced 2025-08-31 14:25:30 +00:00
mysql recordset fix paging for duplicate names (#640)
* mysql recordset fix paging for duplicate names
This commit is contained in:
@@ -207,6 +207,40 @@ def test_list_recordsets_default_size_is_100(rs_fixture):
|
||||
rs_fixture.check_recordsets_page_accuracy(list_results, size=17, offset=0, maxItems=100)
|
||||
|
||||
|
||||
def test_list_recordsets_duplicate_names(rs_fixture):
|
||||
"""
|
||||
Test that paging keys work for records with duplicate names
|
||||
"""
|
||||
client = rs_fixture.client
|
||||
ok_zone = rs_fixture.test_context
|
||||
|
||||
created = []
|
||||
|
||||
try:
|
||||
record_data_a = [{'address': '1.1.1.1'}]
|
||||
record_data_txt = [{'text': 'some=value'}]
|
||||
|
||||
record_json_a = get_recordset_json(ok_zone, '0', 'A', record_data_a, ttl=100)
|
||||
record_json_txt = get_recordset_json(ok_zone, '0', 'TXT', record_data_txt, ttl=100)
|
||||
|
||||
create_response = client.create_recordset(record_json_a, status=202)
|
||||
created.append(client.wait_until_recordset_change_status(create_response, 'Complete')['recordSet']['id'])
|
||||
|
||||
create_response = client.create_recordset(record_json_txt, status=202)
|
||||
created.append(client.wait_until_recordset_change_status(create_response, 'Complete')['recordSet']['id'])
|
||||
|
||||
list_results = client.list_recordsets(ok_zone['id'], status=200, start_from=None, max_items=1)
|
||||
assert_that(list_results['recordSets'][0]['id'], is_(created[0]))
|
||||
|
||||
list_results = client.list_recordsets(ok_zone['id'], status=200, start_from=list_results['nextId'], max_items=1)
|
||||
assert_that(list_results['recordSets'][0]['id'], is_(created[1]))
|
||||
|
||||
finally:
|
||||
for id in created:
|
||||
client.delete_recordset(ok_zone['id'], id, status=202)
|
||||
client.wait_until_recordset_deleted(ok_zone['id'], id)
|
||||
|
||||
|
||||
def test_list_recordsets_with_record_name_filter_all(rs_fixture):
|
||||
"""
|
||||
Test listing all recordsets whose name contains a substring, all recordsets have substring 'list' in name
|
||||
|
Reference in New Issue
Block a user