Fix NS related provider test

This commit is contained in:
Yury Tsarev 2020-10-12 22:45:17 +02:00
parent 904d8e4c87
commit ede9767c78
3 changed files with 4 additions and 4 deletions

View File

@ -257,9 +257,9 @@ func AssertActions(t *testing.T, provider *CloudFlareProvider, endpoints []*endp
changes := plan.Calculate().Changes
// Records other than A and CNAME are not supported by planner, just create them
// Records other than A, CNAME and NS are not supported by planner, just create them
for _, endpoint := range endpoints {
if endpoint.RecordType != "A" && endpoint.RecordType != "CNAME" {
if endpoint.RecordType != "A" && endpoint.RecordType != "CNAME" && endpoint.RecordType != "NS" {
changes.Create = append(changes.Create, endpoint)
}
}

View File

@ -93,7 +93,7 @@ func TestOvhZoneRecords(t *testing.T) {
zones, records, err := provider.zonesRecords(context.TODO())
assert.NoError(err)
assert.ElementsMatch(zones, []string{"example.org"})
assert.ElementsMatch(records, []ovhRecord{{ID: 42, Zone: "example.org", ovhRecordFields: ovhRecordFields{SubDomain: "ovh", FieldType: "A", TTL: 10, Target: "203.0.113.42"}}})
assert.ElementsMatch(records, []ovhRecord{{ID: 42, Zone: "example.org", ovhRecordFields: ovhRecordFields{SubDomain: "ovh", FieldType: "A", TTL: 10, Target: "203.0.113.42"}}, {ID: 24, Zone: "example.org", ovhRecordFields: ovhRecordFields{SubDomain: "ovh", FieldType: "NS", TTL: 10, Target: "203.0.113.42"}}})
client.AssertExpectations(t)
// Error on getting zones list

View File

@ -71,7 +71,7 @@ func TestRcodeZeroProvider_Records(t *testing.T) {
if err != nil {
t.Errorf("should not fail, %s", err)
}
require.Equal(t, 6, len(endpoints))
require.Equal(t, 10, len(endpoints))
mockRRSetService.TestErrorReturned = true