Commit Graph

20 Commits

Author SHA1 Message Date
Tom Thorogood 33e64002b6
Support TsigProvider for Server and Transfer (#1331)
Automatically submitted.
2022-02-05 00:23:49 +00:00
Tom Thorogood 0e1c4e69dd
Support generic net.PacketConn's for the Server (#1174)
* Support generic net.PacketConn's for the Server

This commit adds support for listening on generic net.PacketConn's for
UDP DNS requests, previously *net.UDPConn was the only supported type.

In the event of a future v2 of this module, this should be streamlined.

* Eliminate wrapper functions around RunLocalXServerWithFinChan

* Eliminate RunLocalTCPServerWithTsig function

* Replace RunLocalTLSServer with a wrapper around RunLocalTCPServer

This reduces code duplication.

* Add net.PacketConn server tests

This provides coverage over nearly all of the newly added code (with
the unfortunate exception of (*response).RemoteAddr).

* Fix broken client_test.go tests

a433fbede4 was merged into master between this PR being opened and
being merged. This broke the CI tests in rather strange ways as the
code was being merged into master in a way that wasn't at all clear.
This commit fixes the two broken lines.
2020-10-25 02:23:01 +10:30
Tom Thorogood a3ad44419a
Fix XFR tests (#1188)
* Fix XFR tests

axfrTestingSuite returned the test function that was never actually
executed. These were broken from the beginning awkwardly, though the
test cases pass fine once fixed.

* Switch axfrTestingSuite argument order

*testing.T is customarily the first argument.
2020-10-24 13:58:44 +02:00
Florian Lehner 58a17b97a1 simplify loop (#1023)
Signed-off-by: Lehner Florian <dev@der-flo.net>
2019-10-05 14:24:46 +01:00
Nick McKinney 77c7d907b4 Set TSIG on Transfer Out (#939)
* Call SetTsig() Msg `r` if q.IsTsig() != nil to enable TSIG on AXFR.

* Add tests for xfr.go

* Fix data race condition setting server.TsigSecret

* Test cleanup: xfr_test.go

* Xfr Test cleanup: use exported `IsDuplicate()`, len(xfrTestData)
2019-05-12 09:15:21 +01:00
Miek Gieben afd3e95dbb
test: remove net tests (#616)
Never executed, flaky and failing now that some SIDN test servers
have been removed.

Just delete the code; hopefully we can bring it back one day in a CI
repo or something?
2018-01-05 13:11:23 +00:00
Miek Gieben e508eecd67
Some linter fixes from Go report card. (#601)
Implement small linter fixes.
2017-12-06 11:31:56 +00:00
Miek Gieben 348c84f37e
Test: remove all Logf/Log (#547)
Move some of them to Errorf and friends, but most of them are just
gone: This make go test -v actually readable.

Remove a bunch of test that used ipv6 on localhost as this does not work
on Travis.
2017-11-03 15:50:01 +00:00
Miek Gieben e78414ef75 xfr: return sane error when !RcodeSuccess (#496)
When the server returns a non succesful rcode, return that to the caller
in stead of the "bad soa" of before. "dns: bad xfr rcode: <RCODE>" is
now returned.

Fixes #467
2017-06-04 13:30:08 +01:00
Miek Gieben f520760857 Lowercase all error msg from the tests 2015-11-26 14:12:38 +00:00
Andrew Tunnell-Jones fe0937fa24 Merge sidnxfr_test.go into xfr_test.go
* Export tests in xfr_test.go
* Rename tests to be `go test -run` friendly
* Hide behind 'net' build tag
2015-08-23 07:31:06 +00:00
Michael Haro 4437868b75 Replace t.Logf("%s", var) with t.Log(var) 2015-02-26 00:30:40 -08:00
Michael Haro 2fb2a25e84 More test clean up
Remove trailing \n from t.Log and t.Error messages as it's unnecessary.

In some instances, combine multiple t.Error()s into one

To provide more consistency across the tests, rename e to err and use %v
as the format arg for errors.

Replace Logf and Errorf with Log and Error when it made sense.  For
example t.Errorf("%v", err) to t.Error(err)
2015-02-25 22:14:21 -08:00
Michael Haro f995f1aff3 Convert tests from being t.Log(..) then t.Fail() to just t.Error(...) as
t.Error(...) does both and makes it more clear which messages are errors
vs information log messages.
2015-02-23 17:43:07 -08:00
Miek Gieben acee6af0bc Merge branch 'master' of github.com:miekg/dns 2015-02-19 09:59:37 +00:00
Miek Gieben 67945c119e A bunch of golint fixes
The proposed vars names are a nono, because they break the API.
Things left: document each RR and zscan_rr.go has some funcky if-then-elses.
2015-02-19 09:58:33 +00:00
Michael Haro 9e96f28311 Fix problems noted by 'go vet' 2015-02-19 00:08:28 -08:00
Miek Gieben ebbe30ad4e axfr test is flaky
Off for now: can be turned on, but we need to up a local server
and xfr from there.
2015-01-23 07:15:26 +00:00
Miek Gieben 2efce5c9e0 Short tests 2015-01-21 18:26:30 +00:00
Miek Gieben d344ff065b Move all AXFR tests to their own file 2015-01-21 17:37:20 +00:00