Commit Graph

72 Commits

Author SHA1 Message Date
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
Michael Haro 9e96f28311 Fix problems noted by 'go vet' 2015-02-19 00:08:28 -08:00
Filippo Valsorda 17a90cfd68 Tests: fix TestShutdownTCP race using NotifyStartedFunc 2014-12-17 13:46:50 +00:00
Filippo Valsorda e613ea6d07 Tests: silence a data race detected during server tests 2014-12-06 10:27:29 +00:00
Filippo Valsorda ddb0b0f565 Tests: wait for the server to be started before proceeding 2014-12-06 10:27:29 +00:00
Miek Gieben cd2048a15a Add Unsafe member to dns.Server
This stops it from checking if the incoming requests have the QR bit
unset, so be careful when enabling this. This can be useful in
combination with mDNS.

Also the check for only 1 question in the question section is relaxed
to be "at least one", even without setting Unsafe!

Also update TestServingResponse to test for Unsafe vs not using Unsafe.
2014-11-19 16:34:18 +00:00
Miek Gieben 5fc7e36983 go test -short
Added a bunch a long running test function to the list of skipped
tests when giving -short to go test. Tests are bascially *all*
DNSSEC key generation tests and 1 serving test.

PASS
ok      github.com/miekg/dns    0.782s

Compared to 13+ s, so quite a bit faster.
2014-11-12 10:19:20 +00:00
Miek Gieben d33af8db79 Update test and gofmt 2014-11-09 16:09:49 +00:00
Miek Gieben d8da4d2fa7 Fix: drop requests with *cough* qr set.
Err, yeah.
2014-10-19 09:36:26 +00:00
Miek Gieben 0aa3021a83 Remove all copyright notices
Use the central COPYRIGHT file.
2014-09-11 20:57:37 +01:00
Alex Sergeyev 3489112d72 Addressed #115 (default mux should be cleaned after tests) 2014-08-30 09:45:30 -04:00
Alex Sergeyev de77e9d14d Removed Goshed from RunXXXTestServer and...
only used it for shutdown tests where it makes sense.
2014-08-30 09:35:54 -04:00
Alex Sergeyev c618657d9b Dealt with race condition detector warnings:
* stopped obvious race condition with replacing handler in
  ServingLargeResponses test
* lowered probability of other race conditions with test code
  while test server is yet activating
* fixed errmessage in Shutdown
2014-08-29 14:10:05 -04:00
Alex Sergeyev f735bb9dcb Changed how shutdown works...
Now stopXXX event will stop any reading on currently open
socket and terminate reading loop. No special client/server
message is required anymore.
2014-08-29 12:24:11 -04:00
Alex Sergeyev 87f8764f43 Added a comment about shutdown tests 2014-08-29 08:37:32 -04:00
Alex Sergeyev 32d6e5396e Continued removing Sleeping tests:
* incorporated @miekg suggestions on switch vs if
* for now moved reaction to stopXXX channel messages until
  after the packet is responded to avoid client timeout in
  Shutdown (causing 2 sec. hanged thread)

Still not great how the abort logic is implemented....
2014-08-29 08:31:27 -04:00
Alex Sergeyev 4b21f37064 Proposed way of creating no-timeout tests and...
... fix for Server.Shutdown() function.
2014-08-28 23:11:49 -04:00
Miek Gieben eed2b9aeec Fix Shutdown 2014-08-19 21:56:37 +01:00
Miek Gieben f912994258 Don't relay on deadline to stop the server.
We just send ourselves an UDP or TCP packet so that the listener fails
through and picks up the quit bool send on the channel.
2014-08-19 21:46:00 +01:00
Miek Gieben 263a337674 Change test ports, stuff might still be running 2014-08-19 09:33:50 +00:00
Miek Gieben 6c631cd4ff Implement Shutdown()
This is working for TCP, but for UDP the Read does not honor the
deadline settings.
2014-08-19 09:25:41 +00:00
Miek Gieben f5fe400c53 Lowercase all test output.
Add Shutdown tests as well
2014-08-19 08:39:04 +00:00
Miek Gieben f3a6c86462 Implement Shutdown() call
And fix some tests to call Fatal().
2014-08-18 22:06:29 +01:00
Egon Elbre dc06b3bde1 undo some changes 2014-07-17 20:48:28 +03:00
Egon Elbre 1d5e55d9b6 Fix: UDP serving on windows, UDP serving test paniced
Also, replaced t.Error/t.Fail with t.Fatal in some places.
2014-07-17 13:14:50 +03:00
Miek Gieben 28d936c032 disable ipv6 test until I know how to check for v6 conn. 2014-07-09 07:23:54 +01:00
Miek Gieben d09d1781e8 Add v6 benchmarking test.
Mostly to exercise the v6 serving path (of which most lies in the
standard library). But it also is a good test of v6 functionality.
2014-07-08 14:15:08 +00:00
Miek Gieben 6f477021c0 Make race detector not fire on this simple test
Do the standard Lock()/modify/Unlock() dance.
2014-02-28 15:57:10 +00:00
Miek Gieben 09b05ded46 Remove external DNS dependency
This makes the test run 10x faster and does not require internet
access for running the tests.
2014-02-15 08:03:40 +00:00
Miek Gieben e81b46d580 Add client.UDPsize
This allows a client to set a default UDPSize with resorting to EDNS0
headers 'n stuff.
2014-02-14 22:14:41 +00:00
Miek Gieben 3fca11e695 Add test to see that udp client is too large 2014-02-14 21:53:00 +00:00
Miek Gieben dd35496669 dont care about padding for benchmark function 2014-01-29 07:56:21 +00:00
Miek Gieben 509a6ff9e2 Revert "Revert "Fix benchmark alignment""
This reverts commit b8e6bd45be.
2014-01-29 07:52:23 +00:00
Miek Gieben b8e6bd45be Revert "Fix benchmark alignment"
This reverts commit 008dfb4ee8.
2014-01-28 22:43:57 +00:00
Alex Ciuba 008dfb4ee8 Fix benchmark alignment 2014-01-27 17:40:57 -05:00
Miek Gieben 560a1c65b0 update license in pool.go
remove some build lines as I have no idea what they are
supposed to be doing.
2014-01-06 10:00:25 +00:00
Andrew Tunnell-Jones 33c8fd7aec Test ServeMux's case folding 2013-12-14 09:44:36 +00:00
Miek Gieben 4c55d0d65f tweaks comment 2013-10-19 11:52:15 +01:00
Miek Gieben 610cabc412 Make it fatal when the server cannot start 2013-10-19 10:05:12 +01:00
Eric Gavaletz 41945815b8 Further patching for GAE compatibility.
Since net.ListenTCP, net.ListenUDP and net.TCPListener are not defined
in the GAE standard library these build flags will stop those files from
being imported.  A better solution would have been to break up this
monolithic package into smaller parts.
2013-10-02 11:50:35 -04:00
Miek Gieben dbef97abad Add MixCase query test
As reported by Ask, these aren't correctly handled :(
2013-07-25 07:55:59 +01:00
Miek Gieben f269acba7e Add compression serving benchmark-test 2013-06-27 20:29:10 +01:00
Miek Gieben 5ae9b5214f more testing and concurrent server benchmarking 2013-06-22 08:55:30 +01:00
Miek Gieben f595bf7a06 Set license on test files 2013-05-12 16:09:52 +02:00
Miek Gieben 5537ac771d Recheck the server mux match logic
And a test to make sure it all works. The root zone can still
be configured as a last resort (wildcard) match.
2013-05-12 15:56:12 +02:00
Miek Gieben 235e892dfc Rename the RR types drop the RR_ prefix
This is also done in the official Go library. It also make the
code shorter.
2012-12-09 19:23:25 +01:00
Miek Gieben 4e2af5cdb1 gofmt 2012-11-19 16:17:13 +01:00
Miek Gieben fa8a5e5757 Fix the tests + gofmt 2012-11-19 16:15:03 +01:00
Miek Gieben 1b7b7d6f74 add more testcases 2012-09-18 08:19:06 +02:00