]> granicus.if.org Git - pdns/commitdiff
set up circleCI testing for auth+godbc+mssql
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Fri, 15 Mar 2019 13:24:58 +0000 (14:24 +0100)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Tue, 19 Mar 2019 11:47:09 +0000 (12:47 +0100)
.circleci/config.yml [new file with mode: 0644]
build-scripts/circleci.sh [new file with mode: 0755]

diff --git a/.circleci/config.yml b/.circleci/config.yml
new file mode 100644 (file)
index 0000000..5905c91
--- /dev/null
@@ -0,0 +1,80 @@
+version: 2.1
+
+commands:
+  auth-regress:
+    description: "run one auth regression context"
+    parameters:
+      skip:
+        type: string
+        default: ""
+      context:
+        type: string
+        default: ""
+    steps:
+      - run: |
+          cd regression-tests
+          [ -e ./vars ] && . ./vars
+          rm -rf tests/*/skip
+          for t in << parameters.skip >>
+          do
+            touch tests/$t/skip
+          done
+          ./start-test-stop 5300 << parameters.context >>
+
+jobs:
+  build:
+    docker:
+      - image: debian:stretch
+      - image: mcr.microsoft.com/mssql/server:2019-CTP2.2-ubuntu
+        environment:
+          - ACCEPT_EULA: Y
+          - SA_PASSWORD: 'SAsa12%%'
+
+    steps:
+      - checkout
+
+      - run:
+          name: install dependencies
+          command: ./build-scripts/circleci.sh debian-stretch-deps
+
+      - run:
+          name: autoconf
+          command: autoreconf -vfi
+
+      - run:
+          name: configure
+          command: ./configure --disable-lua-records --with-modules='bind gmysql godbc random'
+
+      - run:
+          name: build
+          command: make -j3 -k
+
+      - run:
+          name: test gsqlite3 odbc
+          command: ./build-scripts/circleci.sh configure-odbc-sqlite; cd regression-tests ; touch tests/verify-dnssec-zone/allow-missing ; GODBC_SQLITE3_DSN=pdns-sqlite3-1 ./start-test-stop 5300 godbc_sqlite3-nsec3
+
+      - run:
+          name: set up mssql odbc
+          command: ./build-scripts/circleci.sh configure-odbc-mssql ; echo 'create database pdns' | isql -v pdns-mssql-docker-nodb sa SAsa12%%
+
+      - run:
+          name: set up mssql odbc testing
+          command: |
+            cd regression-tests
+            echo 'export GODBC_MSSQL_PASSWORD=SAsa12%% GODBC_MSSQL_USERNAME=sa GODBC_MSSQL_DSN=pdns-mssql-docker' > ./vars
+
+      - auth-regress:
+          context: godbc_mssql-nodnssec
+          skip: 8bit-txt-unescaped
+      - auth-regress:
+          context: godbc_mssql
+          skip: 8bit-txt-unescaped
+      - auth-regress:
+          context: godbc_mssql-nsec3
+          skip: 8bit-txt-unescaped
+      - auth-regress:
+          context: godbc_mssql-nsec3-optout
+          skip: 8bit-txt-unescaped verify-dnssec-zone
+      - auth-regress:
+          context: godbc_mssql-nsec3-narrow
+          skip: 8bit-txt-unescaped
diff --git a/build-scripts/circleci.sh b/build-scripts/circleci.sh
new file mode 100755 (executable)
index 0000000..63f6e8b
--- /dev/null
@@ -0,0 +1,77 @@
+#!/bin/sh
+set -e
+
+case $1 in
+    debian-stretch-deps)
+        apt-get update && apt-get -qq --no-install-recommends install \
+            autoconf \
+            automake \
+            bc \
+            bind9utils \
+            bison \
+            default-jre-headless \
+            default-libmysqlclient-dev \
+            dnsutils \
+            flex \
+            freetds-bin \
+            g++ \
+            git \
+            ldnsutils \
+            libboost-all-dev \
+            libsqliteodbc \
+            libssl-dev \
+            libtool \
+            make \
+            pkg-config \
+            ragel \
+            sqlite3 \
+            tdsodbc \
+            unbound-host \
+            unixodbc \
+            unixodbc-dev \
+            virtualenv \
+            wget
+
+        wget https://github.com/dblacka/jdnssec-tools/releases/download/0.14/jdnssec-tools-0.14.tar.gz
+        tar xfz jdnssec-tools-0.14.tar.gz --strip-components=1 -C /
+        rm jdnssec-tools-0.14.tar.gz
+
+        ;;
+    configure-odbc-sqlite)
+        cat >> ~/.odbc.ini << __EOF__
+[pdns-sqlite3-1]
+Driver = SQLite3
+Database = ${PWD}/regression-tests/pdns.sqlite3
+
+[pdns-sqlite3-2]
+Driver = SQLite3
+Database = ${PWD}/regression-tests/pdns.sqlite32
+
+__EOF__
+        ;;
+    configure-odbc-mssql)
+        cat >> ~/.odbc.ini << __EOF__
+[pdns-mssql-docker]
+Driver=FreeTDS
+Trace=No
+Server=127.0.0.1
+Port=1433
+Database=pdns
+TDS_Version=7.1
+
+[pdns-mssql-docker-nodb]
+Driver=FreeTDS
+Trace=No
+Server=127.0.0.1
+Port=1433
+TDS_Version=7.1
+
+__EOF__
+
+        cat /usr/share/tdsodbc/odbcinst.ini >> /etc/odbcinst.ini
+        ;;
+    *)
+        echo unknown command "$1"
+        exit 1
+        ;;
+esac
\ No newline at end of file