self.assertEqual(r.status_code, 422)
self.assert_in_json_error("Exactly one record should be provided", r.json())
+ def test_zone_rr_bogus_update_4(self):
+ name, payload, zone = self.create_zone()
+ # rrset with invalid characters which are not processed by parseRFC1035CharString
+ rrset = {
+ 'changetype': 'replace',
+ 'name': 'a.'+name,
+ 'type': 'A',
+ 'ttl': 3600,
+ 'records': [
+ {
+ "content": "(127.0.0.1)",
+ "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.assertEqual(r.status_code, 422)
+ self.assert_in_json_error("Invalid character '(' in record content", r.json())
+
def test_zone_rr_update(self):
name, payload, zone = self.create_zone()
# do a replace (= update)