From 4097be456b7ac5e561a10b73f253bc74c54427c0 Mon Sep 17 00:00:00 2001 From: Paul Glass Date: Fri, 18 Sep 2015 20:34:50 +0000 Subject: [PATCH] A functional test to check CNAME recordsets allow only 1 record Change-Id: Ifa7232d858a20db05cd03e949fbd3c4e891a6afb --- functionaltests/api/v2/test_recordset.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/functionaltests/api/v2/test_recordset.py b/functionaltests/api/v2/test_recordset.py index 161a3dd16..09d112886 100644 --- a/functionaltests/api/v2/test_recordset.py +++ b/functionaltests/api/v2/test_recordset.py @@ -182,6 +182,17 @@ class RecordsetTest(DesignateV2Test): for m in verify_models: self.assert_dns(m) + def test_cname_recordsets_cannot_have_more_than_one_record(self): + post_model = datagen.random_cname_recordset(zone_name=self.zone.name) + post_model.records = [ + "a.{0}".format(self.zone.name), + "b.{0}".format(self.zone.name), + ] + + client = RecordsetClient.as_user('default') + self.assertRaises(exceptions.BadRequest, + client.post_recordset, self.zone.id, post_model) + class RecordsetOwnershipTest(DesignateV2Test):