]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Use _config_template and _config_template_default in the right way so common
authorOtto <otto.moerbeek@open-xchange.com>
Wed, 22 Dec 2021 09:42:57 +0000 (10:42 +0100)
committerOtto <otto.moerbeek@open-xchange.com>
Wed, 22 Dec 2021 14:41:14 +0000 (15:41 +0100)
settings get inherited if possible

pdns/syncres.cc
regression-tests.recursor-dnssec/test_ECS.py
regression-tests.recursor-dnssec/test_ExtendedErrors.py
regression-tests.recursor-dnssec/test_Lua.py
regression-tests.recursor-dnssec/test_RoutingTag.py

index 38fdb655366239c58bdab4a0694dbabfd0d1a1f8..a92c9c6d0c7623f9487e87d03dce3a18f4adbf0c 100644 (file)
@@ -104,9 +104,11 @@ int SyncRes::s_event_trace_enabled;
 
 #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];
index 9c3642b63e5b82f445e93845881ae93978c7bf1b..d619bc6547ef8a0799f1ea1a583c6391f8c813f4 100644 (file)
@@ -22,7 +22,6 @@ class ECSTest(RecursorTest):
 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
@@ -30,6 +29,9 @@ max-cache-ttl=600
 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):
@@ -536,21 +538,10 @@ class testECSWithProxyProtocoldRecursorTest(ECSTest):
 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
index 9ccaa0c5f2a2307481ed6a835c689c578730205b..1682644c9e643bc8d3278760c17d1645da2a0ee4 100644 (file)
@@ -7,21 +7,10 @@ from recursortests import RecursorTest
 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)
@@ -219,20 +208,9 @@ log-common-errors=yes
 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
 
index a0fb67a87dec3c941040715e436b5f1a79413b18..e5649533d7a1eed55e7a82c2f3bbf6558e294dde 100644 (file)
@@ -642,23 +642,13 @@ class PDNSValidationStatesTest(RecursorTest):
     """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
index a6da5bc623ce421eedc2330719e6f3cbd5949bdf..5b7b1b82ff554188fa867437a7440a7f4e2ad92c 100644 (file)
@@ -21,7 +21,6 @@ class RoutingTagTest(RecursorTest):
 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
@@ -29,6 +28,9 @@ max-cache-ttl=600
 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):
@@ -107,9 +109,8 @@ class testRoutingTag(RoutingTagTest):
     _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 = """
@@ -182,9 +183,8 @@ class testRoutingTagFFI(RoutingTagTest):
     _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 = """