diff options
Diffstat (limited to 'middleware/dnstap/setup_test.go')
-rw-r--r-- | middleware/dnstap/setup_test.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/middleware/dnstap/setup_test.go b/middleware/dnstap/setup_test.go new file mode 100644 index 000000000..fb4bca1f0 --- /dev/null +++ b/middleware/dnstap/setup_test.go @@ -0,0 +1,19 @@ +package dnstap + +import ( + "github.com/mholt/caddy" + "testing" +) + +func TestConfig(t *testing.T) { + file := "dnstap dnstap.sock full" + c := caddy.NewTestController("dns", file) + if path, full, err := parseConfig(&c.Dispenser); path != "dnstap.sock" || !full { + t.Fatalf("%s: %s", file, err) + } + file = "dnstap dnstap.sock" + c = caddy.NewTestController("dns", file) + if path, full, err := parseConfig(&c.Dispenser); path != "dnstap.sock" || full { + t.Fatalf("%s: %s", file, err) + } +} |