aboutsummaryrefslogtreecommitdiff
path: root/plugin/dnstap/handler_test.go (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-07-10add golangci-lint linter (#5499)Gravatar Ondřej Benkovský 1-2/+1
2021-01-24Fix import ordering presubmit test (#4422)Gravatar Miek Gieben 1-0/+1
Automatically submitted.
2021-01-20Fix some typos (#4412)Gravatar ZouYu 1-2/+2
Signed-off-by: zouyu <zouy.fnst@cn.fujitsu.com>
2020-10-12plugin/dnstap: various cleanups (#4179)Gravatar Miek Gieben 1-69/+37
* plugin/dnstap: various cleanups A recent issue made me look into this plugin, I suspect various other cleanups (hopefully deletion of code) can be made as well Remove identical functions ToClientQuery etc, and just use tap.Message as the base type in plugin. Keep msg/ for a few helper functions that may proof useful. This remove the whole test directory as we will just check the things we are interested in which gives much better feedback and keeps that code closer together. tapwr dir is also not needed, writer_test.go was just duplicating the tests already done. This moves writer.go to the top directory. Make the only user of dnstap, the forward plugin, use the newer code also remove the test, a better test there would be a full e2e test to see the correct thing happens. Cleanup the Tapper interface and move it to dnstapio where it belongs, remove higher level interfaces that are not used. This remove dnstap.Tapper and dnstap.IORoutines. Use the standard mechanism for getting access to a plugin and remove shuffling the plugin into the context. Signed-off-by: Miek Gieben <miek@miek.nl> * use opts to get the correct proto Signed-off-by: Miek Gieben <miek@miek.nl> * Various fixes Signed-off-by: Miek Gieben <miek@miek.nl> * Remove bad addr test, as dnstap is only called from within coredns where these fields have been preparsed Signed-off-by: Miek Gieben <miek@miek.nl> * dnstap: remove saving the error all these fields have been preparsed, no need for dnstap to be pedantic and check (and save!) this error again. Simplifies it a bit more. Signed-off-by: Miek Gieben <miek@miek.nl> * Update plugin/forward/dnstap.go Co-authored-by: Ruslan Drozhdzh <30860269+rdrozhdzh@users.noreply.github.com> * Code review Signed-off-by: Miek Gieben <miek@miek.nl> * add back in preferUDP Signed-off-by: Miek Gieben <miek@miek.nl> * nit Signed-off-by: Miek Gieben <miek@miek.nl> Co-authored-by: Ruslan Drozhdzh <30860269+rdrozhdzh@users.noreply.github.com>
2018-06-02presubmit: Check errorf as well (#1845)Gravatar Miek Gieben 1-1/+1
Uppercase all these test errors as well. And extend the presubmit to check for these in the future. Also do a slightly smarter grep to only get t.<something>. as (because dump regexp) this also grep over non test files.
2018-05-07presubmit: check for uppercase (#1774)Gravatar Miek Gieben 1-2/+2
Another thing we can test automatically, we sorta settled on using an uppercase letter in in t.Log and t.Fatal calls. Let's just check for this.
2018-04-22all: fix plugin import ordering (#1717)Gravatar Miek Gieben 1-3/+1
Got a bit messed up with stb lib "context" usage.
2018-04-20global: move to context (#1699)Gravatar Miek Gieben 1-1/+2
* global: move to context Move from golang.org/x/net/context to std lib's context. Change done with: for i in $(grep -l '/context' **/*.go); do sed -e 's|golang.org/x/net/context|context|' -i $i; echo $i; done for i in **/*.go; do goimports -w $i; done * drop from dns.pb.go as well
2018-02-28Easier way to dnstap? (#1496)Gravatar varyoo 1-4/+63
* Easier way to dnstap? * Remove unnecessary function parameter from Tapper * golint * golint 2 * Proxy dnstap tests * README.md & doc * net.IP * Proxy test was incorrect * Small changes * Update README.md * Was not reporting dnstap errors + test * Wasn't working at all, now it's ok * Thanks Travis
2017-09-26Adds the dnstap I/O routines and should fix some issues (#1083)Gravatar varyoo 1-13/+6
* adds the dnstap I/O thread and should fix a lot of mistakes * docs * -race test * oops * docs
2017-09-14Remove the word middleware (#1067)Gravatar Miek Gieben 1-0/+65
* 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