From: Remi Gacogne Date: Wed, 12 Dec 2018 13:35:32 +0000 (+0100) Subject: auth: Add an API test for multiple CNAME records in the same RRset X-Git-Tag: rec-4.2.0-alpha1~88^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8b1fa85de2f5cd33ce84f78de3a700bc5d2fb512;p=thirdparty%2Fpdns.git auth: Add an API test for multiple CNAME records in the same RRset --- diff --git a/regression-tests.api/test_Zones.py b/regression-tests.api/test_Zones.py index 72a7331f5b..a0e08f9b83 100644 --- a/regression-tests.api/test_Zones.py +++ b/regression-tests.api/test_Zones.py @@ -1314,6 +1314,30 @@ fred IN A 192.168.0.4 self.assertEquals(r.status_code, 422) self.assertIn('Conflicts with pre-existing CNAME RRset', r.json()['error']) + def test_rrset_multiple_cnames(self): + name, payload, zone = self.create_zone() + rrset = { + 'changetype': 'replace', + 'name': 'sub.'+name, + 'type': 'CNAME', + 'ttl': 3600, + 'records': [ + { + "content": "01.example.org.", + "disabled": False + }, + { + "content": "02.example.org.", + "disabled": False + } + ] + } + payload = {'rrsets': [rrset]} + r = self.session.patch(self.url("/api/v1/servers/localhost/zones/" + name), data=json.dumps(payload), + headers={'content-type': 'application/json'}) + self.assertEquals(r.status_code, 422) + self.assertIn('/CNAME has more than one record', r.json()['error']) + def test_create_zone_with_leading_space(self): # Actual regression. name, payload, zone = self.create_zone()