Unit test fixes

This commit is contained in:
John Gardiner Myers 2021-11-28 11:37:40 -08:00
parent 6f42a8a2da
commit de1db3f03d
3 changed files with 7 additions and 5 deletions

View File

@ -37,7 +37,7 @@ func TestNewEndpoint(t *testing.T) {
func TestNewEndpointWithIPv6(t *testing.T) {
e := NewEndpoint("example.org", "AAAA", "foo.com")
if e.DNSName != "example.com" || e.Targets[0] != "foo.com" || e.RecordType != "AAAA" {
if e.DNSName != "example.org" || e.Targets[0] != "foo.com" || e.RecordType != "AAAA" {
t.Error("Endpoint is not initialized correctly")
}
@ -46,7 +46,7 @@ func TestNewEndpointWithIPv6(t *testing.T) {
}
w := NewEndpoint("example.org", "", "load-balancer.com.")
if w.DNSName != "example.org" || e.Targets[0] != "load-balancer.com" || w.RecordType != "" {
if w.DNSName != "example.org" || w.Targets[0] != "load-balancer.com" || w.RecordType != "" {
t.Error("Endpoint is not initialized correctly")
}
}

View File

@ -372,6 +372,7 @@ func TestParseFlags(t *testing.T) {
"--transip-keyfile=/path/to/transip.key",
"--digitalocean-api-page-size=100",
"--managed-record-types=A",
"--managed-record-types=AAAA",
"--managed-record-types=CNAME",
"--managed-record-types=NS",
"--rfc2136-batch-change-size=100",
@ -488,7 +489,7 @@ func TestParseFlags(t *testing.T) {
"EXTERNAL_DNS_TRANSIP_ACCOUNT": "transip",
"EXTERNAL_DNS_TRANSIP_KEYFILE": "/path/to/transip.key",
"EXTERNAL_DNS_DIGITALOCEAN_API_PAGE_SIZE": "100",
"EXTERNAL_DNS_MANAGED_RECORD_TYPES": "A\nCNAME\nNS",
"EXTERNAL_DNS_MANAGED_RECORD_TYPES": "A\nAAAA\nCNAME\nNS",
"EXTERNAL_DNS_RFC2136_BATCH_CHANGE_SIZE": "100",
"EXTERNAL_DNS_IBMCLOUD_PROXIED": "1",
"EXTERNAL_DNS_IBMCLOUD_CONFIG_FILE": "ibmcloud.json",

View File

@ -1054,7 +1054,8 @@ func testServiceSourceEndpoints(t *testing.T) {
serviceTypesFilter: []string{},
annotations: map[string]string{hostnameAnnotationKey: "foobar.example.org"},
expected: []*endpoint.Endpoint{
{DNSName: "foobar.example.org", Targets: endpoint.Targets{"1.1.1.1", "2001:db8::1"}},
{DNSName: "foobar.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.1.1.1"}},
{DNSName: "foobar.example.org", RecordType: endpoint.RecordTypeAAAA, Targets: endpoint.Targets{"2001:db8::1"}},
},
},
{
@ -1070,7 +1071,7 @@ func testServiceSourceEndpoints(t *testing.T) {
serviceTypesFilter: []string{},
annotations: map[string]string{hostnameAnnotationKey: "foobar-v6.example.org"},
expected: []*endpoint.Endpoint{
{DNSName: "foobar-v6.example.org", Targets: endpoint.Targets{"2001:db8::2"}},
{DNSName: "foobar-v6.example.org", RecordType: endpoint.RecordTypeAAAA, Targets: endpoint.Targets{"2001:db8::2"}},
},
},
} {