better handling of test multicast listener initialisation errors
We handle that error explicitly in all cases and point out the common cause, namely the absence of a default multicast interface. Closes #481.
This commit is contained in:
1 parent
bb99b21248
commit
e0bba10ead
3 files changed
+23
-13
No files matched your search
@@ -22,12 +22,19 @@ var (
|
||||
testPort = 17625
|
||||
)
|
||||
|
||||
func setupForTest() {
|
||||
func setupForTest(t *testing.T) {
|
||||
// fail early if we cannot find a default multicast interface
|
||||
multicast, err := LinkLocalMulticastListener(nil)
|
||||
if err != nil {
|
||||
t.Fatalf("Unable to create multicast listener: %s. No default multicast interface?", err)
|
||||
}
|
||||
multicast.Close()
|
||||
|
||||
testPort++
|
||||
}
|
||||
|
||||
func TestUDPDNSServer(t *testing.T) {
|
||||
setupForTest()
|
||||
setupForTest(t)
|
||||
const (
|
||||
successTestName = "test1.weave.local."
|
||||
failTestName = "test2.weave.local."
|
||||
@@ -110,7 +117,7 @@ func TestUDPDNSServer(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestTCPDNSServer(t *testing.T) {
|
||||
setupForTest()
|
||||
setupForTest(t)
|
||||
const (
|
||||
numAnswers = 512
|
||||
nonLocalName = "weave.works."
|
||||
|
||||
Reference in new issue
Block a user