mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 08:44:17 -04:00
Add TestServer (#102)
Add a fullblown testing server. This allows us to do integration tests. Also add a basic proxy test. Further tests will test etcd proxy and stub zone communication and other "wildish" configurations. Redo the server startup, so we can access the ports it listens on when it has started up (with dns.ActivateAndServer). Extend the .travis file to download etcd and test for that as well. Put integration tests in test dir
This commit is contained in:
@@ -40,36 +40,17 @@ func TestMultiLookup(t *testing.T) {
|
||||
sort.Sort(coretest.RRSet(resp.Ns))
|
||||
sort.Sort(coretest.RRSet(resp.Extra))
|
||||
|
||||
if resp.Rcode != tc.Rcode {
|
||||
t.Errorf("rcode is %q, expected %q", dns.RcodeToString[resp.Rcode], dns.RcodeToString[tc.Rcode])
|
||||
if !coretest.Header(t, tc, resp) {
|
||||
t.Logf("%v\n", resp)
|
||||
continue
|
||||
}
|
||||
|
||||
if len(resp.Answer) != len(tc.Answer) {
|
||||
t.Errorf("answer for %q contained %d results, %d expected", tc.Qname, len(resp.Answer), len(tc.Answer))
|
||||
t.Logf("%v\n", resp)
|
||||
continue
|
||||
}
|
||||
if len(resp.Ns) != len(tc.Ns) {
|
||||
t.Errorf("authority for %q contained %d results, %d expected", tc.Qname, len(resp.Ns), len(tc.Ns))
|
||||
t.Logf("%v\n", resp)
|
||||
continue
|
||||
}
|
||||
if len(resp.Extra) != len(tc.Extra) {
|
||||
t.Errorf("additional for %q contained %d results, %d expected", tc.Qname, len(resp.Extra), len(tc.Extra))
|
||||
t.Logf("%v\n", resp)
|
||||
continue
|
||||
}
|
||||
|
||||
if !coretest.CheckSection(t, tc, coretest.Answer, resp.Answer) {
|
||||
if !coretest.Section(t, tc, coretest.Answer, resp.Answer) {
|
||||
t.Logf("%v\n", resp)
|
||||
}
|
||||
if !coretest.CheckSection(t, tc, coretest.Ns, resp.Ns) {
|
||||
if !coretest.Section(t, tc, coretest.Ns, resp.Ns) {
|
||||
t.Logf("%v\n", resp)
|
||||
|
||||
}
|
||||
if !coretest.CheckSection(t, tc, coretest.Extra, resp.Extra) {
|
||||
if !coretest.Section(t, tc, coretest.Extra, resp.Extra) {
|
||||
t.Logf("%v\n", resp)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user