]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: check-config now parses newServer's options, update our tests
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 24 Oct 2019 15:04:15 +0000 (17:04 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 12 Nov 2019 09:19:19 +0000 (10:19 +0100)
regression-tests.dnsdist/dnsdisttests.py
regression-tests.dnsdist/test_Routing.py

index 32020b48affd22e40f8f5c39bcd5c8a1b903a275..01eb5332edab98a2dc12818aba7df39f7b7a6ce4 100644 (file)
@@ -57,6 +57,7 @@ class DNSDistTest(AssertEqualDNSMessageMixin, unittest.TestCase):
     _healthCheckName = 'a.root-servers.net.'
     _healthCheckCounter = 0
     _answerUnexpected = True
+    _checkConfigExpectedOutput = None
 
     @classmethod
     def startResponders(cls):
@@ -91,7 +92,10 @@ class DNSDistTest(AssertEqualDNSMessageMixin, unittest.TestCase):
             output = subprocess.check_output(testcmd, stderr=subprocess.STDOUT, close_fds=True)
         except subprocess.CalledProcessError as exc:
             raise AssertionError('dnsdist --check-config failed (%d): %s' % (exc.returncode, exc.output))
-        expectedOutput = ('Configuration \'%s\' OK!\n' % (confFile)).encode()
+        if cls._checkConfigExpectedOutput is not None:
+          expectedOutput = cls._checkConfigExpectedOutput
+        else:
+          expectedOutput = ('Configuration \'%s\' OK!\n' % (confFile)).encode()
         if output != expectedOutput:
             raise AssertionError('dnsdist --check-config failed: %s' % output)
 
index 386fba655f91ce2d8235e620cae1ac5283233e40..70deba8f3c43e2d377165749baccf730a6a65802 100644 (file)
@@ -513,6 +513,10 @@ class TestRoutingBadWeightWRandom(DNSDistTest):
     s1 = newServer{address="127.0.0.1:%s", weight=-1}
     s2 = newServer{address="127.0.0.1:%s", weight=2147483648}
     """
+    _checkConfigExpectedOutput = b"""Error creating new server: downstream weight value must be greater than 0.
+Error creating new server: downstream weight value must be between 1 and 2147483647
+Configuration 'configs/dnsdist_TestRoutingBadWeightWRandom.conf' OK!
+"""
 
     def testBadWeightWRandom(self):
         """