Factor out the particulars of looking up A or PTR queries
This commit is contained in:
1 parent
bf752d2d1f
commit
dd6ca5ab92
2 files changed
+45
-17
No files matched your search
@@ -34,7 +34,7 @@ func TestServerSimpleQuery(t *testing.T) {
|
||||
log.Println("TestServerSimpleQuery starting")
|
||||
var zone = new(ZoneDb)
|
||||
ip, _, _ := net.ParseCIDR(testAddr1)
|
||||
zone.AddRecord(containerID, "test.weave.", ip)
|
||||
zone.AddRecord(containerID, "test.weave.local.", ip)
|
||||
|
||||
mdnsServer, err := NewMDNSServer(zone)
|
||||
wt.AssertNoErr(t, err)
|
||||
@@ -67,15 +67,15 @@ func TestServerSimpleQuery(t *testing.T) {
|
||||
|
||||
time.Sleep(100 * time.Millisecond) // Allow for server to get going
|
||||
|
||||
sendQuery("test.weave.", dns.TypeA)
|
||||
sendQuery("test.weave.local.", dns.TypeA)
|
||||
|
||||
time.Sleep(time.Second)
|
||||
|
||||
if receivedCount != 1 {
|
||||
t.Fatal("Unexpected result count for test.weave", receivedCount)
|
||||
t.Fatal("Unexpected result count for test.weave.local", receivedCount)
|
||||
}
|
||||
if !receivedAddr.Equal(ip) {
|
||||
t.Fatal("Unexpected result for test.weave", receivedAddr)
|
||||
t.Fatal("Unexpected result for test.weave.local", receivedAddr)
|
||||
}
|
||||
|
||||
receivedCount = 0
|
||||
|
||||
Reference in new issue
Block a user