aboutsummaryrefslogtreecommitdiff
path: root/test/fail_start_test.go
blob: aa1b137afaa40f058ad68c64d1d9dca46ac26e01 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package test

import (
	"testing"

	"github.com/miekg/coredns/core"
)

// Bind to low port should fail.
func TestFailStartServer(t *testing.T) {
	corefile := `.:53 {
	chaos CoreDNS-001 miek@miek.nl
}
`
	srv, _ := core.TestServer(t, corefile)
	err := srv.ListenAndServe()
	if err == nil {
		srv.Stop()
		t.Fatalf("Low port startup should fail")
	}
}