aboutsummaryrefslogtreecommitdiff
path: root/test/etcd_test.go (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-03-18update all +build statements (#5271)Gravatar Qasim Sarfraz 1-1/+1
* update all +build statements Signed-off-by: MQasimSarfraz <syed.qasim.sarfraz@gmail.com> * remove old +build style Signed-off-by: MQasimSarfraz <syed.qasim.sarfraz@gmail.com>
2021-05-14Fix etcd to use v3.5.0-alpha.0 (#4628)Gravatar Jason Du 1-1/+1
Signed-off-by: Jason Du <xdu@infoblox.com>
2020-04-25Fix mixed indentation within tests (#3855)Gravatar Ambrose Chua 1-9/+9
Signed-off-by: Ambrose Chua <ambrose@chua.family>
2019-08-27plugin/etcd: fully move to go.etcd.io (#3215)Gravatar Miek Gieben 1-1/+1
This is needed as well to make it compile cleanly. Follow up to #3214. Manually removed github.com/coreos/etcd/ from go.mod Signed-off-by: Miek Gieben <miek@miek.nl>
2019-03-04Move *proxy* to external (#2651)Gravatar Yong Tang 1-1/+1
* 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>
2019-02-01support etcd credentials in etcd plugin (#2442)Gravatar Christophe de Carvalho 1-0/+10
* support etcd credentials in etcd plugin fixes #2441 * try to fix cleanup of authentication
2019-01-13Default to upstream to self (#2436)Gravatar Miek Gieben 1-7/+4
* Default to upstream to self This is a backwards incompatible change. This is a massive (cleanup) PR where we default to resolving external names by the coredns process itself, instead of directly forwarding them to some upstream. This ignores any arguments `upstream` may have had and makes it depend on proxy/forward configuration in the Corefile. This allows resolved upstream names to be cached and we have better healthchecking of the upstreams. It also means there is only one way to resolve names, by either using the proxy or forward plugin. The proxy/forward lookup.go functions have been removed. This also lessen the dependency on proxy, meaning deprecating proxy will become easier. Some tests have been removed as well, or moved to the top-level test directory as they now require a full coredns process instead of just the plugin. For the etcd plugin, the entire StubZone resolving is *dropped*! This was a hacky (but working) solution to say the least. If someone cares deeply it can be brought back (maybe)? The pkg/upstream is now very small and almost does nothing. Also the New() function was changed to return a pointer to upstream.Upstream. It also returns only one parameter, so any stragglers using it will encounter a compile error. All documentation has been adapted. This affected the following plugins: * etcd * file * auto * secondary * federation * template * route53 A followup PR will make any upstream directives with arguments an error, right now they are ignored. Signed-off-by: Miek Gieben <miek@miek.nl> * Fix etcd build - probably still fails unit test Signed-off-by: Miek Gieben <miek@miek.nl> * Slightly smarter lookup check in upstream Signed-off-by: Miek Gieben <miek@miek.nl> * Compilez Signed-off-by: Miek Gieben <miek@miek.nl>
2018-07-19Clean up tests logging (#1979)Gravatar Miek Gieben 1-3/+0
* Clean up tests logging This cleans up the travis logs so you can see the failures better. Older tests in tests/ would call log.SetOutput(ioutil.Discard) in a haphazard way. This add log.Discard and put an `init` function in each package's dir (no way to do this globally). The cleanup in tests/ is clear. All plugins also got this init function to have some uniformity and kill any (future) logging there in the tests as well. There is a one-off in pkg/healthcheck because that does log. Signed-off-by: Miek Gieben <miek@miek.nl> * bring back original log_test.go Signed-off-by: Miek Gieben <miek@miek.nl> * suppress logging here as well Signed-off-by: Miek Gieben <miek@miek.nl>
2018-06-30plugin/etcdv3: Add etcd v3 plugin (#1702)Gravatar Nitish Tiwari 1-7/+6
* Update dependencies and add etcdv3 client * Update etcd plugin to support etcd v3 clients Fixes #341
2018-06-01Extend presubmit to covert test and request (#1846)Gravatar Miek Gieben 1-1/+1
Fix the casing *and* fix use of context as we were still referencing the non-std lib context - no wondering how this could have worked...
2017-09-16More Middleware -> Plugin conversions (#1088)Gravatar Miek Gieben 1-2/+2
Forgot about these.
2017-09-14Remove the word middleware (#1067)Gravatar Miek Gieben 1-6/+6
* Rename middleware to plugin first pass; mostly used 'sed', few spots where I manually changed text. This still builds a coredns binary. * fmt error * Rename AddMiddleware to AddPlugin * Readd AddMiddleware to remain backwards compat
2017-08-24tests: CoreDNSServerAndPorts (#972)Gravatar Miek Gieben 1-6/+1
* 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
2017-08-14mw/kubernetes: remove federation and cidr (#916)Gravatar Miek Gieben 1-0/+1
* mw/kubernetes: remove federation and cidr Remove both as we have a corefile syntax change that handles cidr and remove federation because that is going to be its own middleware. * backwards incompat changes This PR: * removes cidr from kubernetes (core Corefile feature now) * removes federation from kubernets (comes back as new middleware) * [remove autopath - which was already gone, so that already was backwards incompat] * adds `fallthrough` to the *etcd* middleware and makes you enable it. * Fail on unknown properties * documentation * Disable TestHealthCheck as it uses realtime and fails
2017-02-22Fix import path `github.com/miekg/coredns` -> `github.com/coredns/coredns` ↵Gravatar Yong Tang 1-5/+5
(#547) This fix fixes import path from `github.com/miekg/coredns` -> `github.com/coredns/coredns`
2017-01-29Fix `go fmt`, `go lint`, and `go vet` issues (#494)Gravatar Yong Tang 1-2/+2
This fix fixes several `go fmt`, `go lint`, and `go vet` issues, to make goreportcard happy: https://goreportcard.com/report/github.com/miekg/coredns Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-01-15middleware/proxy: implement Exchanger (#480)Gravatar Miek Gieben 1-4/+3
By defining and using an proxy.Exchanger interface we make the proxy more generic and we can then fold back httproxy into proxy. This overrides #463 and #473 and should make futures extensions rather trivial * Add docs that talk about `protocol` and how to set it. * middleware/proxy: rename New to NewLookup It's used as a Lookup mechanism not as a completely new proxy, reflect that in the name. * Set maxfails to 3 by default when looking up names. Most of the changes have been copied from https://github.com/johnbelamaric/coredns/pull/1/files
2017-01-12Run tests in parallel (#478)Gravatar Miek Gieben 1-1/+1
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.
2016-10-18middleware/etcd: more tests (#342)Gravatar Miek Gieben 1-1/+1
Add a test which enables caching and debug queries and make sure the debug query does not overwrite the cache.
2016-10-02middleware/cache: split cache in positive and negative and use lru (#298)Gravatar Miek Gieben 1-2/+2
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
2016-09-07Cleanup: put middleware helper functions in pkgs (#245)Gravatar Miek Gieben 1-2/+2
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
2016-08-20Cleanup and fixes (#223)Gravatar Miek Gieben 1-2/+2
* Set version to 001 * Remove k8stest, test fails is k8s is not there: touch luck * Remove server directory: not used anymore * Disable k8s test (for now) * gometalinter changes
2016-08-19Make CoreDNS a server type plugin for Caddy (#220)Gravatar Miek Gieben 1-3/+8
* 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.
2016-08-08Fix stubzone retention (#198)Gravatar Miek Gieben 1-1/+94
Make the receiver a pointer so that the uptdateStubZones map update will retain the stubzones found, unlike the current case where the update will be applied and then promptly forgotten, because it is working on a copy. Add test/etcd_test.go to test a large part of the code. This didn't catch the chaos middleware hack though. The chaos middleware zones are now *not* automatically added. You have to take care of that by yourself (docs updates). When using debug queries and falling through to the next middleware in etcd, restore the original (with o-o.debug) query before passing it on.
2016-04-10Add TestServer (#102)Gravatar Miek Gieben 1-0/+11
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