]> git.ipfire.org Git - thirdparty/pdns.git/blob - build-scripts/test-auth
Merge pull request #3840 from rgacogne/dnsdist-client-wrongtype-3839
[thirdparty/pdns.git] / build-scripts / test-auth
1 #!/bin/sh
2
3 set -x
4 context=''
5 # poor mans option parsing
6 if [ -n "$1" ]; then
7 if [ "$1" != "odbc" ]; then
8 echo "invalid argument"
9 exit 1
10 fi
11 context=odbc
12 if [ -n "$2" ]; then
13 echo "too many arguments"
14 exit 1
15 fi
16 fi
17
18 export PDNS=/usr/sbin/pdns_server
19 export PDNS2=$PDNS
20 export SDIG=/usr/bin/sdig
21 export NSEC3DIG=/usr/bin/nsec3dig
22 export NOTIFY=/usr/bin/notify
23 export SAXFR=/usr/bin/saxfr
24 export ZONE2SQL=/usr/bin/zone2sql
25 export PDNSUTIL=/usr/bin/pdnsutil
26 export PDNSCONTROL=/usr/bin/pdns_control
27
28 export GEM_HOME=${PWD}/gems
29 mkdir -p $GEM_HOME
30 export PATH="${GEM_HOME}/bin:$PATH"
31
32 if [ -z "$context" ]; then
33 cd modules/remotebackend
34 ruby -S bundle install
35 cd ../../
36 fi
37
38 MODULES=""
39
40 for dir in /usr/lib/x86_64-linux-gnu/pdns /usr/lib64/pdns; do
41 if [ -d $dir ]; then
42 MODULES=$dir
43 break
44 fi
45 done
46 [ -z $MODULES ] && echo "No module directory found" >&2 && exit 1
47
48 # Symlink the modules on the system
49 cd regression-tests/modules
50 for backend in *.so; do
51 ln -sf $MODULES/$backend $backend
52 done
53
54 cd ..
55
56 EXITCODE=0
57
58 if [ -z "$context" ]; then
59 export geoipregion=oc geoipregionip=1.2.3.4
60 ./timestamp ./start-test-stop 5300 bind-both || EXITCODE=1
61 ./timestamp ./start-test-stop 5300 bind-dnssec-both || EXITCODE=1
62
63 # No PKCS#11 in packages
64 #SETUP_SOFTHSM=y ./timestamp ./start-test-stop 5300 bind-dnssec-pkcs11 || EXITCODE=1
65 ./timestamp ./start-test-stop 5300 bind-dnssec-nsec3-both || EXITCODE=1
66 ./timestamp ./start-test-stop 5300 bind-dnssec-nsec3-optout-both || EXITCODE=1
67 ./timestamp ./start-test-stop 5300 bind-dnssec-nsec3-narrow || EXITCODE=1
68 ./timestamp ./start-test-stop 5300 bind-hybrid-nsec3 || EXITCODE=1
69
70 # Adding extra IPs to docker containers in not supported :(
71 #./timestamp ./start-test-stop 5300 geoipbackend || EXITCODE=1
72 #./timestamp ./start-test-stop 5300 geoipbackend-nsec3-narrow || EXITCODE=1
73
74 ./timestamp ./start-test-stop 5300 gmysql-nodnssec-both || EXITCODE=1
75 ./timestamp ./start-test-stop 5300 gmysql-both || EXITCODE=1
76 ./timestamp ./start-test-stop 5300 gmysql-nsec3-both || EXITCODE=1
77 ./timestamp ./start-test-stop 5300 gmysql-nsec3-optout-both || EXITCODE=1
78 ./timestamp ./start-test-stop 5300 gmysql-nsec3-narrow || EXITCODE=1
79
80 ./timestamp ./start-test-stop 5300 gpgsql-nodnssec-both || EXITCODE=1
81 ./timestamp ./start-test-stop 5300 gpgsql-both || EXITCODE=1
82 ./timestamp ./start-test-stop 5300 gpgsql-nsec3-both || EXITCODE=1
83 ./timestamp ./start-test-stop 5300 gpgsql-nsec3-optout-both || EXITCODE=1
84 ./timestamp ./start-test-stop 5300 gpgsql-nsec3-narrow || EXITCODE=1
85
86 ./timestamp ./start-test-stop 5300 gsqlite3-nodnssec-both || EXITCODE=1
87 ./timestamp ./start-test-stop 5300 gsqlite3-both || EXITCODE=1
88 ./timestamp ./start-test-stop 5300 gsqlite3-nsec3-both || EXITCODE=1
89 ./timestamp ./start-test-stop 5300 gsqlite3-nsec3-optout-both || EXITCODE=1
90 ./timestamp ./start-test-stop 5300 gsqlite3-nsec3-narrow || EXITCODE=1
91
92 ./timestamp ./start-test-stop 5300 mydns || EXITCODE=1
93
94 ./timestamp ./start-test-stop 5300 opendbx-sqlite3 || EXITCODE=1
95
96 ./timestamp timeout 120s ./start-test-stop 5300 remotebackend-pipe || EXITCODE=1
97 ./timestamp timeout 120s ./start-test-stop 5300 remotebackend-pipe-dnssec || EXITCODE=1
98 ./timestamp timeout 120s ./start-test-stop 5300 remotebackend-unix || EXITCODE=1
99 ./timestamp timeout 120s ./start-test-stop 5300 remotebackend-unix-dnssec || EXITCODE=1
100 ./timestamp timeout 120s ./start-test-stop 5300 remotebackend-http || EXITCODE=1
101 ./timestamp timeout 120s ./start-test-stop 5300 remotebackend-http-dnssec || EXITCODE=1
102
103
104 # No 0MQ in the PowerDNS packages
105 #./timestamp timeout 120s ./start-test-stop 5300 remotebackend-zeromq || EXITCODE=1
106 #./timestamp timeout 120s ./start-test-stop 5300 remotebackend-zeromq-dnssec || EXITCODE=1
107
108 ./timestamp ./start-test-stop 5300 tinydns || EXITCODE=1
109
110 cd ../regression-tests.nobackend/
111
112 ./runtests || EXITCODE=1
113 elif [ "$context" = "odbc" ]; then
114 cat > ~/.odbc.ini << __EOF__
115 [pdns-sqlite3-1]
116 Driver = SQLite3
117 Database = $(pwd)/pdns.sqlite3
118
119 [pdns-sqlite3-2]
120 Driver = SQLite3
121 Database = $(pwd)/pdns.sqlite32
122
123 [pdns-mssql]
124 Driver=FreeTDS
125 Trace=No
126 Server=pdns-odbc-regress-sql-1.database.windows.net
127 Port=1433
128 Database=pdns
129 TDS_Version=7.1
130 ClientCharset=UTF-8
131 __EOF__
132
133 set +x
134 . ~/.mssql-credentials
135 set -x
136 export GODBC_SQLITE3_DSN=pdns-sqlite3-1
137 ./timestamp timeout 120s ./start-test-stop 5300 godbc_sqlite3-nodnssec || EXITCODE=1
138 export GODBC_MSSQL_DSN=pdns-mssql
139 export GODBC_MSSQL_USERNAME
140 export GODBC_MSSQL_PASSWORD
141 ./timestamp timeout 3600s ./start-test-stop 5300 godbc_mssql-nodnssec || EXITCODE=1
142 ./timestamp timeout 3600s ./start-test-stop 5300 godbc_mssql || EXITCODE=1
143 ./timestamp timeout 3600s ./start-test-stop 5300 godbc_mssql-nsec3 || EXITCODE=1
144 ./timestamp timeout 3600s ./start-test-stop 5300 godbc_mssql-nsec3-optout || EXITCODE=1
145 ./timestamp timeout 3600s ./start-test-stop 5300 godbc_mssql-nsec3-narrow || EXITCODE=1
146 fi
147
148 exit $EXITCODE