From: Remi Gacogne Date: Thu, 24 Oct 2019 15:04:15 +0000 (+0200) Subject: dnsdist: check-config now parses newServer's options, update our tests X-Git-Tag: auth-4.3.0-beta1~33^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f73ce0e36a42694dd087adf6eeb5f7e4f5b21ace;p=thirdparty%2Fpdns.git dnsdist: check-config now parses newServer's options, update our tests --- diff --git a/regression-tests.dnsdist/dnsdisttests.py b/regression-tests.dnsdist/dnsdisttests.py index 32020b48af..01eb5332ed 100644 --- a/regression-tests.dnsdist/dnsdisttests.py +++ b/regression-tests.dnsdist/dnsdisttests.py @@ -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) diff --git a/regression-tests.dnsdist/test_Routing.py b/regression-tests.dnsdist/test_Routing.py index 386fba655f..70deba8f3c 100644 --- a/regression-tests.dnsdist/test_Routing.py +++ b/regression-tests.dnsdist/test_Routing.py @@ -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): """