]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Add auth API tests
authorPieter Lexis <pieter.lexis@powerdns.com>
Tue, 9 Apr 2019 14:52:44 +0000 (16:52 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Mon, 6 May 2019 10:16:14 +0000 (12:16 +0200)
.circleci/config.yml
regression-tests.api/runtests
regression-tests.api/runtests.py

index e209390f6dd4ef0a7d7e4ecb57da05cf154a17b3..4a3a658d6cab340b9bed97f78edd1377b9789f90 100644 (file)
@@ -452,6 +452,22 @@ jobs:
       - auth-regress:
           context: lmdb-nsec3-narrow
 
+  test-auth-api:
+    docker:
+      - image: debian:stretch
+    steps:
+      - auth-regress-setup
+      - run: apt-get -y -qq install virtualenv sqlite3
+      - run:
+          name: Run API tests
+          workdir: ~/project/regression-tests.api
+          command: |
+            PDNSSERVER="/opt/pdns-auth/sbin/pdns_server" \
+            PDNSUTIL="/opt/pdns-auth/bin/pdnsutil" \
+            SDIG="/opt/pdns-auth/bin/sdig" \
+            ZONE2SQL="/opt/pdns-auth/bin/zone2sql" \
+            ./runtests authoritative
+
   build-recursor:
     docker:
       - image: debian:stretch
@@ -594,6 +610,9 @@ workflows:
   build-and-test-all:
     jobs:
       - build-auth
+      - test-auth-api:
+          requires:
+            - build-auth
       - test-auth-regress-odbc-sqlite3:
           requires:
             - build-auth
index dac34dd10d5385c337bfd851518b07b9abdf258d..6574536d177b000c5580df65957f9f308383c0cc 100755 (executable)
@@ -17,7 +17,9 @@ fi
 python -V
 pip install -r requirements.txt
 
-export SDIG=$(type -P sdig)
+if [ -z "${SDIG}" ]; then
+  export SDIG=$(type -P sdig)
+fi
 
 set -e
 if [ "${PDNS_DEBUG}" = "YES" ]; then
index 9263fcf19b7c7cccdd4568f3d477949ded1e2cfe..4ef9c1ca26ba2115a4ffd926dc072cca9c75d3d5 100755 (executable)
@@ -20,7 +20,7 @@ SQLITE_DB = 'pdns.sqlite3'
 WEBPORT = 5556
 DNSPORT = 5300
 APIKEY = '1234567890abcdefghijklmnopq-key'
-PDNSUTIL_CMD = ["../pdns/pdnsutil", "--config-dir=."]
+PDNSUTIL_CMD = [os.environ.get("PDNSUTIL", "../pdns/pdnsutil"), "--config-dir=."]
 
 NAMED_CONF_TPL = """
 # Generated by runtests.py
@@ -117,10 +117,12 @@ if not sdig or not os.path.exists(sdig):
 
 
 if daemon == 'authoritative':
+    zone2sql = os.environ.get("ZONE2SQL", "../pdns/zone2sql")
 
     # Prepare sqlite DB with some zones.
     run_check_call(["rm", "-f", SQLITE_DB])
-    run_check_call(["make", "-C", "../pdns", "zone2sql"])
+    if zone2sql == "../pdns/zone2sql":
+        run_check_call(["make", "-C", "../pdns", "zone2sql"])
 
     with open('../modules/gsqlite3backend/schema.sqlite3.sql', 'r') as schema_file:
         run_check_call(["sqlite3", SQLITE_DB], stdin=schema_file)
@@ -128,7 +130,7 @@ if daemon == 'authoritative':
     with open('named.conf', 'w') as named_conf:
         named_conf.write(NAMED_CONF_TPL)
     with tempfile.TemporaryFile() as tf:
-        p = subprocess.Popen(["../pdns/zone2sql", "--transactions", "--gsqlite", "--named-conf=named.conf"], stdout=tf)
+        p = subprocess.Popen([zone2sql, "--transactions", "--gsqlite", "--named-conf=named.conf"], stdout=tf)
         p.communicate()
         if p.returncode != 0:
             raise Exception("zone2sql failed")