Deflake by retrying and adding random port numbers. We try 3 times to
get an instance.
Also fix a bug where server.Stop() was called even if the server
creation failed - this was never hit due to t.Fatal() above it, but fix
that nontheless.
Signed-off-by: Miek Gieben <miek@miek.nl>
* share plugins among zones in the same server block
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
* update caddy dep
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
* simp code
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
* copy ListenHosts and Debug from first config
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
* copy tls configs from first config
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
* add test to validate debug setting is replicated to all configs in block
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
* stop server
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
* core: fix v4 non-octet reverse zones
This fixes the reverse zones handling. Add expanstion of the reverse
notation to all octet boundary subnets and add those to the config - just as if
they were directly typed in the config.
This takes inspiration from #4501, but that (even with DCO!!) seems to
be just using https://github.com/apparentlymart/go-cidr/ so use that
instead - I think a minor function is still needed that one is copied
from #4501.
Also sort the zones we are listing on startup - caught in this PR
because of the expanded zones being not listed next to each other.
This also removes the need for FilterFunc from the config, so this is
now gone as well, making the whole thing slightly more efficient.
Add couple of reverse unit tests and a e2e test that queries for the
correct (and incorrect) reverse zones and checks the reply.
Closes: #4501Fixes: #2779
Signed-off-by: Miek Gieben <miek@miek.nl>
* Add more test cases
Add test from origin bug report: #2779
Signed-off-by: Miek Gieben <miek@miek.nl>
* Rebase and fix conflicts
Signed-off-by: Miek Gieben <miek@miek.nl>
* Move *proxy* to external
move the proxy plugin into coredns/proxy and remove it as a default
plugin. Link the proxy to deprecated in plugin.cfg
coredns/proxy doesn't compile because of the vendoring :(
Signed-off-by: Miek Gieben <miek@miek.nl>
* Add github.com/coredns/proxy
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* tests: CoreDNSServerAndPorts
Copy from kubernetes.go and renamed to fit the style, adapted almost
all callers.
This is a mechanicl change, no testdata was changed.
* typos
Create a small speedup running the tests:
PASS
ok github.com/miekg/coredns/test 10.329s
PASS
ok github.com/miekg/coredns/test 6.079s
Skip the etcd ones. Doing the middleware/*/*_test ones doesn't yield
any speedup as these are still done on a per directory basis.
Make the cache memory bounded, by using a LRU cache. Also split the
cache in a positive and negative one - each with its own controls.
Extend the cache stanza to allow for this:
cache {
positive limit [ttl]
negative limit [ttl]
}
is now possible. This also add a cache_test.go in the toplevel test/
directory that exercises the caching path.
Fixes#260
Cleanup the errors and removed deadcode along the way. The leaves
some error laying around, mostly about commenting exported identifier.
We should look hard if those really are needed.
Move all (almost all) Go files in middleware into their
own packages. This makes for better naming and discoverability.
Lot of changes elsewhere to make this change.
The middleware.State was renamed to request.Request which is better,
but still does not cover all use-cases. It was also moved out middleware
because it is used by `dnsserver` as well.
A pkg/dnsutil packages was added for shared, handy, dns util functions.
All normalize functions are now put in normalize.go
* Make CoreDNS a server type plugin for Caddy
Remove code we don't need and port all middleware over. Fix all tests
and rework the documentation.
Also make `go generate` build a caddy binary which we then copy into
our directory. This means `go build`-builds remain working as-is.
And new etc instances in each etcd test for better isolation.
Fix more tests and rework test.Server with the newer support Caddy offers.
Fix Makefile to support new mode of operation.
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