X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=regression-tests.dnsdist%2Fdnsdisttests.py;h=8765ea58445658ea0ac95288b08f19d6933c98f8;hb=b61cf2574a1c5b668375cf75e41ab64ce028dc01;hp=32020b48affd22e40f8f5c39bcd5c8a1b903a275;hpb=5a992cbe90377644b11c1c5a10a11bb33ae68ab2;p=thirdparty%2Fpdns.git diff --git a/regression-tests.dnsdist/dnsdisttests.py b/regression-tests.dnsdist/dnsdisttests.py index 32020b48af..8765ea5844 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) @@ -548,6 +552,9 @@ class DNSDistTest(AssertEqualDNSMessageMixin, unittest.TestCase): if withCookies: for option in received.options: self.assertEquals(option.otype, 10) + else: + for option in received.options: + self.assertNotEquals(option.otype, 10) def checkMessageEDNSWithECS(self, expected, received, additionalOptions=0): self.assertEquals(expected, received)