Skip to content

Commit

Permalink
test: Add wildcard test
Browse files Browse the repository at this point in the history
  • Loading branch information
MicahBird committed Nov 28, 2024
1 parent 86083c0 commit a5f3d84
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions provider/pihole/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"encoding/json"
"net/http"
"net/http/httptest"
"sigs.k8s.io/external-dns/provider"
"strings"
"testing"

Expand Down Expand Up @@ -353,6 +354,16 @@ func TestCreateRecord(t *testing.T) {
if err := cl.createRecord(context.Background(), ep); err != nil {
t.Fatal(err)
}

// Test create a wildcard record and ensure it fails
ep = &endpoint.Endpoint{
DNSName: "*.example.com",
Targets: []string{"192.168.1.1"},
RecordType: endpoint.RecordTypeA,
}
if err := cl.createRecord(context.Background(), ep); err != provider.SoftError {
t.Fatal(err)
}
}

func TestDeleteRecord(t *testing.T) {
Expand Down

0 comments on commit a5f3d84

Please sign in to comment.