From 33ecf81431acc6daef26bf96b4b36ac178feae3e Mon Sep 17 00:00:00 2001 From: Craig Peterson Date: Wed, 9 Oct 2019 09:38:11 -0400 Subject: [PATCH] failing test for #552 --- providers/diff/diff_test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/providers/diff/diff_test.go b/providers/diff/diff_test.go index a207f69c8..285a65dc8 100644 --- a/providers/diff/diff_test.go +++ b/providers/diff/diff_test.go @@ -262,3 +262,27 @@ func TestInvalidGlobIgnoredRecord(t *testing.T) { checkLengthsFull(t, existing, desired, 0, 1, 0, 0, false, []string{"www1", "www2", "[.www3"}) } + +// from https://github.com/StackExchange/dnscontrol/issues/552 +func TestCaas(t *testing.T) { + existing := []*models.RecordConfig{ + myRecord("test CAA 1 1.1.1.1"), + myRecord("test CAA 1 1.1.1.1"), + myRecord("test CAA 1 1.1.1.1"), + } + desired := []*models.RecordConfig{ + myRecord("test CAA 1 1.1.1.1"), + myRecord("test CAA 1 1.1.1.1"), + myRecord("test CAA 1 1.1.1.1"), + } + existing[0].SetTargetCAA(3, "issue", "letsencrypt.org.") + existing[1].SetTargetCAA(3, "issue", "amazon.com.") + existing[2].SetTargetCAA(3, "issuewild", "letsencrypt.org.") + + // this will pass or fail depending on the ordering. Not ok. + desired[0].SetTargetCAA(3, "issue", "letsencrypt.org.") + desired[2].SetTargetCAA(3, "issue", "amazon.com.") + desired[1].SetTargetCAA(3, "issuewild", "letsencrypt.org.") + + checkLengthsFull(t, existing, desired, 3, 0, 0, 0, false, nil) +}