]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Update the backend discovery tests 12648/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 15 Mar 2023 10:01:46 +0000 (11:01 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 15 Mar 2023 10:01:46 +0000 (11:01 +0100)
The output of `showServers()` has been modified, and these tests
parse it to know whether a backend has been correctly upgraded.

regression-tests.dnsdist/test_BackendDiscovery.py

index f8b1f14041e72953fe94fdbb19afb30cc26a9c5a..df54c74e381515c769566e5655e46fcdd867e0d7 100644 (file)
@@ -356,7 +356,7 @@ class TestBackendDiscovery(DNSDistTest):
             if line.startswith('#') or line.startswith('All'):
                 continue
             tokens = line.split()
-            self.assertTrue(len(tokens) == 12 or len(tokens) == 13)
+            self.assertTrue(len(tokens) == 13 or len(tokens) == 14)
             if tokens[1] == '127.0.0.1:10652':
                 # in this particular case, the upgraded backend
                 # does not replace the existing one and thus
@@ -365,8 +365,8 @@ class TestBackendDiscovery(DNSDistTest):
             else:
                 self.assertEquals(tokens[2], 'UP')
             pool = ''
-            if len(tokens) == 13:
-                pool = tokens[12]
+            if len(tokens) == 14:
+                pool = tokens[13]
             backends[tokens[1]] = pool
 
         expected = {