Add test for negative DNS queries
This commit is contained in:
1 parent
073836905a
commit
c2d5b35cd6
3 files changed
+13
-17
No files matched your search
+1
-1
@@ -239,7 +239,7 @@ func (d *DNSServer) handleRecursive(client *dns.Client, defaultMaxResponseSize i
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
d.ns.debugf("response: %+v", response)
|
d.ns.debugf("response: %+v", response)
|
||||||
response.SetReply(req)
|
response.Id = req.Id
|
||||||
if err := w.WriteMsg(response); err != nil {
|
if err := w.WriteMsg(response); err != nil {
|
||||||
d.ns.infof("error responding: %v", err)
|
d.ns.infof("error responding: %v", err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
#! /bin/bash
|
|
||||||
|
|
||||||
. ./config.sh
|
|
||||||
|
|
||||||
C1=10.2.0.78
|
|
||||||
|
|
||||||
start_suite "Cross host dns-lookup"
|
|
||||||
|
|
||||||
weave_on $HOST1 launch
|
|
||||||
weave_on $HOST2 launch $HOST1
|
|
||||||
|
|
||||||
start_container $HOST1 $C1/24 --name c1
|
|
||||||
|
|
||||||
assert "weave_on $HOST2 dns-lookup c1" $C1
|
|
||||||
|
|
||||||
end_suite
|
|
||||||
Executable
+12
@@ -0,0 +1,12 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
. ./config.sh
|
||||||
|
|
||||||
|
start_suite "Negative DNS queries"
|
||||||
|
|
||||||
|
weave_on $HOST1 launch
|
||||||
|
start_container_with_dns $HOST1 --name c1
|
||||||
|
assert_raises "exec_on $HOST1 c1 dig A foo.weave.local | grep 'status: NXDOMAIN'"
|
||||||
|
assert_raises "exec_on $HOST1 c1 dig A foo.invalid | grep 'status: NXDOMAIN'"
|
||||||
|
|
||||||
|
end_suite
|
||||||
Reference in new issue
Block a user