Commit Graph
84 Commits
Author SHA1 Message Date
Matthias Radestock 44a4dd9888 cosmetic: go vet 2015-03-26 18:36:00 +00:00
Bryan Boreham 7a4a88aeb9 Remove unused unnamed second item in ranges 2015-03-26 18:04:57 +00:00
Matthias Radestock 45740b1419 refactor: replace buf.WriteString(fmt.S*(...)) with fmt.F*(&buf,...)
shorter and more efficient
2015-03-26 14:20:28 +00:00
Matthias Radestock e7335f361c refactor: move a func that is only used in testing 2015-03-26 13:53:09 +00:00
Adam Harrison efb7c0f1bc gofmt 2015-03-26 10:54:46 +00:00
Adam Harrison 066d8001dd Merge pull request #482 from rade/475-simplify-actors
simplify actors
2015-03-25 11:58:41 +00:00
Matthias Radestock 0e43a30858 convert MDNSClient actor to use closures for methods
We use a 'nil' closure to indicate shutdown.
2015-03-25 05:14:17 +00:00
Michael Bridgen 075d9a007c Merge branch 'weave-225' of https://github.com/inercia/weave into pr429 2015-03-24 16:47:38 +00:00
Matthias Radestock 8c3b161bd3 cosmetic 2015-03-24 14:41:20 +00:00
Alvaro Saurin 9dcec8ca16 basic DNS cache
unit tests
2015-03-24 12:44:01 +01:00
Michael Bridgen f64876a64b Increment the server port for each test
Occasionally the test servers overlap and the test will fail with
"address already in use".
2015-03-23 12:02:43 +00:00
Adam Harrison fcab4ee239 Truncate container IDs to twelve characters 2015-03-18 17:56:58 +00:00
Adam Harrison d23a6c86c3 Merge branch 'master' into 237_add_dns_to_weave_status
Conflicts:
	nameserver/http.go
2015-03-18 11:58:39 +00:00
Adam Harrison bae6865e33 Rename URL parameter 2015-03-18 11:45:04 +00:00
Adam Harrison bd7b232663 Replace hand parsing and validation of URLs with Gorilla mux 2015-03-18 10:10:13 +00:00
Adam Harrison 8f675f15c0 Revert Gorilla mux introduction 2015-03-17 17:52:39 +00:00
Adam Harrison 0f492b563e Fix test compilation
Tests weren't compiling due to change of ListenHttp() signature. Fixed
for now by reintroducing domain parameter in addition to server, as this
allows the HTTP tests to pass in a nil server parameter. In the long
term DNSServer should probably become an interface so we can mock it
easily in such a scenario.
2015-03-17 17:42:16 +00:00
Adam Harrison c36543a247 Include DNS server config in status 2015-03-17 15:41:01 +00:00
Adam Harrison 6f57774d15 Include zone records in status 2015-03-17 15:02:09 +00:00
Adam Harrison 50f6402774 Include DNS version and domain in status 2015-03-17 14:28:26 +00:00
Adam Harrison 9ce26e6973 Replace hand parsing and validation of URLs with Gorilla mux 2015-03-17 13:49:26 +00:00
Matthias Radestock 123e8bbb28 reduce likelihood of IP clashes in tests & examples
by using the 10.2 range, which is not one used by docker and also is
less likely than 10.0 to be used by something else.

Fixes #402.
2015-03-09 20:51:26 +00:00
David Wragg cda6b8d582 Fix a few deviations from go fmt 2015-03-05 13:56:21 +00:00
Matthias Radestock 6c82f781cd trim some logging from tests 2015-03-02 17:02:10 +00:00
Matthias Radestock 6d69ac5532 refactor and tweak dns tests
- extract helper function
- use "lots and lots of MX records" instead of "lots of TXT records"
  for testing large response
- calculate on the fly the number of records we need to generate a
  large response
- don't hardcode "weave.works"
2015-03-02 16:56:10 +00:00
Alvaro Saurin 4682f7ed95 zettio/weave#366 - removed reference to DNSServerConfig in the DNSServer struct 2015-02-27 15:40:32 +01:00
Alvaro Saurin 007873a402 zettio/weave#366 - keep the DNSServerConfig inmutable 2015-02-27 12:22:08 +01:00
Alvaro Saurin 0bc3e333f8 zettio/weave#366 - minor: fixed a typo and removed some superfluous code 2015-02-26 10:51:48 +01:00
Alvaro Saurin 403520f4b6 zettio/weave#366 - move more initialization code to the constructor 2015-02-26 10:51:48 +01:00
Alvaro Saurin bbd69170f9 zettio/weave#366 - improved configuration for th DNSServer, where we can specify the local domain name among other things... (missing some unit tests for this customized local domain) 2015-02-26 10:51:48 +01:00
Alvaro Saurin c575023681 zettio/weave#362 - command line arg for using a specific fallback DNS server 2015-02-23 13:17:54 +01:00
Alvaro Saurin 419138ec6a zettio/weave#362 - use a WaitGroup for the TCP/UDP goroutines: otherwise, WeaveDNS server just quits 2015-02-23 13:17:54 +01:00
Alvaro Saurin f8b3c86498 zettio/weave#362 - properly test the TCP-retry mechanism by creating fallback servers that return truncated responses with UDP but not with TCP 2015-02-23 13:17:54 +01:00
Alvaro Saurin 3de924fa2f zettio/weave#362 - moved Check*() to common 2015-02-23 13:17:54 +01:00
Alvaro Saurin 5dd475b2e5 zettio/weave#362 - fix DNSServer initialization
removed a couple of goroutines spawns...
2015-02-23 13:17:54 +01:00
Alvaro Saurin ef72d65aa4 zettio/weave#362 - use for fallback queries the same protocol clients have used for querying us. 2015-02-23 13:17:54 +01:00
Alvaro Saurin 9c7ffd9b81 zettio/weave#362 - improve the unit tests for the TCP server by checking if we get all the responses with TCP when a previous UDP query resulted in a truncated response. 2015-02-23 13:17:54 +01:00
Alvaro Saurin bf88ed8d96 zettio/weave#362 - unit test for TCP requests to our DNS server 2015-02-23 13:17:54 +01:00
Alvaro Saurin c81769cc9a zettio/weave#362 - implement a graceful shutdown 2015-02-23 13:17:54 +01:00
Alvaro Saurin c1f9c8bc10 zettio/weave#362 - new constructor for creating a DNS server with a given config
fix unit tests by using the new constructor
2015-02-23 13:17:54 +01:00
Alvaro Saurin 3be5600383 zettio/weave#362 - reorganize the DNS server code, so it looks like the mDNS server, with a proper class with Start() and so...
Listen on TCP on port 53 by default
2015-02-23 13:17:54 +01:00
Michael Bridgen 1f9e321097 Merge branch '360_dns_buffer' of https://github.com/bboreham/weave into pr361 2015-02-04 16:35:14 +00:00
Bryan Boreham 04a7aa1405 Use buffer size 4096 on advice from a DNS expert 2015-02-04 14:58:21 +00:00
Matthias Radestock 9c3d509b10 cosmetics
suggested by linter
2015-02-03 14:46:35 +00:00
Bryan Boreham 458ef12da6 Use a larger buffer than the default, so that more queries will succeed 2015-02-02 13:26:44 +00:00
Bryan Boreham e5a08a505d Change DNS fallback test to use a locally-run server to generate long responses reliably 2015-02-02 13:24:37 +00:00
Bryan Boreham 9ae3f4c692 Only read /etc/resolv.conf once 2015-02-02 13:16:05 +00:00
Michael Bridgen db9bae4162 Use the fallback for reverse lookups too
I considered a couple of different factorings, that is

 * Implementing the fallback as a Lookup
 * Having a server struct that held the resolv.conf and methods for
   handling queries

but ultimately, this is simple and works.
2015-01-14 16:44:12 +00:00
Michael Bridgen fd90212db4 Get the format string right 2015-01-14 13:37:10 +00:00
Michael Bridgen ff45bcf945 Change Lookup method names
The Local was redundant (and inaccurate in the case of the mDNS client
implementation), and otherwise they are too nondescript.
2015-01-12 17:42:23 +00:00