From: Christian Hofstaedtler Date: Sat, 29 Oct 2016 13:36:38 +0000 (+0200) Subject: Add test demonstrating issue #4328 X-Git-Tag: dnsdist-1.1.0-beta2~41^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a21e85669c4abe1ceaf8b07626aef3d102b68dd9;p=thirdparty%2Fpdns.git Add test demonstrating issue #4328 Where, when bindbackend is loaded, serials show up as zero in domain listing. --- diff --git a/regression-tests.api/.gitignore b/regression-tests.api/.gitignore index 3277e4715d..11b8420d1c 100644 --- a/regression-tests.api/.gitignore +++ b/regression-tests.api/.gitignore @@ -10,3 +10,4 @@ /acl.list /recursor.conf /rec-conf.d +/bindbackend.conf diff --git a/regression-tests.api/runtests.py b/regression-tests.api/runtests.py index 97efcf3a63..61f55744af 100755 --- a/regression-tests.api/runtests.py +++ b/regression-tests.api/runtests.py @@ -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() diff --git a/regression-tests.api/test_Zones.py b/regression-tests.api/test_Zones.py index e9bd832116..5ef562195f 100644 --- a/regression-tests.api/test_Zones.py +++ b/regression-tests.api/test_Zones.py @@ -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: