]>
Commit | Line | Data |
---|---|---|
99bb3530 PD |
1 | from invoke import task |
2 | from invoke.exceptions import Failure, UnexpectedExit | |
3 | ||
7ec6fb65 | 4 | import os |
99bb3530 PD |
5 | import sys |
6 | import time | |
7 | ||
8 | all_build_deps = [ | |
d3cb00f9 | 9 | 'ccache', |
99bb3530 PD |
10 | 'libboost-all-dev', |
11 | 'libluajit-5.1-dev', | |
12 | 'libsodium-dev', | |
13 | 'libssl-dev', | |
14 | 'libsystemd-dev', | |
15 | 'libtool', | |
16 | 'make', | |
17 | 'pkg-config', | |
18 | 'python3-venv', | |
19 | 'systemd', | |
20 | ] | |
21 | git_build_deps = [ | |
22 | 'autoconf', | |
23 | 'automake', | |
24 | 'bison', | |
25 | 'bzip2', | |
26 | 'curl', | |
27 | 'flex', | |
28 | 'git', | |
29 | 'ragel' | |
30 | ] | |
31 | auth_build_deps = [ # FIXME: perhaps we should be stealing these from the debian (Ubuntu) control file | |
32 | 'default-libmysqlclient-dev', | |
33 | 'libcdb-dev', | |
34 | 'libcurl4-openssl-dev', | |
35 | 'libgeoip-dev', | |
36 | 'libkrb5-dev', | |
37 | 'libldap2-dev', | |
38 | 'liblmdb-dev', | |
39 | 'libmaxminddb-dev', | |
40 | 'libp11-kit-dev', | |
41 | 'libpq-dev', | |
42 | 'libsqlite3-dev', | |
43 | 'libyaml-cpp-dev', | |
44 | 'libzmq3-dev', | |
45 | 'ruby-bundler', | |
46 | 'ruby-dev', | |
47 | 'sqlite3', | |
48 | ] | |
49 | rec_build_deps = [ | |
50 | 'libcap-dev', | |
51 | 'libfstrm-dev', | |
52 | 'libsnmp-dev', | |
53 | ] | |
4467dd85 O |
54 | rec_bulk_deps = [ |
55 | 'curl', | |
4467dd85 O |
56 | 'libboost-all-dev', |
57 | 'libcap2', | |
2b219e37 O |
58 | 'libfstrm0', |
59 | 'libluajit-5.1-2', | |
60 | 'libsnmp35', | |
61 | 'libsodium23', | |
4467dd85 O |
62 | 'libssl1.1', |
63 | 'libsystemd0', | |
2b219e37 O |
64 | 'moreutils', |
65 | 'pdns-tools', | |
66 | 'unzip' | |
4467dd85 | 67 | ] |
99bb3530 PD |
68 | dnsdist_build_deps = [ |
69 | 'libcap-dev', | |
70 | 'libcdb-dev', | |
71 | 'libedit-dev', | |
72 | 'libfstrm-dev', | |
79e3404d | 73 | 'libgnutls28-dev', |
99bb3530 PD |
74 | 'libh2o-evloop-dev', |
75 | 'liblmdb-dev', | |
ff4c1303 | 76 | 'libnghttp2-dev', |
99bb3530 PD |
77 | 'libre2-dev', |
78 | 'libsnmp-dev', | |
79 | ] | |
80 | auth_test_deps = [ # FIXME: we should be generating some of these from shlibdeps in build | |
81 | 'authbind', | |
82 | 'bc', | |
83 | 'bind9utils', | |
84 | 'curl', | |
85 | 'default-jre-headless', | |
86 | 'dnsutils', | |
222d17e2 | 87 | 'faketime', |
99bb3530 PD |
88 | 'gawk', |
89 | 'ldnsutils', | |
90 | 'libboost-serialization1.71.0', | |
91 | 'libcdb1', | |
92 | 'libcurl4', | |
93 | 'libgeoip1', | |
94 | 'libkrb5-3', | |
95 | 'libldap-2.4-2', | |
96 | 'liblmdb0', | |
97 | 'libluajit-5.1-2', | |
98 | 'libmaxminddb0', | |
99 | 'libnet-dns-perl', | |
100 | 'libp11-kit0', | |
101 | 'libpq5', | |
102 | 'libsodium23', | |
103 | 'libsqlite3-dev', | |
104 | 'libssl1.1', | |
105 | 'libsystemd0', | |
106 | 'libyaml-cpp0.6', | |
107 | 'libzmq3-dev', | |
0e77de07 PD |
108 | 'ruby-bundler', |
109 | 'ruby-dev', | |
99bb3530 PD |
110 | 'socat', |
111 | 'softhsm2', | |
112 | 'unbound-host', | |
113 | 'unixodbc', | |
114 | 'wget' | |
115 | ] | |
116 | ||
117 | @task | |
118 | def apt_fresh(c): | |
119 | c.sudo('apt-get update') | |
120 | c.sudo('apt-get dist-upgrade') | |
121 | ||
122 | @task | |
123 | def install_clang(c): | |
124 | """ | |
d0ec482a | 125 | install clang-12 and llvm-12 |
99bb3530 | 126 | """ |
d0ec482a | 127 | c.sudo('apt-get -qq -y --no-install-recommends install clang-12 llvm-12') |
99bb3530 PD |
128 | |
129 | @task | |
130 | def install_clang_runtime(c): | |
131 | # this gives us the symbolizer, for symbols in asan/ubsan traces | |
d0ec482a | 132 | c.sudo('apt-get -qq -y --no-install-recommends install clang-12') |
99bb3530 PD |
133 | |
134 | @task | |
135 | def install_auth_build_deps(c): | |
136 | c.sudo('apt-get install -qq -y --no-install-recommends ' + ' '.join(all_build_deps + git_build_deps + auth_build_deps)) | |
137 | ||
138 | def setup_authbind(c): | |
139 | c.sudo('touch /etc/authbind/byport/53') | |
140 | c.sudo('chmod 755 /etc/authbind/byport/53') | |
141 | ||
142 | auth_backend_test_deps = dict( | |
143 | gsqlite3=['sqlite3'], | |
144 | gmysql=['default-libmysqlclient-dev'], | |
145 | gpgsql=['libpq-dev'], | |
0e77de07 | 146 | lmdb=[], |
b33a88da PD |
147 | remote=[], |
148 | bind=[], | |
149 | geoip=[], | |
150 | lua2=[], | |
222d17e2 PD |
151 | tinydns=[], |
152 | authpy=[] | |
99bb3530 PD |
153 | ) |
154 | ||
155 | @task(help={'backend': 'Backend to install test deps for, e.g. gsqlite3; can be repeated'}, iterable=['backend'], optional=['backend']) | |
156 | def install_auth_test_deps(c, backend): # FIXME: rename this, we do way more than apt-get | |
157 | extra=[] | |
158 | for b in backend: | |
159 | extra.extend(auth_backend_test_deps[b]) | |
160 | c.sudo('apt-get -y -qq install ' + ' '.join(extra+auth_test_deps)) | |
161 | ||
162 | c.run('chmod +x /opt/pdns-auth/bin/* /opt/pdns-auth/sbin/*') | |
163 | # c.run('''if [ ! -e $HOME/bin/jdnssec-verifyzone ]; then | |
164 | # wget https://github.com/dblacka/jdnssec-tools/releases/download/0.14/jdnssec-tools-0.14.tar.gz | |
165 | # tar xfz jdnssec-tools-0.14.tar.gz -C $HOME | |
166 | # rm jdnssec-tools-0.14.tar.gz | |
167 | # fi | |
168 | # echo 'export PATH=$HOME/jdnssec-tools-0.14/bin:$PATH' >> $BASH_ENV''') # FIXME: why did this fail with no error? | |
222d17e2 PD |
169 | c.run('touch regression-tests/tests/verify-dnssec-zone/allow-missing regression-tests.nobackend/rectify-axfr/allow-missing') # FIXME: can this go? |
170 | # FIXME we may want to start a background recursor here to make ALIAS tests more robust | |
99bb3530 PD |
171 | setup_authbind(c) |
172 | ||
4467dd85 O |
173 | @task |
174 | def install_rec_bulk_deps(c): # FIXME: rename this, we do way more than apt-get | |
175 | c.sudo('apt-get --no-install-recommends -qq -y install ' + ' '.join(rec_bulk_deps)) | |
176 | c.run('chmod +x /opt/pdns-recursor/bin/* /opt/pdns-recursor/sbin/*') | |
177 | ||
99bb3530 PD |
178 | @task |
179 | def install_rec_test_deps(c): # FIXME: rename this, we do way more than apt-get | |
4467dd85 O |
180 | c.sudo('apt-get --no-install-recommends install -qq -y ' + ' '.join(rec_bulk_deps) + ' \ |
181 | pdns-server pdns-backend-bind daemontools \ | |
182 | jq libfaketime lua-posix lua-socket bc authbind \ | |
6b45d67b | 183 | python3-venv python3-dev default-libmysqlclient-dev libpq-dev \ |
4467dd85 | 184 | protobuf-compiler snmpd prometheus') |
99bb3530 PD |
185 | |
186 | c.run('chmod +x /opt/pdns-recursor/bin/* /opt/pdns-recursor/sbin/*') | |
187 | ||
188 | setup_authbind(c) | |
189 | ||
6b45d67b O |
190 | c.run('sed "s/agentxperms 0700 0755 recursor/agentxperms 0777 0755/g" regression-tests.recursor-dnssec/snmpd.conf | sudo tee /etc/snmp/snmpd.conf') |
191 | c.sudo('systemctl restart snmpd') | |
192 | time.sleep(5) | |
193 | c.sudo('chmod 755 /var/agentx') | |
194 | ||
99bb3530 PD |
195 | @task |
196 | def install_dnsdist_test_deps(c): # FIXME: rename this, we do way more than apt-get | |
197 | c.sudo('apt-get install -qq -y \ | |
198 | libluajit-5.1-2 \ | |
199 | libboost-all-dev \ | |
200 | libcap2 \ | |
201 | libcdb1 \ | |
202 | libcurl4-openssl-dev \ | |
203 | libfstrm0 \ | |
79e3404d | 204 | libgnutls30 \ |
99bb3530 PD |
205 | libh2o-evloop0.13 \ |
206 | liblmdb0 \ | |
ff4c1303 | 207 | libnghttp2-14 \ |
99bb3530 PD |
208 | libre2-5 \ |
209 | libssl-dev \ | |
210 | libsystemd0 \ | |
211 | libsodium23 \ | |
212 | patch \ | |
213 | protobuf-compiler \ | |
214 | python3-venv snmpd prometheus') | |
215 | c.run('sed "s/agentxperms 0700 0755 dnsdist/agentxperms 0777 0755/g" regression-tests.dnsdist/snmpd.conf | sudo tee /etc/snmp/snmpd.conf') | |
216 | c.sudo('systemctl restart snmpd') | |
217 | time.sleep(5) | |
218 | c.sudo('chmod 755 /var/agentx') | |
219 | ||
220 | @task | |
221 | def install_rec_build_deps(c): | |
222 | c.sudo('apt-get install -qq -y --no-install-recommends ' + ' '.join(all_build_deps + git_build_deps + rec_build_deps)) | |
223 | ||
224 | @task | |
225 | def install_dnsdist_build_deps(c): | |
226 | c.sudo('apt-get install -qq -y --no-install-recommends ' + ' '.join(all_build_deps + git_build_deps + dnsdist_build_deps)) | |
227 | ||
228 | @task | |
229 | def ci_autoconf(c): | |
230 | c.run('BUILDER_VERSION=0.0.0-git1 autoreconf -vfi') | |
231 | ||
232 | @task | |
233 | def ci_auth_configure(c): | |
234 | res = c.run('''CFLAGS="-O1 -Werror=vla -Werror=shadow -Wformat=2 -Werror=format-security -Werror=string-plus-int" \ | |
235 | CXXFLAGS="-O1 -Werror=vla -Werror=shadow -Wformat=2 -Werror=format-security -Werror=string-plus-int -Wp,-D_GLIBCXX_ASSERTIONS" \ | |
236 | ./configure \ | |
d0ec482a O |
237 | CC='clang-12' \ |
238 | CXX='clang++-12' \ | |
99bb3530 | 239 | --enable-option-checking=fatal \ |
9a205757 | 240 | --with-modules='bind geoip gmysql godbc gpgsql gsqlite3 ldap lmdb lua2 pipe remote tinydns' \ |
99bb3530 PD |
241 | --enable-systemd \ |
242 | --enable-tools \ | |
243 | --enable-unit-tests \ | |
244 | --enable-backend-unit-tests \ | |
245 | --enable-fuzz-targets \ | |
246 | --enable-experimental-pkcs11 \ | |
247 | --enable-remotebackend-zeromq \ | |
248 | --with-lmdb=/usr \ | |
249 | --with-libsodium \ | |
250 | --prefix=/opt/pdns-auth \ | |
251 | --enable-ixfrdist \ | |
252 | --enable-asan \ | |
253 | --enable-ubsan''', warn=True) | |
254 | if res.exited != 0: | |
255 | c.run('cat config.log') | |
256 | raise UnexpectedExit(res) | |
257 | @task | |
258 | def ci_rec_configure(c): | |
38529f81 | 259 | sanitizers = ' '.join('--enable-'+x for x in os.getenv('SANITIZERS').split('+')) |
99bb3530 PD |
260 | res = c.run(''' CFLAGS="-O1 -Werror=vla -Werror=shadow -Wformat=2 -Werror=format-security -Werror=string-plus-int" \ |
261 | CXXFLAGS="-O1 -Werror=vla -Werror=shadow -Wformat=2 -Werror=format-security -Werror=string-plus-int -Wp,-D_GLIBCXX_ASSERTIONS" \ | |
262 | ./configure \ | |
d0ec482a O |
263 | CC='clang-12' \ |
264 | CXX='clang++-12' \ | |
99bb3530 PD |
265 | --enable-option-checking=fatal \ |
266 | --enable-unit-tests \ | |
267 | --enable-nod \ | |
268 | --enable-systemd \ | |
269 | --prefix=/opt/pdns-recursor \ | |
270 | --with-libsodium \ | |
271 | --with-lua=luajit \ | |
272 | --with-libcap \ | |
273 | --with-net-snmp \ | |
38529f81 | 274 | --enable-dns-over-tls ''' + sanitizers, warn=True) |
99bb3530 PD |
275 | if res.exited != 0: |
276 | c.run('cat config.log') | |
277 | raise UnexpectedExit(res) | |
278 | ||
279 | @task | |
e3d6cf05 RG |
280 | def ci_dnsdist_configure(c, features): |
281 | additional_flags = '' | |
282 | if features == 'full': | |
283 | features_set = '--enable-dnstap \ | |
284 | --enable-dnscrypt \ | |
285 | --enable-dns-over-tls \ | |
286 | --enable-dns-over-https \ | |
287 | --enable-systemd \ | |
288 | --prefix=/opt/dnsdist \ | |
289 | --with-gnutls \ | |
290 | --with-libsodium \ | |
291 | --with-lua=luajit \ | |
292 | --with-libcap \ | |
293 | --with-nghttp2 \ | |
294 | --with-re2 ' | |
295 | else: | |
296 | features_set = '--disable-dnstap \ | |
297 | --disable-dnscrypt \ | |
298 | --disable-ipcipher \ | |
299 | --disable-systemd \ | |
300 | --without-cdb \ | |
301 | --without-ebpf \ | |
302 | --without-gnutls \ | |
303 | --without-libedit \ | |
304 | --without-libsodium \ | |
305 | --without-lmdb \ | |
306 | --without-net-snmp \ | |
307 | --without-re2 ' | |
308 | additional_flags = '-DDISABLE_COMPLETION \ | |
309 | -DDISABLE_PROMETHEUS \ | |
310 | -DDISABLE_PROTOBUF \ | |
311 | -DDISABLE_BUILTIN_HTML \ | |
312 | -DDISABLE_CARBON \ | |
313 | -DDISABLE_SECPOLL \ | |
314 | -DDISABLE_DEPRECATED_DYNBLOCK \ | |
315 | -DDISABLE_LUA_WEB_HANDLERS \ | |
316 | -DDISABLE_NON_FFI_DQ_BINDINGS \ | |
317 | -DDISABLE_POLICIES_BINDINGS \ | |
318 | -DDISABLE_PACKETCACHE_BINDINGS \ | |
319 | -DDISABLE_DOWNSTREAM_BINDINGS \ | |
320 | -DDISABLE_COMBO_ADDR_BINDINGS \ | |
321 | -DDISABLE_CLIENT_STATE_BINDINGS \ | |
322 | -DDISABLE_QPS_LIMITER_BINDINGS \ | |
323 | -DDISABLE_SUFFIX_MATCH_BINDINGS \ | |
324 | -DDISABLE_NETMASK_BINDINGS \ | |
325 | -DDISABLE_DNSNAME_BINDINGS \ | |
326 | -DDISABLE_DNSHEADER_BINDINGS \ | |
327 | -DDISABLE_RECVMMSG \ | |
328 | -DDISABLE_WEB_CONFIG \ | |
329 | -DDISABLE_RULES_ALTERING_QUERIES \ | |
330 | -DDISABLE_ECS_ACTIONS \ | |
331 | -DDISABLE_TOP_N_BINDINGS' | |
7ec6fb65 | 332 | sanitizers = ' '.join('--enable-'+x for x in os.getenv('SANITIZERS').split('+')) |
e3d6cf05 RG |
333 | cflags = '-O1 -Werror=vla -Werror=shadow -Wformat=2 -Werror=format-security -Werror=string-plus-int' |
334 | cxxflags = cflags + ' -Wp,-D_GLIBCXX_ASSERTIONS ' + additional_flags | |
335 | res = c.run('''CFLAGS="%s" \ | |
336 | CXXFLAGS="%s" \ | |
99bb3530 | 337 | ./configure \ |
d0ec482a O |
338 | CC='clang-12' \ |
339 | CXX='clang++-12' \ | |
99bb3530 PD |
340 | --enable-option-checking=fatal \ |
341 | --enable-unit-tests \ | |
26c06327 | 342 | --prefix=/opt/dnsdist %s %s''' % (cflags, cxxflags, features_set, sanitizers), warn=True) |
99bb3530 PD |
343 | if res.exited != 0: |
344 | c.run('cat config.log') | |
345 | raise UnexpectedExit(res) | |
346 | ||
347 | @task | |
348 | def ci_auth_make(c): | |
349 | c.run('make -j8 -k V=1') | |
350 | ||
351 | @task | |
352 | def ci_rec_make(c): | |
353 | c.run('make -j8 -k V=1') | |
354 | ||
355 | @task | |
356 | def ci_dnsdist_make(c): | |
357 | c.run('make -j4 -k V=1') | |
358 | ||
359 | @task | |
360 | def ci_auth_install_remotebackend_ruby_deps(c): | |
361 | with c.cd('modules/remotebackend'): | |
0e77de07 PD |
362 | # c.run('bundle config set path vendor/bundle') |
363 | c.run('sudo ruby -S bundle install') | |
99bb3530 PD |
364 | |
365 | @task | |
366 | def ci_auth_run_unit_tests(c): | |
367 | res = c.run('make check', warn=True) | |
368 | if res.exited != 0: | |
222d17e2 PD |
369 | c.run('cat pdns/test-suite.log', warn=True) |
370 | c.run('cat modules/remotebackend/test-suite.log', warn=True) | |
99bb3530 PD |
371 | raise UnexpectedExit(res) |
372 | ||
373 | @task | |
374 | def ci_rec_run_unit_tests(c): | |
375 | res = c.run('make check', warn=True) | |
376 | if res.exited != 0: | |
377 | c.run('cat test-suite.log') | |
378 | raise UnexpectedExit(res) | |
379 | ||
380 | @task | |
381 | def ci_dnsdist_run_unit_tests(c): | |
382 | res = c.run('make check', warn=True) | |
383 | if res.exited != 0: | |
384 | c.run('cat test-suite.log') | |
385 | raise UnexpectedExit(res) | |
386 | ||
387 | @task | |
388 | def ci_make_install(c): | |
389 | res = c.run('make install') # FIXME: this builds auth docs - again | |
390 | ||
391 | @task | |
392 | def add_auth_repo(c): | |
393 | dist = 'ubuntu' # FIXME take these from the caller? | |
394 | release = 'focal' | |
395 | version = '44' | |
396 | ||
397 | c.sudo('apt-get install -qq -y curl gnupg2') | |
398 | if version == 'master': | |
399 | c.sudo('curl -s -o /etc/apt/trusted.gpg.d/pdns-repo.asc https://repo.powerdns.com/CBC8B383-pub.asc') | |
400 | else: | |
401 | c.sudo('curl -s -o /etc/apt/trusted.gpg.d/pdns-repo.asc https://repo.powerdns.com/FD380FBB-pub.asc') | |
402 | c.run(f"echo 'deb [arch=amd64] http://repo.powerdns.com/{dist} {release}-auth-{version} main' | sudo tee /etc/apt/sources.list.d/pdns.list") | |
403 | c.run("echo 'Package: pdns-*' | sudo tee /etc/apt/preferences.d/pdns") | |
404 | c.run("echo 'Pin: origin repo.powerdns.com' | sudo tee -a /etc/apt/preferences.d/pdns") | |
405 | c.run("echo 'Pin-Priority: 600' | sudo tee -a /etc/apt/preferences.d/pdns") | |
406 | c.sudo('apt-get update') | |
407 | ||
408 | @task | |
409 | def test_api(c, product, backend=''): | |
410 | if product == 'recursor': | |
411 | with c.cd('regression-tests.api'): | |
412 | c.run(f'PDNSRECURSOR=/opt/pdns-recursor/sbin/pdns_recursor ./runtests recursor {backend}') | |
413 | elif product == 'auth': | |
414 | with c.cd('regression-tests.api'): | |
415 | c.run(f'PDNSSERVER=/opt/pdns-auth/sbin/pdns_server PDNSUTIL=/opt/pdns-auth/bin/pdnsutil SDIG=/opt/pdns-auth/bin/sdig MYSQL_HOST="127.0.0.1" PGHOST="127.0.0.1" PGPORT="5432" ./runtests authoritative {backend}') | |
416 | else: | |
417 | raise Failure('unknown product') | |
418 | ||
0e77de07 | 419 | backend_regress_tests = dict( |
b33a88da PD |
420 | bind = [ |
421 | 'bind-both', | |
422 | 'bind-dnssec-both', | |
423 | 'bind-dnssec-nsec3-both', | |
424 | 'bind-dnssec-nsec3-optout-both', | |
425 | 'bind-dnssec-nsec3-narrow', | |
426 | # FIXME 'bind-dnssec-pkcs11' | |
427 | ], | |
428 | geoip = [ | |
429 | 'geoip', | |
430 | 'geoip-nsec3-narrow' | |
431 | # FIXME: also run this with the mmdb we ship | |
432 | ], | |
433 | lua2 = [ | |
434 | 'lua2', | |
435 | 'lua2-dnssec' | |
436 | ], | |
437 | tinydns = [ | |
438 | 'tinydns' | |
439 | ], | |
440 | remote = [ | |
441 | 'remotebackend-pipe', | |
442 | 'remotebackend-unix', | |
443 | 'remotebackend-http', | |
444 | 'remotebackend-zeromq', | |
445 | 'remotebackend-pipe-dnssec', | |
446 | 'remotebackend-unix-dnssec', | |
447 | 'remotebackend-http-dnssec', | |
448 | 'remotebackend-zeromq-dnssec' | |
449 | ], | |
450 | lmdb = [ | |
451 | 'lmdb-nodnssec-both', | |
452 | 'lmdb-both', | |
453 | 'lmdb-nsec3-both', | |
454 | 'lmdb-nsec3-optout-both', | |
455 | 'lmdb-nsec3-narrow' | |
456 | ], | |
457 | gmysql = ['gmysql', 'gmysql-nodnssec-both', 'gmysql-nsec3-both', 'gmysql-nsec3-optout-both', 'gmysql-nsec3-narrow', 'gmysql_sp-both'], | |
458 | gpgsql = ['gpgsql', 'gpgsql-nodnssec-both', 'gpgsql-nsec3-both', 'gpgsql-nsec3-optout-both', 'gpgsql-nsec3-narrow', 'gpgsql_sp-both'], | |
459 | gsqlite3 = ['gsqlite3', 'gsqlite3-nodnssec-both', 'gsqlite3-nsec3-both', 'gsqlite3-nsec3-optout-both', 'gsqlite3-nsec3-narrow'], | |
0e77de07 PD |
460 | ) |
461 | ||
462 | @task | |
463 | def test_auth_backend(c, backend): | |
464 | if backend == 'remote': | |
465 | ci_auth_install_remotebackend_ruby_deps(c) | |
466 | ||
222d17e2 PD |
467 | if backend == 'authpy': |
468 | with c.cd('regression-tests.auth-py'): | |
469 | c.run(f'PDNS=/opt/pdns-auth/sbin/pdns_server PDNS2=/opt/pdns-auth/sbin/pdns_server SDIG=/opt/pdns-auth/bin/sdig NOTIFY=/opt/pdns-auth/bin/pdns_notify NSEC3DIG=/opt/pdns-auth/bin/nsec3dig SAXFR=/opt/pdns-auth/bin/saxfr ZONE2SQL=/opt/pdns-auth/bin/zone2sql ZONE2LDAP=/opt/pdns-auth/bin/zone2ldap ZONE2JSON=/opt/pdns-auth/bin/zone2json PDNSUTIL=/opt/pdns-auth/bin/pdnsutil PDNSCONTROL=/opt/pdns-auth/bin/pdns_control PDNSSERVER=/opt/pdns-auth/sbin/pdns_server SDIG=/opt/pdns-auth/bin/sdig GMYSQLHOST=127.0.0.1 GMYSQL2HOST=127.0.0.1 MYSQL_HOST="127.0.0.1" PGHOST="127.0.0.1" PGPORT="5432" ./runtests') | |
470 | return | |
471 | ||
0e77de07 | 472 | with c.cd('regression-tests'): |
b33a88da PD |
473 | if backend == 'lua2': |
474 | c.run('touch trustedkeys') # avoid silly error during cleanup | |
475 | for variant in backend_regress_tests[backend]: | |
0e77de07 | 476 | # FIXME this long line is terrible |
222d17e2 PD |
477 | c.run(f'PDNS=/opt/pdns-auth/sbin/pdns_server PDNS2=/opt/pdns-auth/sbin/pdns_server SDIG=/opt/pdns-auth/bin/sdig NOTIFY=/opt/pdns-auth/bin/pdns_notify NSEC3DIG=/opt/pdns-auth/bin/nsec3dig SAXFR=/opt/pdns-auth/bin/saxfr ZONE2SQL=/opt/pdns-auth/bin/zone2sql ZONE2LDAP=/opt/pdns-auth/bin/zone2ldap ZONE2JSON=/opt/pdns-auth/bin/zone2json PDNSUTIL=/opt/pdns-auth/bin/pdnsutil PDNSCONTROL=/opt/pdns-auth/bin/pdns_control PDNSSERVER=/opt/pdns-auth/sbin/pdns_server SDIG=/opt/pdns-auth/bin/sdig GMYSQLHOST=127.0.0.1 GMYSQL2HOST=127.0.0.1 MYSQL_HOST="127.0.0.1" PGHOST="127.0.0.1" PGPORT="5432" ./start-test-stop 5300 {variant}') |
478 | ||
479 | if backend == 'gsqlite3': | |
480 | with c.cd('regression-tests.nobackend'): | |
481 | c.run(f'PDNS=/opt/pdns-auth/sbin/pdns_server PDNS2=/opt/pdns-auth/sbin/pdns_server SDIG=/opt/pdns-auth/bin/sdig NOTIFY=/opt/pdns-auth/bin/pdns_notify NSEC3DIG=/opt/pdns-auth/bin/nsec3dig SAXFR=/opt/pdns-auth/bin/saxfr ZONE2SQL=/opt/pdns-auth/bin/zone2sql ZONE2LDAP=/opt/pdns-auth/bin/zone2ldap ZONE2JSON=/opt/pdns-auth/bin/zone2json PDNSUTIL=/opt/pdns-auth/bin/pdnsutil PDNSCONTROL=/opt/pdns-auth/bin/pdns_control PDNSSERVER=/opt/pdns-auth/sbin/pdns_server SDIG=/opt/pdns-auth/bin/sdig GMYSQLHOST=127.0.0.1 GMYSQL2HOST=127.0.0.1 MYSQL_HOST="127.0.0.1" PGHOST="127.0.0.1" PGPORT="5432" ./runtests') | |
482 | c.run('/opt/pdns-auth/bin/pdnsutil test-algorithms') | |
483 | return | |
b33a88da PD |
484 | |
485 | @task | |
486 | def test_ixfrdist(c): | |
487 | with c.cd('regression-tests.ixfrdist'): | |
488 | c.run('IXFRDISTBIN=/opt/pdns-auth/bin/ixfrdist ./runtests') | |
0e77de07 | 489 | |
99bb3530 PD |
490 | @task |
491 | def test_dnsdist(c): | |
492 | c.run('chmod +x /opt/dnsdist/bin/*') | |
493 | c.run('ls -ald /var /var/agentx /var/agentx/master') | |
494 | c.run('ls -al /var/agentx/master') | |
495 | with c.cd('regression-tests.dnsdist'): | |
496 | c.run('DNSDISTBIN=/opt/dnsdist/bin/dnsdist ./runtests') | |
d3cb00f9 | 497 | |
6b45d67b O |
498 | @task |
499 | def test_regression_recursor(c): | |
500 | c.run('/opt/pdns-recursor/sbin/pdns_recursor --version') | |
6f1a3e76 | 501 | c.run('PDNSRECURSOR=/opt/pdns-recursor/sbin/pdns_recursor RECCONTROL=/opt/pdns-recursor/bin/rec_control SKIP_IPV6_TESTS=y ./build-scripts/test-recursor') |
6b45d67b O |
502 | |
503 | @task | |
375c8fd6 O |
504 | def test_bulk_recursor(c, threads, mthreads, shards): |
505 | # We run an extremely small version of the bulk test, as GH does not seem to be able to handle the UDP load | |
6b45d67b O |
506 | with c.cd('regression-tests'): |
507 | c.run('curl -LO http://s3-us-west-1.amazonaws.com/umbrella-static/top-1m.csv.zip') | |
508 | c.run('unzip top-1m.csv.zip -d .') | |
509 | c.run('chmod +x /opt/pdns-recursor/bin/* /opt/pdns-recursor/sbin/*') | |
375c8fd6 | 510 | c.run(f'DNSBULKTEST=/usr/bin/dnsbulktest RECURSOR=/opt/pdns-recursor/sbin/pdns_recursor RECCONTROL=/opt/pdns-recursor/bin/rec_control THRESHOLD=95 TRACE=no ./timestamp ./recursor-test 5300 100 {threads} {mthreads} {shards}') |
6b45d67b | 511 | |
d3cb00f9 PD |
512 | # this is run always |
513 | def setup(): | |
514 | if '/usr/lib/ccache' not in os.environ['PATH']: | |
515 | os.environ['PATH']='/usr/lib/ccache:'+os.environ['PATH'] | |
516 | ||
517 | setup() |