]>
git.ipfire.org Git - thirdparty/pdns.git/blob - tasks.py
1 from invoke
import task
2 from invoke
.exceptions
import Failure
, UnexpectedExit
8 auth_backend_ip_addr
= os
.getenv('AUTH_BACKEND_IP_ADDR', '127.0.0.1')
10 clang_version
= os
.getenv('CLANG_VERSION', '13')
35 auth_build_deps
= [ # FIXME: perhaps we should be stealing these from the debian (Ubuntu) control file
36 'default-libmysqlclient-dev',
38 'libcurl4-openssl-dev',
74 dnsdist_build_deps
= [
86 auth_test_deps
= [ # FIXME: we should be generating some of these from shlibdeps in build
91 'default-jre-headless',
97 '"libboost-serialization1.7[1-9]+"',
146 'texlive-formats-extra',
147 'texlive-latex-extra',
152 c
.sudo('sed -i \'s/azure\.//\' /etc/apt/sources.list')
153 c
.sudo('apt-get update')
154 c
.sudo('apt-get -y --allow-downgrades dist-upgrade')
157 def install_clang(c
):
159 install clang and llvm
161 c
.sudo(f
'apt-get -y --no-install-recommends install clang-{clang_version} llvm-{clang_version}')
164 def install_clang_tidy_tools(c
):
165 c
.sudo(f
'apt-get -y --no-install-recommends install clang-tidy-{clang_version} clang-tools-{clang_version} bear python3-yaml')
168 def install_clang_runtime(c
):
169 # this gives us the symbolizer, for symbols in asan/ubsan traces
170 c
.sudo(f
'apt-get -y --no-install-recommends install clang-{clang_version}')
172 def install_libdecaf(c
, product
):
173 c
.run('git clone https://git.code.sf.net/p/ed448goldilocks/code /tmp/libdecaf')
174 with c
.cd('/tmp/libdecaf'):
175 c
.run('git checkout 41f349')
176 c
.run(f
'CC=clang-{clang_version} CXX=clang-{clang_version} '
178 '-DCMAKE_INSTALL_PREFIX=/usr/local '
179 '-DCMAKE_INSTALL_LIBDIR=lib '
180 '-DENABLE_STATIC=OFF '
181 '-DENABLE_TESTS=OFF '
182 '-DCMAKE_C_FLAGS="-Wno-sizeof-array-div -Wno-array-parameter" .')
183 c
.run('make -C build')
184 c
.run('sudo make -C build install')
185 c
.sudo(f
'mkdir -p /opt/{product}/libdecaf')
186 c
.sudo(f
'cp /usr/local/lib/libdecaf.so* /opt/{product}/libdecaf/.')
189 def install_doc_deps(c
):
190 c
.sudo('apt-get install -y ' + ' '.join(doc_deps
))
193 def install_doc_deps_pdf(c
):
194 c
.sudo('apt-get install -y ' + ' '.join(doc_deps_pdf
))
197 def install_auth_build_deps(c
):
198 c
.sudo('apt-get install -y --no-install-recommends ' + ' '.join(all_build_deps
+ git_build_deps
+ auth_build_deps
))
199 install_libdecaf(c
, 'pdns-auth')
201 def setup_authbind(c
):
202 c
.sudo('touch /etc/authbind/byport/53')
203 c
.sudo('chmod 755 /etc/authbind/byport/53')
205 auth_backend_test_deps
= dict(
206 gsqlite3
=['sqlite3'],
207 gmysql
=['default-libmysqlclient-dev'],
208 gpgsql
=['libpq-dev'],
216 godbc_sqlite3
=['libsqliteodbc'],
217 godbc_mssql
=['freetds-bin','tdsodbc'],
222 @task(help={'backend': 'Backend to install test deps for, e.g. gsqlite3; can be repeated'}, iterable
=['backend'], optional
=['backend'])
223 def install_auth_test_deps(c
, backend
): # FIXME: rename this, we do way more than apt-get
226 extra
.extend(auth_backend_test_deps
[b
])
227 c
.sudo('DEBIAN_FRONTEND=noninteractive apt-get -y install ' + ' '.join(extra
+auth_test_deps
))
229 c
.run('chmod +x /opt/pdns-auth/bin/* /opt/pdns-auth/sbin/*')
230 # c.run('''if [ ! -e $HOME/bin/jdnssec-verifyzone ]; then
231 # wget https://github.com/dblacka/jdnssec-tools/releases/download/0.14/jdnssec-tools-0.14.tar.gz
232 # tar xfz jdnssec-tools-0.14.tar.gz -C $HOME
233 # rm jdnssec-tools-0.14.tar.gz
235 # echo 'export PATH=$HOME/jdnssec-tools-0.14/bin:$PATH' >> $BASH_ENV''') # FIXME: why did this fail with no error?
236 c
.run('touch regression-tests/tests/verify-dnssec-zone/allow-missing regression-tests.nobackend/rectify-axfr/allow-missing') # FIXME: can this go?
237 # FIXME we may want to start a background recursor here to make ALIAS tests more robust
241 c
.sudo('mkdir -p /usr/local/lib')
242 c
.sudo('cp /opt/pdns-auth/libdecaf/libdecaf.so* /usr/local/lib/.')
245 def install_rec_bulk_deps(c
): # FIXME: rename this, we do way more than apt-get
246 c
.sudo('apt-get --no-install-recommends -y install ' + ' '.join(rec_bulk_deps
))
247 c
.run('chmod +x /opt/pdns-recursor/bin/* /opt/pdns-recursor/sbin/*')
250 def install_rec_test_deps(c
): # FIXME: rename this, we do way more than apt-get
251 c
.sudo('apt-get --no-install-recommends install -y ' + ' '.join(rec_bulk_deps
) + ' \
252 pdns-server pdns-backend-bind daemontools \
253 jq libfaketime lua-posix lua-socket bc authbind \
254 python3-venv python3-dev default-libmysqlclient-dev libpq-dev \
255 protobuf-compiler snmpd prometheus')
257 c
.run('chmod +x /opt/pdns-recursor/bin/* /opt/pdns-recursor/sbin/*')
261 c
.run('sed "s/agentxperms 0700 0755 recursor/agentxperms 0777 0755/g" regression-tests.recursor-dnssec/snmpd.conf | sudo tee /etc/snmp/snmpd.conf')
262 c
.sudo('/etc/init.d/snmpd restart')
264 c
.sudo('chmod 755 /var/agentx')
267 def install_dnsdist_test_deps(c
): # FIXME: rename this, we do way more than apt-get
268 c
.sudo('apt-get install -y \
273 libcurl4-openssl-dev \
286 python3-venv snmpd prometheus')
287 c
.run('sed "s/agentxperms 0700 0755 dnsdist/agentxperms 0777 0755/g" regression-tests.dnsdist/snmpd.conf | sudo tee /etc/snmp/snmpd.conf')
288 c
.sudo('/etc/init.d/snmpd restart')
290 c
.sudo('chmod 755 /var/agentx')
293 def install_rec_build_deps(c
):
294 c
.sudo('apt-get install -y --no-install-recommends ' + ' '.join(all_build_deps
+ git_build_deps
+ rec_build_deps
))
297 def install_dnsdist_build_deps(c
):
298 c
.sudo('apt-get install -y --no-install-recommends ' + ' '.join(all_build_deps
+ git_build_deps
+ dnsdist_build_deps
))
302 c
.run('autoreconf -vfi')
305 def ci_docs_build(c
):
306 c
.run('make -f Makefile.sphinx -C docs html')
309 def ci_docs_build_pdf(c
):
310 c
.run('make -f Makefile.sphinx -C docs latexpdf')
313 def ci_docs_upload_master(c
, docs_host
, pdf
, username
, product
, directory
=""):
314 rsync_cmd
= " ".join([
323 c
.run(f
"{rsync_cmd} --delete ./docs/_build/{product}-html-docs/ {username}@{docs_host}:{directory}")
324 c
.run(f
"{rsync_cmd} ./docs/_build/{product}-html-docs.tar.bz2 {username}@{docs_host}:{directory}/html-docs.tar.bz2")
325 c
.run(f
"{rsync_cmd} ./docs/_build/latex/{pdf} {username}@{docs_host}:{directory}")
328 def ci_docs_add_ssh(c
, ssh_key
, host_key
):
329 c
.run('mkdir -m 700 -p ~/.ssh')
330 c
.run(f
'echo "{ssh_key}" > ~/.ssh/id_ed25519')
331 c
.run('chmod 600 ~/.ssh/id_ed25519')
332 c
.run(f
'echo "{host_key}" > ~/.ssh/known_hosts')
335 def get_sanitizers():
336 sanitizers
= os
.getenv('SANITIZERS')
338 sanitizers
= sanitizers
.split('+')
339 sanitizers
= ['--enable-' + sanitizer
for sanitizer
in sanitizers
]
340 sanitizers
= ' '.join(sanitizers
)
350 "-Werror=format-security",
351 "-Werror=string-plus-int",
358 "-Wp,-D_GLIBCXX_ASSERTIONS",
362 def get_base_configure_cmd():
364 f
'CFLAGS="{get_cflags()}"',
365 f
'CXXFLAGS="{get_cxxflags()}"',
367 f
"CC='clang-{clang_version}'",
368 f
"CXX='clang++-{clang_version}'",
369 "--enable-option-checking=fatal",
372 "--enable-fortify-source=auto",
373 "--enable-auto-var-init=pattern",
378 def ci_auth_configure(c
):
379 sanitizers
= get_sanitizers()
381 unittests
= os
.getenv('UNIT_TESTS')
382 if unittests
== 'yes':
383 unittests
= '--enable-unit-tests --enable-backend-unit-tests'
387 fuzz_targets
= os
.getenv('FUZZING_TARGETS')
388 fuzz_targets
= '--enable-fuzz-targets' if fuzz_targets
== 'yes' else ''
404 configure_cmd
= " ".join([
405 get_base_configure_cmd(),
406 "LDFLAGS='-L/usr/local/lib -Wl,-rpath,/usr/local/lib'",
407 f
"--with-modules='{modules}'",
409 "--enable-experimental-pkcs11",
410 "--enable-experimental-gss-tsig",
411 "--enable-remotebackend-zeromq",
414 "--prefix=/opt/pdns-auth",
420 res
= c
.run(configure_cmd
, warn
=True)
422 c
.run('cat config.log')
423 raise UnexpectedExit(res
)
427 def ci_rec_configure(c
):
428 sanitizers
= get_sanitizers()
430 unittests
= os
.getenv('UNIT_TESTS')
431 unittests
= '--enable-unit-tests' if unittests
== 'yes' else ''
433 configure_cmd
= " ".join([
434 get_base_configure_cmd(),
436 "--prefix=/opt/pdns-recursor",
440 "--enable-dns-over-tls",
444 res
= c
.run(configure_cmd
, warn
=True)
446 c
.run('cat config.log')
447 raise UnexpectedExit(res
)
451 def ci_dnsdist_configure(c
, features
):
452 additional_flags
= ''
453 if features
== 'full':
454 features_set
= '--enable-dnstap \
456 --enable-dns-over-tls \
457 --enable-dns-over-https \
459 --prefix=/opt/dnsdist \
469 features_set
= '--disable-dnstap \
478 --without-libsodium \
483 additional_flags
= '-DDISABLE_COMPLETION \
484 -DDISABLE_DELAY_PIPE \
485 -DDISABLE_DYNBLOCKS \
486 -DDISABLE_PROMETHEUS \
488 -DDISABLE_BUILTIN_HTML \
491 -DDISABLE_DEPRECATED_DYNBLOCK \
492 -DDISABLE_LUA_WEB_HANDLERS \
493 -DDISABLE_NON_FFI_DQ_BINDINGS \
494 -DDISABLE_POLICIES_BINDINGS \
495 -DDISABLE_PACKETCACHE_BINDINGS \
496 -DDISABLE_DOWNSTREAM_BINDINGS \
497 -DDISABLE_COMBO_ADDR_BINDINGS \
498 -DDISABLE_CLIENT_STATE_BINDINGS \
499 -DDISABLE_QPS_LIMITER_BINDINGS \
500 -DDISABLE_SUFFIX_MATCH_BINDINGS \
501 -DDISABLE_NETMASK_BINDINGS \
502 -DDISABLE_DNSNAME_BINDINGS \
503 -DDISABLE_DNSHEADER_BINDINGS \
505 -DDISABLE_WEB_CACHE_MANAGEMENT \
506 -DDISABLE_WEB_CONFIG \
507 -DDISABLE_RULES_ALTERING_QUERIES \
508 -DDISABLE_ECS_ACTIONS \
509 -DDISABLE_TOP_N_BINDINGS \
510 -DDISABLE_OCSP_STAPLING \
511 -DDISABLE_HASHED_CREDENTIALS \
512 -DDISABLE_FALSE_SHARING_PADDING \
514 unittests
= ' --enable-unit-tests' if os
.getenv('UNIT_TESTS') == 'yes' else ''
515 fuzztargets
= '--enable-fuzz-targets' if os
.getenv('FUZZING_TARGETS') == 'yes' else ''
516 sanitizers
= ' '.join('--enable-'+x
for x
in os
.getenv('SANITIZERS').split('+')) if os
.getenv('SANITIZERS') != '' else ''
517 cflags
= '-O1 -Werror=vla -Werror=shadow -Wformat=2 -Werror=format-security -Werror=string-plus-int'
518 cxxflags
= cflags
+ ' -Wp,-D_GLIBCXX_ASSERTIONS ' + additional_flags
519 res
= c
.run(f
'''CFLAGS="%s" \
521 AR=llvm-ar-{clang_version} \
522 RANLIB=llvm-ranlib-{clang_version} \
524 CC='clang-{clang_version}' \
525 CXX='clang++-{clang_version}' \
526 --enable-option-checking=fatal \
527 --enable-fortify-source=auto \
528 --enable-auto-var-init=pattern \
530 --prefix=/opt/dnsdist %s %s %s %s''' % (cflags
, cxxflags
, features_set
, sanitizers
, unittests
, fuzztargets
), warn
=True)
532 c
.run('cat config.log')
533 raise UnexpectedExit(res
)
537 c
.run('make -j8 -k V=1')
540 def ci_auth_make_bear(c
):
541 # Needed for clang-tidy -line-filter vs project structure shenanigans
543 c
.run('bear --append -- make -j8 -k V=1 -C ..')
547 c
.run('make -j8 -k V=1')
550 def ci_rec_make_bear(c
):
551 # Assumed to be running under ./pdns/recursordist/
552 c
.run('bear --append -- make -j8 -k V=1')
555 def ci_dnsdist_make(c
):
556 c
.run('make -j4 -k V=1')
559 def ci_dnsdist_make_bear(c
):
560 # Assumed to be running under ./pdns/dnsdistdist/
561 c
.run('bear --append -- make -j4 -k V=1')
564 def ci_auth_install_remotebackend_test_deps(c
):
565 with c
.cd('modules/remotebackend'):
566 # c.run('bundle config set path vendor/bundle')
567 c
.run('sudo ruby -S bundle install')
568 c
.sudo('apt-get install -y socat')
571 def ci_auth_run_unit_tests(c
):
572 res
= c
.run('make check', warn
=True)
574 c
.run('cat pdns/test-suite.log', warn
=True)
575 c
.run('cat modules/remotebackend/test-suite.log', warn
=True)
576 raise UnexpectedExit(res
)
579 def ci_rec_run_unit_tests(c
):
580 res
= c
.run('make check', warn
=True)
582 c
.run('cat test-suite.log')
583 raise UnexpectedExit(res
)
586 def ci_dnsdist_run_unit_tests(c
):
587 res
= c
.run('make check', warn
=True)
589 c
.run('cat test-suite.log')
590 raise UnexpectedExit(res
)
593 def ci_make_distdir(c
):
594 res
= c
.run('make distdir')
597 def ci_make_install(c
):
598 res
= c
.run('make install') # FIXME: this builds auth docs - again
601 def add_auth_repo(c
, dist_name
, dist_release_name
, pdns_repo_version
):
602 c
.sudo('apt-get install -y curl gnupg2')
603 if pdns_repo_version
== 'master':
604 c
.sudo('curl -s -o /etc/apt/trusted.gpg.d/pdns-repo.asc https://repo.powerdns.com/CBC8B383-pub.asc')
606 c
.sudo('curl -s -o /etc/apt/trusted.gpg.d/pdns-repo.asc https://repo.powerdns.com/FD380FBB-pub.asc')
607 c
.run(f
"echo 'deb [arch=amd64] http://repo.powerdns.com/{dist_name} {dist_release_name}-auth-{pdns_repo_version} main' | sudo tee /etc/apt/sources.list.d/pdns.list")
608 c
.run("echo 'Package: pdns-*' | sudo tee /etc/apt/preferences.d/pdns")
609 c
.run("echo 'Pin: origin repo.powerdns.com' | sudo tee -a /etc/apt/preferences.d/pdns")
610 c
.run("echo 'Pin-Priority: 600' | sudo tee -a /etc/apt/preferences.d/pdns")
611 c
.sudo('apt-get update')
614 def test_api(c
, product
, backend
=''):
615 if product
== 'recursor':
616 with c
.cd('regression-tests.api'):
617 c
.run(f
'PDNSRECURSOR=/opt/pdns-recursor/sbin/pdns_recursor ./runtests recursor {backend}')
618 elif product
== 'auth':
619 with c
.cd('regression-tests.api'):
620 c
.run(f
'PDNSSERVER=/opt/pdns-auth/sbin/pdns_server PDNSUTIL=/opt/pdns-auth/bin/pdnsutil SDIG=/opt/pdns-auth/bin/sdig MYSQL_HOST={auth_backend_ip_addr} PGHOST={auth_backend_ip_addr} PGPORT=5432 ./runtests authoritative {backend}')
622 raise Failure('unknown product')
624 backend_regress_tests
= dict(
628 'bind-dnssec-nsec3-both',
629 'bind-dnssec-nsec3-optout-both',
630 'bind-dnssec-nsec3-narrow',
631 # FIXME 'bind-dnssec-pkcs11'
637 lua2
= ['lua2', 'lua2-dnssec'],
638 tinydns
= ['tinydns'],
640 'remotebackend-pipe',
641 'remotebackend-unix',
642 'remotebackend-http',
643 'remotebackend-zeromq',
644 'remotebackend-pipe-dnssec',
645 'remotebackend-unix-dnssec',
646 'remotebackend-http-dnssec',
647 'remotebackend-zeromq-dnssec'
650 'lmdb-nodnssec-both',
653 'lmdb-nsec3-optout-both',
658 'gmysql-nodnssec-both',
660 'gmysql-nsec3-optout-both',
661 'gmysql-nsec3-narrow',
666 'gpgsql-nodnssec-both',
668 'gpgsql-nsec3-optout-both',
669 'gpgsql-nsec3-narrow',
674 'gsqlite3-nodnssec-both',
675 'gsqlite3-nsec3-both',
676 'gsqlite3-nsec3-optout-both',
677 'gsqlite3-nsec3-narrow'
679 godbc_sqlite3
= ['godbc_sqlite3-nodnssec'],
682 'godbc_mssql-nodnssec',
684 'godbc_mssql-nsec3-optout',
685 'godbc_mssql-nsec3-narrow'
692 geoip_mmdb
= ['geoip'],
695 godbc_mssql_credentials
= {"username": "sa", "password": "SAsa12%%"}
701 Server={auth_backend_ip_addr}
706 [pdns-mssql-docker-nodb]
709 Server={auth_backend_ip_addr}
715 Database = pdns.sqlite3
719 Database = pdns.sqlite32
722 def setup_godbc_mssql(c
):
723 with
open(os
.path
.expanduser("~/.odbc.ini"), "a") as f
:
724 f
.write(godbc_config
)
725 c
.sudo('sh -c \'echo "Threading=1" | cat /usr/share/tdsodbc/odbcinst.ini - | tee -a /etc/odbcinst.ini\'')
726 c
.sudo('sed -i "s/libtdsodbc.so/\/usr\/lib\/x86_64-linux-gnu\/odbc\/libtdsodbc.so/g" /etc/odbcinst.ini')
727 c
.run(f
'echo "create database pdns" | isql -v pdns-mssql-docker-nodb {godbc_mssql_credentials["username"]} {godbc_mssql_credentials["password"]}')
728 # FIXME: Skip 8bit-txt-unescaped test
729 c
.run('touch ${PWD}/regression-tests/tests/8bit-txt-unescaped/skip')
731 def setup_godbc_sqlite3(c
):
732 with
open(os
.path
.expanduser("~/.odbc.ini"), "a") as f
:
733 f
.write(godbc_config
)
734 c
.sudo('sed -i "s/libsqlite3odbc.so/\/usr\/lib\/x86_64-linux-gnu\/odbc\/libsqlite3odbc.so/g" /etc/odbcinst.ini')
736 def setup_ldap_client(c
):
737 c
.sudo('DEBIAN_FRONTEND=noninteractive apt-get install -y ldap-utils')
738 c
.sudo(f
'sh -c \'echo "{auth_backend_ip_addr} ldapserver" | tee -a /etc/hosts\'')
741 def test_auth_backend(c
, backend
):
742 pdns_auth_env_vars
= 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={auth_backend_ip_addr} GMYSQL2HOST={auth_backend_ip_addr} MYSQL_HOST={auth_backend_ip_addr} PGHOST={auth_backend_ip_addr} PGPORT=5432'
744 if backend
== 'remote':
745 ci_auth_install_remotebackend_test_deps(c
)
747 if backend
== 'authpy':
748 c
.sudo(f
'sh -c \'echo "{auth_backend_ip_addr} kerberos-server" | tee -a /etc/hosts\'')
749 with c
.cd('regression-tests.auth-py'):
750 c
.run(f
'{pdns_auth_env_vars} WITHKERBEROS=YES ./runtests')
753 if backend
== 'godbc_sqlite3':
754 setup_godbc_sqlite3(c
)
755 with c
.cd('regression-tests'):
756 for variant
in backend_regress_tests
[backend
]:
757 c
.run(f
'{pdns_auth_env_vars} GODBC_SQLITE3_DSN=pdns-sqlite3-1 ./start-test-stop 5300 {variant}')
760 if backend
== 'godbc_mssql':
762 with c
.cd('regression-tests'):
763 for variant
in backend_regress_tests
[backend
]:
764 c
.run(f
'{pdns_auth_env_vars} GODBC_MSSQL_PASSWORD={godbc_mssql_credentials["password"]} GODBC_MSSQL_USERNAME={godbc_mssql_credentials["username"]} GODBC_MSSQL_DSN=pdns-mssql-docker GODBC_MSSQL2_PASSWORD={godbc_mssql_credentials["password"]} GODBC_MSSQL2_USERNAME={godbc_mssql_credentials["username"]} GODBC_MSSQL2_DSN=pdns-mssql-docker ./start-test-stop 5300 {variant}')
767 if backend
== 'ldap':
770 if backend
== 'geoip_mmdb':
771 with c
.cd('regression-tests'):
772 for variant
in backend_regress_tests
[backend
]:
773 c
.run(f
'{pdns_auth_env_vars} geoipdatabase=../modules/geoipbackend/regression-tests/GeoLiteCity.mmdb ./start-test-stop 5300 {variant}')
776 with c
.cd('regression-tests'):
777 if backend
== 'lua2':
778 c
.run('touch trustedkeys') # avoid silly error during cleanup
779 for variant
in backend_regress_tests
[backend
]:
780 c
.run(f
'{pdns_auth_env_vars} ./start-test-stop 5300 {variant}')
782 if backend
== 'gsqlite3':
783 if os
.getenv('SKIP_IPV6_TESTS'):
784 pdns_auth_env_vars
+= ' context=noipv6'
785 with c
.cd('regression-tests.nobackend'):
786 c
.run(f
'{pdns_auth_env_vars} ./runtests')
787 c
.run('/opt/pdns-auth/bin/pdnsutil test-algorithms')
791 def test_ixfrdist(c
):
792 with c
.cd('regression-tests.ixfrdist'):
793 c
.run('IXFRDISTBIN=/opt/pdns-auth/bin/ixfrdist ./runtests')
797 c
.run('chmod +x /opt/dnsdist/bin/*')
798 c
.run('ls -ald /var /var/agentx /var/agentx/master')
799 c
.run('ls -al /var/agentx/master')
800 with c
.cd('regression-tests.dnsdist'):
801 c
.run('DNSDISTBIN=/opt/dnsdist/bin/dnsdist ./runtests')
804 def test_regression_recursor(c
):
805 c
.run('/opt/pdns-recursor/sbin/pdns_recursor --version')
806 c
.run('PDNSRECURSOR=/opt/pdns-recursor/sbin/pdns_recursor RECCONTROL=/opt/pdns-recursor/bin/rec_control ./build-scripts/test-recursor')
809 def test_bulk_recursor(c
, threads
, mthreads
, shards
):
810 # We run an extremely small version of the bulk test, as GH does not seem to be able to handle the UDP load
811 with c
.cd('regression-tests'):
812 c
.run('curl -LO http://s3-us-west-1.amazonaws.com/umbrella-static/top-1m.csv.zip')
813 c
.run('unzip top-1m.csv.zip -d .')
814 c
.run('chmod +x /opt/pdns-recursor/bin/* /opt/pdns-recursor/sbin/*')
815 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}')
818 def install_swagger_tools(c
):
819 c
.run('npm install -g api-spec-converter')
822 def swagger_syntax_check(c
):
823 c
.run('api-spec-converter docs/http-api/swagger/authoritative-api-swagger.yaml -f swagger_2 -t openapi_3 -s json -c')
826 def install_coverity_tools(c
, project
):
827 token
= os
.getenv('COVERITY_TOKEN')
828 c
.run(f
'curl -s https://scan.coverity.com/download/linux64 --data "token={token}&project={project}" | gunzip | sudo tar xvf /dev/stdin --strip-components=1 --no-same-owner -C /usr/local', hide
=True)
831 def coverity_clang_configure(c
):
832 c
.sudo(f
'/usr/local/bin/cov-configure --template --comptype clangcc --compiler clang++-{clang_version}')
835 def coverity_make(c
):
836 c
.run('/usr/local/bin/cov-build --dir cov-int make -j8 -k')
839 def coverity_tarball(c
, tarball
):
840 c
.run(f
'tar caf {tarball} cov-int')
843 def coverity_upload(c
, email
, project
, tarball
):
844 token
= os
.getenv('COVERITY_TOKEN')
845 c
.run(f
'curl --form token={token} \
846 --form email="{email}" \
847 --form file=@{tarball} \
848 --form version="$(./builder-support/gen-version)" \
849 --form description="master build" \
850 https://scan.coverity.com/builds?project={project}', hide
=True)
854 if '/usr/lib/ccache' not in os
.environ
['PATH']:
855 os
.environ
['PATH']='/usr/lib/ccache:'+os
.environ
['PATH']