]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Add test demonstrating issue #4328
authorChristian Hofstaedtler <christian.hofstaedtler@deduktiva.com>
Sat, 29 Oct 2016 13:36:38 +0000 (15:36 +0200)
committerChristian Hofstaedtler <christian.hofstaedtler@deduktiva.com>
Mon, 31 Oct 2016 08:48:10 +0000 (09:48 +0100)
Where, when bindbackend is loaded, serials show up as zero in domain listing.

regression-tests.api/.gitignore
regression-tests.api/runtests.py
regression-tests.api/test_Zones.py

index 3277e4715d4d347ad030a03bd9c874825dfd9b49..11b8420d1c015e131260cbf5ea1bcf9ae31a7d1c 100644 (file)
@@ -10,3 +10,4 @@
 /acl.list
 /recursor.conf
 /rec-conf.d
+/bindbackend.conf
index 97efcf3a63ef615bd644ded9888c01118172025e..61f55744af3804b2760fa656819dda9d66c7a4cf 100755 (executable)
@@ -25,11 +25,15 @@ zone "cryptokeys.org" { type master; file "cryptokeys.org"; };
 
 AUTH_CONF_TPL = """
 # Generated by runtests.py
-launch=gsqlite3
+launch=gsqlite3,bind
 gsqlite3-dnssec=on
 gsqlite3-database="""+SQLITE_DB+"""
 module-dir=../regression-tests/modules
-#
+bind-config=bindbackend.conf
+"""
+
+BINDBACKEND_CONF_TPL = """
+# Generated by runtests.py
 """
 
 ACL_LIST_TPL = """
@@ -98,8 +102,11 @@ if daemon == 'authoritative':
         tf.seek(0, os.SEEK_SET)  # rewind
         subprocess.check_call(["sqlite3", SQLITE_DB], stdin=tf)
 
-    with open('pdns.conf', 'w') as named_conf:
-        named_conf.write(AUTH_CONF_TPL)
+    with open('bindbackend.conf', 'w') as bindbackend_conf:
+        bindbackend_conf.write(BINDBACKEND_CONF_TPL)
+
+    with open('pdns.conf', 'w') as pdns_conf:
+        pdns_conf.write(AUTH_CONF_TPL)
 
     subprocess.check_call(PDNSUTIL_CMD + ["secure-zone", "powerdnssec.org"])
     pdnscmd = ("../pdns/pdns_server --daemon=no --local-address=127.0.0.1 --local-port=5300 --socket-dir=./ --no-shuffle --dnsupdate=yes --cache-ttl=0 --config-dir=. --api=yes --webserver-port="+WEBPORT+" --webserver-address=127.0.0.1 --api-key="+APIKEY).split()
index e9bd832116195ff2cd12f96be7b83edd36a6a660..5ef562195f3bbf1ab9a96a8e75cd5b053838e149 100644 (file)
@@ -54,9 +54,11 @@ class Zones(ApiTestCase):
         example_com = [domain for domain in domains if domain['name'] in ('example.com', 'example.com.')]
         self.assertEquals(len(example_com), 1)
         example_com = example_com[0]
+        print(example_com)
         required_fields = ['id', 'url', 'name', 'kind']
         if is_auth():
             required_fields = required_fields + ['masters', 'last_check', 'notified_serial', 'serial', 'account']
+            self.assertNotEquals(example_com['serial'], 0)
         elif is_recursor():
             required_fields = required_fields + ['recursion_desired', 'servers']
         for field in required_fields: