Ruben Kerkhof [Thu, 19 Feb 2015 19:18:31 +0000 (20:18 +0100)]
Fix automake warnings for remotebackend testsuite
Define RECHECK_LOGS and TEST_EXTENSIONS outside of the UNIT_TESTS
conditional
Fixes the following warnings:
/usr/share/automake-1.14/am/check.am: warning: RECHECK_LOGS was already defined in condition UNIT_TESTS, which is included in condition TRUE ...
modules/remotebackend/Makefile.am:74: ... 'RECHECK_LOGS' previously defined here
modules/remotebackend/Makefile.am:62: warning: 'TEST_EXTENSIONS' cannot have conditional contents
Thomas D [Fri, 13 Feb 2015 12:33:23 +0000 (13:33 +0100)]
When test service startup timeout was reached kill (cleanup) still running test services
If curl for example isn't installed or fails to check the service status for any reason,
we need to kill the test service if still running to prevent any resource leak.
Thomas D [Fri, 13 Feb 2015 01:02:47 +0000 (02:02 +0100)]
Test services should log into their own log file
Each test has a general log file in the following schema:
remotebackend_<module>.log
When testrunner.sh spins up a service, the service logs its output
into the general log file. But test-driver from automake, which is
using the same log file and starts after the test service is up and
running, will overwrite the log file.
So in case of a server failure we will miss important log data.
Using a dedicated log file for the services we start will solve
this problem. The new schema for server log files will be
Thomas D [Fri, 13 Feb 2015 00:22:54 +0000 (01:22 +0100)]
automake: Use parallel test harness to prevent a parallel make issue
The http, post and json test are using the same TCP port. Because of
that we need to specify an execution order or we will get errors like
INFO WEBrick 1.3.1
INFO ruby 2.0.0 (2014-11-13) [x86_64-linux]
WARN TCPServer Error: Address already in use - bind(2)
WARN TCPServer Error: Address already in use - bind(2)
/usr/lib64/ruby/2.0.0/webrick/utils.rb:85:in `initialize': Address already in use - bind(2) (Errno::EADDRINUSE)
from /usr/lib64/ruby/2.0.0/webrick/utils.rb:85:in `new'
from /usr/lib64/ruby/2.0.0/webrick/utils.rb:85:in `block in create_listeners'
from /usr/lib64/ruby/2.0.0/webrick/utils.rb:82:in `each'
from /usr/lib64/ruby/2.0.0/webrick/utils.rb:82:in `create_listeners'
from /usr/lib64/ruby/2.0.0/webrick/server.rb:132:in `listen'
from /usr/lib64/ruby/2.0.0/webrick/server.rb:113:in `initialize'
from /usr/lib64/ruby/2.0.0/webrick/httpserver.rb:45:in `initialize'
from ./unittest_http.rb:184:in `new'
from ./unittest_http.rb:184:in `<main>'
when running the tests in parallel (`make -j5 check`).
Pieter Lexis [Tue, 10 Feb 2015 18:09:51 +0000 (19:09 +0100)]
JSON-API: Send 401 on bad API-Key
* Closes #2179
* We send an HTTP 401 (Unauthorized) when:
* The API Key is wrong
* The API Key is empty or missing
* Authentication failures are logged as Error (was Debug)
* Fix the API regression test to accept this 401 as valid
Peter van Dijk [Fri, 6 Jun 2014 10:43:27 +0000 (12:43 +0200)]
Merge work-in-progress Lua policy engine.
Some text from the Pull Request at the time of merge:
Should not break anything when not used; should not break anything when used
(assuming the loaded script is free of bugs). Example script may not be
entirely correct. Needs tests (dnsperf QPS is a fine KPI).
Run `git show <thiscommit> | grep FIXME` to see known issues.
Todo/evolution ideas:
Copy reload/unload behaviour from recursor (allow reloading different script,
don't replace running instance when loading fails due to syntax errors etc).
Related, make sure we do PASS when the police() call fails.
Add pdns-side metrics (drops/passes/truncates/lua errors) (probably some
actual breakage in the metrics area right now). Log (sample of) lua errors.
Call metrics() periodically (every second) and merge those into our own,
including carbon submission? Perhaps with incremental (number since last read)
vs. absolute flag (number since startup). If absolute, consider
'checkpointing' on script reload.
Call statsline() periodically (every X minutes) for a summary we can log?
Write wrapper (in Lua?) to allow loading policy scripts into recursor using
the hooks already present there (pre/postresolve).
bert hubert [Wed, 11 Feb 2015 16:00:21 +0000 (17:00 +0100)]
on Linux, SO_TIMESTAMP == SCM_TIMESTAMP, on at least FreeBSD, it is not, causing us to miss harvesting the timestamp, and dropping all packets as too old. With this change, we don't drop if we can't find the timestamp, plus harvest it properly