]>
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')
11 rust_version
= 'rust-1.72.0-x86_64-unknown-linux-gnu'
36 auth_build_deps
= [ # FIXME: perhaps we should be stealing these from the debian (Ubuntu) control file
37 'default-libmysqlclient-dev',
39 'libcurl4-openssl-dev',
75 dnsdist_build_deps
= [
87 auth_test_deps
= [ # FIXME: we should be generating some of these from shlibdeps in build
92 'default-jre-headless',
98 '"libboost-serialization1.7[1-9]+"',
147 'texlive-formats-extra',
148 'texlive-latex-extra',
153 c
.sudo('sed -i \'s/azure\.//\' /etc/apt/sources.list')
154 c
.sudo('apt-get update')
155 c
.sudo('apt-get -y --allow-downgrades dist-upgrade')
158 def install_clang(c
):
160 install clang and llvm
162 c
.sudo(f
'apt-get -y --no-install-recommends install clang-{clang_version} llvm-{clang_version}')
165 def install_clang_tidy_tools(c
):
166 c
.sudo(f
'apt-get -y --no-install-recommends install clang-tidy-{clang_version} clang-tools-{clang_version} bear python3-yaml')
169 def install_clang_runtime(c
):
170 # this gives us the symbolizer, for symbols in asan/ubsan traces
171 c
.sudo(f
'apt-get -y --no-install-recommends install clang-{clang_version}')
174 def ci_install_rust(c
, repo
):
175 c
.sudo(f
'{repo}/builder-support/helpers/install_rust.sh {rust_version}')
177 def install_libdecaf(c
, product
):
178 c
.run('git clone https://git.code.sf.net/p/ed448goldilocks/code /tmp/libdecaf')
179 with c
.cd('/tmp/libdecaf'):
180 c
.run('git checkout 41f349')
181 c
.run(f
'CC=clang-{clang_version} CXX=clang-{clang_version} '
183 '-DCMAKE_INSTALL_PREFIX=/usr/local '
184 '-DCMAKE_INSTALL_LIBDIR=lib '
185 '-DENABLE_STATIC=OFF '
186 '-DENABLE_TESTS=OFF '
187 '-DCMAKE_C_FLAGS="-Wno-sizeof-array-div -Wno-array-parameter" .')
188 c
.run('make -C build')
189 c
.run('sudo make -C build install')
190 c
.sudo(f
'mkdir -p /opt/{product}/libdecaf')
191 c
.sudo(f
'cp /usr/local/lib/libdecaf.so* /opt/{product}/libdecaf/.')
194 def install_doc_deps(c
):
195 c
.sudo('apt-get install -y ' + ' '.join(doc_deps
))
198 def install_doc_deps_pdf(c
):
199 c
.sudo('apt-get install -y ' + ' '.join(doc_deps_pdf
))
202 def install_auth_build_deps(c
):
203 c
.sudo('apt-get install -y --no-install-recommends ' + ' '.join(all_build_deps
+ git_build_deps
+ auth_build_deps
))
204 install_libdecaf(c
, 'pdns-auth')
206 def setup_authbind(c
):
207 c
.sudo('touch /etc/authbind/byport/53')
208 c
.sudo('chmod 755 /etc/authbind/byport/53')
210 auth_backend_test_deps
= dict(
211 gsqlite3
=['sqlite3'],
212 gmysql
=['default-libmysqlclient-dev'],
213 gpgsql
=['libpq-dev'],
221 godbc_sqlite3
=['libsqliteodbc'],
222 godbc_mssql
=['freetds-bin','tdsodbc'],
227 @task(help={'backend': 'Backend to install test deps for, e.g. gsqlite3; can be repeated'}, iterable
=['backend'], optional
=['backend'])
228 def install_auth_test_deps(c
, backend
): # FIXME: rename this, we do way more than apt-get
231 extra
.extend(auth_backend_test_deps
[b
])
232 c
.sudo('DEBIAN_FRONTEND=noninteractive apt-get -y install ' + ' '.join(extra
+auth_test_deps
))
234 c
.run('chmod +x /opt/pdns-auth/bin/* /opt/pdns-auth/sbin/*')
235 # c.run('''if [ ! -e $HOME/bin/jdnssec-verifyzone ]; then
236 # wget https://github.com/dblacka/jdnssec-tools/releases/download/0.14/jdnssec-tools-0.14.tar.gz
237 # tar xfz jdnssec-tools-0.14.tar.gz -C $HOME
238 # rm jdnssec-tools-0.14.tar.gz
240 # echo 'export PATH=$HOME/jdnssec-tools-0.14/bin:$PATH' >> $BASH_ENV''') # FIXME: why did this fail with no error?
241 c
.run('touch regression-tests/tests/verify-dnssec-zone/allow-missing regression-tests.nobackend/rectify-axfr/allow-missing') # FIXME: can this go?
242 # FIXME we may want to start a background recursor here to make ALIAS tests more robust
246 c
.sudo('mkdir -p /usr/local/lib')
247 c
.sudo('cp /opt/pdns-auth/libdecaf/libdecaf.so* /usr/local/lib/.')
250 def install_rec_bulk_deps(c
): # FIXME: rename this, we do way more than apt-get
251 c
.sudo('apt-get --no-install-recommends -y install ' + ' '.join(rec_bulk_deps
))
252 c
.run('chmod +x /opt/pdns-recursor/bin/* /opt/pdns-recursor/sbin/*')
255 def install_rec_test_deps(c
): # FIXME: rename this, we do way more than apt-get
256 c
.sudo('apt-get --no-install-recommends install -y ' + ' '.join(rec_bulk_deps
) + ' \
257 pdns-server pdns-backend-bind daemontools \
258 jq libfaketime lua-posix lua-socket bc authbind \
259 python3-venv python3-dev default-libmysqlclient-dev libpq-dev \
260 protobuf-compiler snmpd prometheus')
262 c
.run('chmod +x /opt/pdns-recursor/bin/* /opt/pdns-recursor/sbin/*')
266 c
.run('sed "s/agentxperms 0700 0755 recursor/agentxperms 0777 0755/g" regression-tests.recursor-dnssec/snmpd.conf | sudo tee /etc/snmp/snmpd.conf')
267 c
.sudo('/etc/init.d/snmpd restart')
269 c
.sudo('chmod 755 /var/agentx')
272 def install_dnsdist_test_deps(c
): # FIXME: rename this, we do way more than apt-get
273 c
.sudo('apt-get install -y \
278 libcurl4-openssl-dev \
291 python3-venv snmpd prometheus')
292 c
.run('sed "s/agentxperms 0700 0755 dnsdist/agentxperms 0777 0755/g" regression-tests.dnsdist/snmpd.conf | sudo tee /etc/snmp/snmpd.conf')
293 c
.sudo('/etc/init.d/snmpd restart')
295 c
.sudo('chmod 755 /var/agentx')
298 def install_rec_build_deps(c
):
299 c
.sudo('apt-get install -y --no-install-recommends ' + ' '.join(all_build_deps
+ git_build_deps
+ rec_build_deps
))
302 def install_dnsdist_build_deps(c
):
303 c
.sudo('apt-get install -y --no-install-recommends ' + ' '.join(all_build_deps
+ git_build_deps
+ dnsdist_build_deps
))
307 c
.run('autoreconf -vfi')
310 def ci_docs_build(c
):
311 c
.run('make -f Makefile.sphinx -C docs html')
314 def ci_docs_build_pdf(c
):
315 c
.run('make -f Makefile.sphinx -C docs latexpdf')
318 def ci_docs_upload_master(c
, docs_host
, pdf
, username
, product
, directory
=""):
319 rsync_cmd
= " ".join([
328 c
.run(f
"{rsync_cmd} --delete ./docs/_build/{product}-html-docs/ {username}@{docs_host}:{directory}")
329 c
.run(f
"{rsync_cmd} ./docs/_build/{product}-html-docs.tar.bz2 {username}@{docs_host}:{directory}/html-docs.tar.bz2")
330 c
.run(f
"{rsync_cmd} ./docs/_build/latex/{pdf} {username}@{docs_host}:{directory}")
333 def ci_docs_add_ssh(c
, ssh_key
, host_key
):
334 c
.run('mkdir -m 700 -p ~/.ssh')
335 c
.run(f
'echo "{ssh_key}" > ~/.ssh/id_ed25519')
336 c
.run('chmod 600 ~/.ssh/id_ed25519')
337 c
.run(f
'echo "{host_key}" > ~/.ssh/known_hosts')
340 def get_sanitizers():
341 sanitizers
= os
.getenv('SANITIZERS')
343 sanitizers
= sanitizers
.split('+')
344 sanitizers
= ['--enable-' + sanitizer
for sanitizer
in sanitizers
]
345 sanitizers
= ' '.join(sanitizers
)
355 "-Werror=format-security",
356 "-Werror=string-plus-int",
363 "-Wp,-D_GLIBCXX_ASSERTIONS",
367 def get_base_configure_cmd():
369 f
'CFLAGS="{get_cflags()}"',
370 f
'CXXFLAGS="{get_cxxflags()}"',
372 f
"CC='clang-{clang_version}'",
373 f
"CXX='clang++-{clang_version}'",
374 "--enable-option-checking=fatal",
377 "--enable-fortify-source=auto",
378 "--enable-auto-var-init=pattern",
383 def ci_auth_configure(c
):
384 sanitizers
= get_sanitizers()
386 unittests
= os
.getenv('UNIT_TESTS')
387 if unittests
== 'yes':
388 unittests
= '--enable-unit-tests --enable-backend-unit-tests'
392 fuzz_targets
= os
.getenv('FUZZING_TARGETS')
393 fuzz_targets
= '--enable-fuzz-targets' if fuzz_targets
== 'yes' else ''
409 configure_cmd
= " ".join([
410 get_base_configure_cmd(),
411 "LDFLAGS='-L/usr/local/lib -Wl,-rpath,/usr/local/lib'",
412 f
"--with-modules='{modules}'",
414 "--enable-experimental-pkcs11",
415 "--enable-experimental-gss-tsig",
416 "--enable-remotebackend-zeromq",
419 "--prefix=/opt/pdns-auth",
425 res
= c
.run(configure_cmd
, warn
=True)
427 c
.run('cat config.log')
428 raise UnexpectedExit(res
)
432 def ci_rec_configure(c
):
433 sanitizers
= get_sanitizers()
435 unittests
= os
.getenv('UNIT_TESTS')
436 unittests
= '--enable-unit-tests' if unittests
== 'yes' else ''
438 configure_cmd
= " ".join([
439 get_base_configure_cmd(),
441 "--prefix=/opt/pdns-recursor",
445 "--enable-dns-over-tls",
449 res
= c
.run(configure_cmd
, warn
=True)
451 c
.run('cat config.log')
452 raise UnexpectedExit(res
)
456 def ci_dnsdist_configure(c
, features
):
457 additional_flags
= ''
458 if features
== 'full':
459 features_set
= '--enable-dnstap \
461 --enable-dns-over-tls \
462 --enable-dns-over-https \
464 --prefix=/opt/dnsdist \
474 features_set
= '--disable-dnstap \
483 --without-libsodium \
488 additional_flags
= '-DDISABLE_COMPLETION \
489 -DDISABLE_DELAY_PIPE \
490 -DDISABLE_DYNBLOCKS \
491 -DDISABLE_PROMETHEUS \
493 -DDISABLE_BUILTIN_HTML \
496 -DDISABLE_DEPRECATED_DYNBLOCK \
497 -DDISABLE_LUA_WEB_HANDLERS \
498 -DDISABLE_NON_FFI_DQ_BINDINGS \
499 -DDISABLE_POLICIES_BINDINGS \
500 -DDISABLE_PACKETCACHE_BINDINGS \
501 -DDISABLE_DOWNSTREAM_BINDINGS \
502 -DDISABLE_COMBO_ADDR_BINDINGS \
503 -DDISABLE_CLIENT_STATE_BINDINGS \
504 -DDISABLE_QPS_LIMITER_BINDINGS \
505 -DDISABLE_SUFFIX_MATCH_BINDINGS \
506 -DDISABLE_NETMASK_BINDINGS \
507 -DDISABLE_DNSNAME_BINDINGS \
508 -DDISABLE_DNSHEADER_BINDINGS \
510 -DDISABLE_WEB_CACHE_MANAGEMENT \
511 -DDISABLE_WEB_CONFIG \
512 -DDISABLE_RULES_ALTERING_QUERIES \
513 -DDISABLE_ECS_ACTIONS \
514 -DDISABLE_TOP_N_BINDINGS \
515 -DDISABLE_OCSP_STAPLING \
516 -DDISABLE_HASHED_CREDENTIALS \
517 -DDISABLE_FALSE_SHARING_PADDING \
519 unittests
= ' --enable-unit-tests' if os
.getenv('UNIT_TESTS') == 'yes' else ''
520 fuzztargets
= '--enable-fuzz-targets' if os
.getenv('FUZZING_TARGETS') == 'yes' else ''
521 sanitizers
= ' '.join('--enable-'+x
for x
in os
.getenv('SANITIZERS').split('+')) if os
.getenv('SANITIZERS') != '' else ''
522 cflags
= '-O1 -Werror=vla -Werror=shadow -Wformat=2 -Werror=format-security -Werror=string-plus-int'
523 cxxflags
= cflags
+ ' -Wp,-D_GLIBCXX_ASSERTIONS ' + additional_flags
524 res
= c
.run(f
'''CFLAGS="%s" \
526 AR=llvm-ar-{clang_version} \
527 RANLIB=llvm-ranlib-{clang_version} \
529 CC='clang-{clang_version}' \
530 CXX='clang++-{clang_version}' \
531 --enable-option-checking=fatal \
532 --enable-fortify-source=auto \
533 --enable-auto-var-init=pattern \
535 --prefix=/opt/dnsdist %s %s %s %s''' % (cflags
, cxxflags
, features_set
, sanitizers
, unittests
, fuzztargets
), warn
=True)
537 c
.run('cat config.log')
538 raise UnexpectedExit(res
)
542 c
.run('make -j8 -k V=1')
545 def ci_auth_make_bear(c
):
546 # Needed for clang-tidy -line-filter vs project structure shenanigans
548 c
.run('bear --append -- make -j8 -k V=1 -C ..')
552 c
.run('make -j8 -k V=1')
555 def ci_rec_make_bear(c
):
556 # Assumed to be running under ./pdns/recursordist/
557 c
.run('bear --append -- make -j8 -k V=1')
560 def ci_dnsdist_make(c
):
561 c
.run('make -j4 -k V=1')
564 def ci_dnsdist_make_bear(c
):
565 # Assumed to be running under ./pdns/dnsdistdist/
566 c
.run('bear --append -- make -j4 -k V=1')
569 def ci_auth_install_remotebackend_test_deps(c
):
570 with c
.cd('modules/remotebackend'):
571 # c.run('bundle config set path vendor/bundle')
572 c
.run('sudo ruby -S bundle install')
573 c
.sudo('apt-get install -y socat')
576 def ci_auth_run_unit_tests(c
):
577 res
= c
.run('make check', warn
=True)
579 c
.run('cat pdns/test-suite.log', warn
=True)
580 c
.run('cat modules/remotebackend/test-suite.log', warn
=True)
581 raise UnexpectedExit(res
)
584 def ci_rec_run_unit_tests(c
):
585 res
= c
.run('make check', warn
=True)
587 c
.run('cat test-suite.log')
588 raise UnexpectedExit(res
)
591 def ci_dnsdist_run_unit_tests(c
):
592 res
= c
.run('make check', warn
=True)
594 c
.run('cat test-suite.log')
595 raise UnexpectedExit(res
)
598 def ci_make_distdir(c
):
599 res
= c
.run('make distdir')
602 def ci_make_install(c
):
603 res
= c
.run('make install') # FIXME: this builds auth docs - again
606 def add_auth_repo(c
, dist_name
, dist_release_name
, pdns_repo_version
):
607 c
.sudo('apt-get install -y curl gnupg2')
608 if pdns_repo_version
== 'master':
609 c
.sudo('curl -s -o /etc/apt/trusted.gpg.d/pdns-repo.asc https://repo.powerdns.com/CBC8B383-pub.asc')
611 c
.sudo('curl -s -o /etc/apt/trusted.gpg.d/pdns-repo.asc https://repo.powerdns.com/FD380FBB-pub.asc')
612 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")
613 c
.run("echo 'Package: pdns-*' | sudo tee /etc/apt/preferences.d/pdns")
614 c
.run("echo 'Pin: origin repo.powerdns.com' | sudo tee -a /etc/apt/preferences.d/pdns")
615 c
.run("echo 'Pin-Priority: 600' | sudo tee -a /etc/apt/preferences.d/pdns")
616 c
.sudo('apt-get update')
619 def test_api(c
, product
, backend
=''):
620 if product
== 'recursor':
621 with c
.cd('regression-tests.api'):
622 c
.run(f
'PDNSRECURSOR=/opt/pdns-recursor/sbin/pdns_recursor ./runtests recursor {backend}')
623 elif product
== 'auth':
624 with c
.cd('regression-tests.api'):
625 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}')
627 raise Failure('unknown product')
629 backend_regress_tests
= dict(
633 'bind-dnssec-nsec3-both',
634 'bind-dnssec-nsec3-optout-both',
635 'bind-dnssec-nsec3-narrow',
636 # FIXME 'bind-dnssec-pkcs11'
642 lua2
= ['lua2', 'lua2-dnssec'],
643 tinydns
= ['tinydns'],
645 'remotebackend-pipe',
646 'remotebackend-unix',
647 'remotebackend-http',
648 'remotebackend-zeromq',
649 'remotebackend-pipe-dnssec',
650 'remotebackend-unix-dnssec',
651 'remotebackend-http-dnssec',
652 'remotebackend-zeromq-dnssec'
655 'lmdb-nodnssec-both',
658 'lmdb-nsec3-optout-both',
663 'gmysql-nodnssec-both',
665 'gmysql-nsec3-optout-both',
666 'gmysql-nsec3-narrow',
671 'gpgsql-nodnssec-both',
673 'gpgsql-nsec3-optout-both',
674 'gpgsql-nsec3-narrow',
679 'gsqlite3-nodnssec-both',
680 'gsqlite3-nsec3-both',
681 'gsqlite3-nsec3-optout-both',
682 'gsqlite3-nsec3-narrow'
684 godbc_sqlite3
= ['godbc_sqlite3-nodnssec'],
687 'godbc_mssql-nodnssec',
689 'godbc_mssql-nsec3-optout',
690 'godbc_mssql-nsec3-narrow'
697 geoip_mmdb
= ['geoip'],
700 godbc_mssql_credentials
= {"username": "sa", "password": "SAsa12%%"}
706 Server={auth_backend_ip_addr}
711 [pdns-mssql-docker-nodb]
714 Server={auth_backend_ip_addr}
720 Database = pdns.sqlite3
724 Database = pdns.sqlite32
727 def setup_godbc_mssql(c
):
728 with
open(os
.path
.expanduser("~/.odbc.ini"), "a") as f
:
729 f
.write(godbc_config
)
730 c
.sudo('sh -c \'echo "Threading=1" | cat /usr/share/tdsodbc/odbcinst.ini - | tee -a /etc/odbcinst.ini\'')
731 c
.sudo('sed -i "s/libtdsodbc.so/\/usr\/lib\/x86_64-linux-gnu\/odbc\/libtdsodbc.so/g" /etc/odbcinst.ini')
732 c
.run(f
'echo "create database pdns" | isql -v pdns-mssql-docker-nodb {godbc_mssql_credentials["username"]} {godbc_mssql_credentials["password"]}')
733 # FIXME: Skip 8bit-txt-unescaped test
734 c
.run('touch ${PWD}/regression-tests/tests/8bit-txt-unescaped/skip')
736 def setup_godbc_sqlite3(c
):
737 with
open(os
.path
.expanduser("~/.odbc.ini"), "a") as f
:
738 f
.write(godbc_config
)
739 c
.sudo('sed -i "s/libsqlite3odbc.so/\/usr\/lib\/x86_64-linux-gnu\/odbc\/libsqlite3odbc.so/g" /etc/odbcinst.ini')
741 def setup_ldap_client(c
):
742 c
.sudo('DEBIAN_FRONTEND=noninteractive apt-get install -y ldap-utils')
743 c
.sudo(f
'sh -c \'echo "{auth_backend_ip_addr} ldapserver" | tee -a /etc/hosts\'')
746 def test_auth_backend(c
, backend
):
747 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'
749 if backend
== 'remote':
750 ci_auth_install_remotebackend_test_deps(c
)
752 if backend
== 'authpy':
753 c
.sudo(f
'sh -c \'echo "{auth_backend_ip_addr} kerberos-server" | tee -a /etc/hosts\'')
754 with c
.cd('regression-tests.auth-py'):
755 c
.run(f
'{pdns_auth_env_vars} WITHKERBEROS=YES ./runtests')
758 if backend
== 'godbc_sqlite3':
759 setup_godbc_sqlite3(c
)
760 with c
.cd('regression-tests'):
761 for variant
in backend_regress_tests
[backend
]:
762 c
.run(f
'{pdns_auth_env_vars} GODBC_SQLITE3_DSN=pdns-sqlite3-1 ./start-test-stop 5300 {variant}')
765 if backend
== 'godbc_mssql':
767 with c
.cd('regression-tests'):
768 for variant
in backend_regress_tests
[backend
]:
769 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}')
772 if backend
== 'ldap':
775 if backend
== 'geoip_mmdb':
776 with c
.cd('regression-tests'):
777 for variant
in backend_regress_tests
[backend
]:
778 c
.run(f
'{pdns_auth_env_vars} geoipdatabase=../modules/geoipbackend/regression-tests/GeoLiteCity.mmdb ./start-test-stop 5300 {variant}')
781 with c
.cd('regression-tests'):
782 if backend
== 'lua2':
783 c
.run('touch trustedkeys') # avoid silly error during cleanup
784 for variant
in backend_regress_tests
[backend
]:
785 c
.run(f
'{pdns_auth_env_vars} ./start-test-stop 5300 {variant}')
787 if backend
== 'gsqlite3':
788 if os
.getenv('SKIP_IPV6_TESTS'):
789 pdns_auth_env_vars
+= ' context=noipv6'
790 with c
.cd('regression-tests.nobackend'):
791 c
.run(f
'{pdns_auth_env_vars} ./runtests')
792 c
.run('/opt/pdns-auth/bin/pdnsutil test-algorithms')
796 def test_ixfrdist(c
):
797 with c
.cd('regression-tests.ixfrdist'):
798 c
.run('IXFRDISTBIN=/opt/pdns-auth/bin/ixfrdist ./runtests')
802 c
.run('chmod +x /opt/dnsdist/bin/*')
803 c
.run('ls -ald /var /var/agentx /var/agentx/master')
804 c
.run('ls -al /var/agentx/master')
805 with c
.cd('regression-tests.dnsdist'):
806 c
.run('DNSDISTBIN=/opt/dnsdist/bin/dnsdist ./runtests')
809 def test_regression_recursor(c
):
810 c
.run('/opt/pdns-recursor/sbin/pdns_recursor --version')
811 c
.run('PDNSRECURSOR=/opt/pdns-recursor/sbin/pdns_recursor RECCONTROL=/opt/pdns-recursor/bin/rec_control ./build-scripts/test-recursor')
814 def test_bulk_recursor(c
, threads
, mthreads
, shards
):
815 # We run an extremely small version of the bulk test, as GH does not seem to be able to handle the UDP load
816 with c
.cd('regression-tests'):
817 c
.run('curl -LO http://s3-us-west-1.amazonaws.com/umbrella-static/top-1m.csv.zip')
818 c
.run('unzip top-1m.csv.zip -d .')
819 c
.run('chmod +x /opt/pdns-recursor/bin/* /opt/pdns-recursor/sbin/*')
820 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}')
823 def install_swagger_tools(c
):
824 c
.run('npm install -g api-spec-converter')
827 def swagger_syntax_check(c
):
828 c
.run('api-spec-converter docs/http-api/swagger/authoritative-api-swagger.yaml -f swagger_2 -t openapi_3 -s json -c')
831 def install_coverity_tools(c
, project
):
832 token
= os
.getenv('COVERITY_TOKEN')
833 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)
836 def coverity_clang_configure(c
):
837 c
.sudo(f
'/usr/local/bin/cov-configure --template --comptype clangcc --compiler clang++-{clang_version}')
840 def coverity_make(c
):
841 c
.run('/usr/local/bin/cov-build --dir cov-int make -j8 -k')
844 def coverity_tarball(c
, tarball
):
845 c
.run(f
'tar caf {tarball} cov-int')
848 def coverity_upload(c
, email
, project
, tarball
):
849 token
= os
.getenv('COVERITY_TOKEN')
850 c
.run(f
'curl --form token={token} \
851 --form email="{email}" \
852 --form file=@{tarball} \
853 --form version="$(./builder-support/gen-version)" \
854 --form description="master build" \
855 https://scan.coverity.com/builds?project={project}', hide
=True)
859 if '/usr/lib/ccache' not in os
.environ
['PATH']:
860 os
.environ
['PATH']='/usr/lib/ccache:'+os
.environ
['PATH']