#define LOG(x) if(d_lm == Log) { g_log <<Logger::Warning << x; } else if(d_lm == Store) { d_trace << x; }
-// A helper function to print a double with specific precsision
-// Not using boost::format since it is not thread safe while calling into locale handling code according to tsan
-// This allocates a string, but that's nothing compared to what boost::format is doing
+// A helper function to print a double with specific printf format.
+// Not using boost::format since it is not thread safe while calling
+// into locale handling code according to tsan.
+// This allocates a string, but that's nothing compared to what
+// boost::format is doing and maybe even gets optimized away anyway.
static inline std::string fmtfloat(const char* fmt, double f)
{
char buf[20];
daemon=no
trace=yes
dont-query=
-ecs-add-for=0.0.0.0/0
local-address=127.0.0.1
packetcache-ttl=0
packetcache-servfail-ttl=0
threads=1
loglevel=9
disable-syslog=yes
+log-common-errors=yes
+statistics-interval=0
+ecs-add-for=0.0.0.0/0
"""
def sendECSQuery(self, query, expected, expectedFirstTTL=None, scopeZeroResponse=None):
class testTooLargeToAddZeroScope(RecursorTest):
_confdir = 'TooLargeToAddZeroScope'
- _config_template_default = """
+ _config_template = """
use-incoming-edns-subnet=yes
dnssec=validate
-daemon=no
-trace=yes
-packetcache-ttl=0
-packetcache-servfail-ttl=0
-max-cache-ttl=15
-threads=1
-loglevel=9
-disable-syslog=yes
-log-common-errors=yes
"""
- _config_template = """
- """
_lua_dns_script_file = """
function preresolve(dq)
if dq.qname == newDN('toolarge.ecs.') then
class ExtendedErrorsRecursorTest(RecursorTest):
_confdir = 'ExtendedErrors'
- _config_template_default = """
+ _config_template = """
dnssec=validate
-daemon=no
-trace=yes
-packetcache-ttl=0
-packetcache-servfail-ttl=0
-max-cache-ttl=15
-threads=1
-loglevel=9
-disable-syslog=yes
-log-common-errors=yes
+extended-resolution-errors=yes
"""
- _config_template = """
- extended-resolution-errors=yes
- """
_lua_config_file = """
rpzFile('configs/%s/zone.rpz', { policyName="zone.rpz.", extendedErrorCode=15, extendedErrorExtra='Blocked by RPZ!'})
""" % (_confdir)
class NoExtendedErrorsRecursorTest(RecursorTest):
_confdir = 'ExtendedErrorsDisabled'
- _config_template_default = """
-dnssec=validate
-daemon=no
-trace=yes
-packetcache-ttl=0
-packetcache-servfail-ttl=0
-max-cache-ttl=15
-threads=1
-loglevel=9
-disable-syslog=yes
-log-common-errors=yes
-"""
_config_template = """
- extended-resolution-errors=no
+dnssec=validate
+extended-resolution-errors=no
"""
_roothints = None
"""Tests that we have access to the validation states from Lua"""
_confdir = 'validation-states-from-lua'
- _config_template_default = """
+ _config_template = """
dnssec=validate
-daemon=no
-trace=yes
-packetcache-ttl=0
-packetcache-servfail-ttl=0
-max-cache-ttl=15
-threads=1
-loglevel=9
-disable-syslog=yes
-log-common-errors=yes
"""
_roothints = None
_lua_config_file = """
"""
- _config_template = """
- """
+
_lua_dns_script_file = """
function postresolve (dq)
if pdns.validationstates.Indeterminate == nil or
daemon=no
trace=yes
dont-query=
-ecs-add-for=0.0.0.0/0
local-address=127.0.0.1
packetcache-ttl=0
packetcache-servfail-ttl=0
threads=1
loglevel=9
disable-syslog=yes
+log-common-errors=yes
+statistics-interval=0
+ecs-add-for=0.0.0.0/0
"""
def sendECSQuery(self, query, expected, expectedFirstTTL=None):
_confdir = 'RoutingTag'
_config_template = """
-log-common-errors=yes
use-incoming-edns-subnet=yes
-edns-subnet-whitelist=ecs-echo.example.
+edns-subnet-allow-list=ecs-echo.example.
forward-zones=ecs-echo.example=%s.24
""" % (os.environ['PREFIX'])
_lua_dns_script_file = """
_confdir = 'RoutingTagFFI'
_config_template = """
-log-common-errors=yes
use-incoming-edns-subnet=yes
-edns-subnet-whitelist=ecs-echo.example.
+edns-subnet-allow-list=ecs-echo.example.
forward-zones=ecs-echo.example=%s.24
""" % (os.environ['PREFIX'])
_lua_dns_script_file = """