]>
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',
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}')
173 def install_libdecaf(c
, product
):
174 c
.run('git clone https://git.code.sf.net/p/ed448goldilocks/code /tmp/libdecaf')
175 with c
.cd('/tmp/libdecaf'):
176 c
.run('git checkout 41f349')
177 c
.run(f
'CC=clang-{clang_version} CXX=clang-{clang_version} '
179 '-DCMAKE_INSTALL_PREFIX=/usr/local '
180 '-DCMAKE_INSTALL_LIBDIR=lib '
181 '-DENABLE_STATIC=OFF '
182 '-DENABLE_TESTS=OFF '
183 '-DCMAKE_C_FLAGS="-Wno-sizeof-array-div -Wno-array-parameter" .')
184 c
.run('make -C build')
185 c
.run('sudo make -C build install')
186 c
.sudo(f
'mkdir -p /opt/{product}/libdecaf')
187 c
.sudo(f
'cp /usr/local/lib/libdecaf.so* /opt/{product}/libdecaf/.')
190 def install_doc_deps(c
):
191 c
.sudo('apt-get install -y ' + ' '.join(doc_deps
))
194 def install_doc_deps_pdf(c
):
195 c
.sudo('apt-get install -y ' + ' '.join(doc_deps_pdf
))
198 def install_auth_build_deps(c
):
199 c
.sudo('apt-get install -y --no-install-recommends ' + ' '.join(all_build_deps
+ git_build_deps
+ auth_build_deps
))
200 install_libdecaf(c
, 'pdns-auth')
202 def setup_authbind(c
):
203 c
.sudo('touch /etc/authbind/byport/53')
204 c
.sudo('chmod 755 /etc/authbind/byport/53')
206 auth_backend_test_deps
= dict(
207 gsqlite3
=['sqlite3'],
208 gmysql
=['default-libmysqlclient-dev'],
209 gpgsql
=['libpq-dev'],
217 godbc_sqlite3
=['libsqliteodbc'],
218 godbc_mssql
=['freetds-bin','tdsodbc'],
223 @task(help={'backend': 'Backend to install test deps for, e.g. gsqlite3; can be repeated'}, iterable
=['backend'], optional
=['backend'])
224 def install_auth_test_deps(c
, backend
): # FIXME: rename this, we do way more than apt-get
227 extra
.extend(auth_backend_test_deps
[b
])
228 c
.sudo('DEBIAN_FRONTEND=noninteractive apt-get -y install ' + ' '.join(extra
+auth_test_deps
))
230 c
.run('chmod +x /opt/pdns-auth/bin/* /opt/pdns-auth/sbin/*')
231 # c.run('''if [ ! -e $HOME/bin/jdnssec-verifyzone ]; then
232 # wget https://github.com/dblacka/jdnssec-tools/releases/download/0.14/jdnssec-tools-0.14.tar.gz
233 # tar xfz jdnssec-tools-0.14.tar.gz -C $HOME
234 # rm jdnssec-tools-0.14.tar.gz
236 # echo 'export PATH=$HOME/jdnssec-tools-0.14/bin:$PATH' >> $BASH_ENV''') # FIXME: why did this fail with no error?
237 c
.run('touch regression-tests/tests/verify-dnssec-zone/allow-missing regression-tests.nobackend/rectify-axfr/allow-missing') # FIXME: can this go?
238 # FIXME we may want to start a background recursor here to make ALIAS tests more robust
242 c
.sudo('mkdir -p /usr/local/lib')
243 c
.sudo('cp /opt/pdns-auth/libdecaf/libdecaf.so* /usr/local/lib/.')
246 def install_rec_bulk_deps(c
): # FIXME: rename this, we do way more than apt-get
247 c
.sudo('apt-get --no-install-recommends -y install ' + ' '.join(rec_bulk_deps
))
248 c
.run('chmod +x /opt/pdns-recursor/bin/* /opt/pdns-recursor/sbin/*')
251 def install_rec_test_deps(c
): # FIXME: rename this, we do way more than apt-get
252 c
.sudo('apt-get --no-install-recommends install -y ' + ' '.join(rec_bulk_deps
) + ' \
253 pdns-server pdns-backend-bind daemontools \
254 jq libfaketime lua-posix lua-socket bc authbind \
255 python3-venv python3-dev default-libmysqlclient-dev libpq-dev \
256 protobuf-compiler snmpd prometheus')
258 c
.run('chmod +x /opt/pdns-recursor/bin/* /opt/pdns-recursor/sbin/*')
262 c
.run('sed "s/agentxperms 0700 0755 recursor/agentxperms 0777 0755/g" regression-tests.recursor-dnssec/snmpd.conf | sudo tee /etc/snmp/snmpd.conf')
263 c
.sudo('/etc/init.d/snmpd restart')
265 c
.sudo('chmod 755 /var/agentx')
268 def install_dnsdist_test_deps(c
): # FIXME: rename this, we do way more than apt-get
269 c
.sudo('apt-get install -y \
274 libcurl4-openssl-dev \
287 python3-venv snmpd prometheus')
288 c
.run('sed "s/agentxperms 0700 0755 dnsdist/agentxperms 0777 0755/g" regression-tests.dnsdist/snmpd.conf | sudo tee /etc/snmp/snmpd.conf')
289 c
.sudo('/etc/init.d/snmpd restart')
291 c
.sudo('chmod 755 /var/agentx')
294 def install_rec_build_deps(c
):
295 c
.sudo('apt-get install -y --no-install-recommends ' + ' '.join(all_build_deps
+ git_build_deps
+ rec_build_deps
))
298 def install_dnsdist_build_deps(c
):
299 c
.sudo('apt-get install -y --no-install-recommends ' + ' '.join(all_build_deps
+ git_build_deps
+ dnsdist_build_deps
))
303 c
.run('BUILDER_VERSION=0.0.0-git1 autoreconf -vfi')
306 def ci_docs_build(c
):
307 c
.run('make -f Makefile.sphinx -C docs html')
310 def ci_docs_build_pdf(c
):
311 c
.run('make -f Makefile.sphinx -C docs latexpdf')
314 def ci_docs_upload_master(c
, docs_host
, pdf
, username
, product
, directory
=""):
315 rsync_cmd
= " ".join([
324 c
.run(f
"{rsync_cmd} --delete ./docs/_build/{product}-html-docs/ {username}@{docs_host}:{directory}")
325 c
.run(f
"{rsync_cmd} ./docs/_build/{product}-html-docs.tar.bz2 {username}@{docs_host}:{directory}/html-docs.tar.bz2")
326 c
.run(f
"{rsync_cmd} ./docs/_build/latex/{pdf} {username}@{docs_host}:{directory}")
329 def ci_docs_add_ssh(c
, ssh_key
, host_key
):
330 c
.run('mkdir -m 700 -p ~/.ssh')
331 c
.run(f
'echo "{ssh_key}" > ~/.ssh/id_ed25519')
332 c
.run('chmod 600 ~/.ssh/id_ed25519')
333 c
.run(f
'echo "{host_key}" > ~/.ssh/known_hosts')
336 def get_sanitizers():
337 sanitizers
= os
.getenv('SANITIZERS')
339 sanitizers
= sanitizers
.split('+')
340 sanitizers
= ['--enable-' + sanitizer
for sanitizer
in sanitizers
]
341 sanitizers
= ' '.join(sanitizers
)
351 "-Werror=format-security",
352 "-Werror=string-plus-int",
359 "-Wp,-D_GLIBCXX_ASSERTIONS",
363 def get_base_configure_cmd():
365 f
'CFLAGS="{get_cflags()}"',
366 f
'CXXFLAGS="{get_cxxflags()}"',
368 f
"CC='clang-{clang_version}'",
369 f
"CXX='clang++-{clang_version}'",
370 "--enable-option-checking=fatal",
373 "--enable-fortify-source=auto",
374 "--enable-auto-var-init=pattern",
379 def ci_auth_configure(c
):
380 sanitizers
= get_sanitizers()
382 unittests
= os
.getenv('UNIT_TESTS')
383 if unittests
== 'yes':
384 unittests
= '--enable-unit-tests --enable-backend-unit-tests'
388 fuzz_targets
= os
.getenv('FUZZING_TARGETS')
389 fuzz_targets
= '--enable-fuzz-targets' if fuzz_targets
== 'yes' else ''
405 configure_cmd
= " ".join([
406 get_base_configure_cmd(),
407 "LDFLAGS='-L/usr/local/lib -Wl,-rpath,/usr/local/lib'",
408 f
"--with-modules='{modules}'",
410 "--enable-experimental-pkcs11",
411 "--enable-experimental-gss-tsig",
412 "--enable-remotebackend-zeromq",
415 "--prefix=/opt/pdns-auth",
421 res
= c
.run(configure_cmd
, warn
=True)
423 c
.run('cat config.log')
424 raise UnexpectedExit(res
)
428 def ci_rec_configure(c
):
429 sanitizers
= get_sanitizers()
431 unittests
= os
.getenv('UNIT_TESTS')
432 unittests
= '--enable-unit-tests' if unittests
== 'yes' else ''
434 configure_cmd
= " ".join([
435 get_base_configure_cmd(),
437 "--prefix=/opt/pdns-recursor",
441 "--enable-dns-over-tls",
445 res
= c
.run(configure_cmd
, warn
=True)
447 c
.run('cat config.log')
448 raise UnexpectedExit(res
)
452 def ci_dnsdist_configure(c
, features
):
453 additional_flags
= ''
454 if features
== 'full':
455 features_set
= '--enable-dnstap \
457 --enable-dns-over-tls \
458 --enable-dns-over-https \
460 --prefix=/opt/dnsdist \
469 features_set
= '--disable-dnstap \
477 --without-libsodium \
482 additional_flags
= '-DDISABLE_COMPLETION \
483 -DDISABLE_DELAY_PIPE \
484 -DDISABLE_DYNBLOCKS \
485 -DDISABLE_PROMETHEUS \
487 -DDISABLE_BUILTIN_HTML \
490 -DDISABLE_DEPRECATED_DYNBLOCK \
491 -DDISABLE_LUA_WEB_HANDLERS \
492 -DDISABLE_NON_FFI_DQ_BINDINGS \
493 -DDISABLE_POLICIES_BINDINGS \
494 -DDISABLE_PACKETCACHE_BINDINGS \
495 -DDISABLE_DOWNSTREAM_BINDINGS \
496 -DDISABLE_COMBO_ADDR_BINDINGS \
497 -DDISABLE_CLIENT_STATE_BINDINGS \
498 -DDISABLE_QPS_LIMITER_BINDINGS \
499 -DDISABLE_SUFFIX_MATCH_BINDINGS \
500 -DDISABLE_NETMASK_BINDINGS \
501 -DDISABLE_DNSNAME_BINDINGS \
502 -DDISABLE_DNSHEADER_BINDINGS \
504 -DDISABLE_WEB_CACHE_MANAGEMENT \
505 -DDISABLE_WEB_CONFIG \
506 -DDISABLE_RULES_ALTERING_QUERIES \
507 -DDISABLE_ECS_ACTIONS \
508 -DDISABLE_TOP_N_BINDINGS \
509 -DDISABLE_OCSP_STAPLING \
510 -DDISABLE_HASHED_CREDENTIALS \
511 -DDISABLE_FALSE_SHARING_PADDING \
513 unittests
= ' --enable-unit-tests' if os
.getenv('UNIT_TESTS') == 'yes' else ''
514 sanitizers
= ' '.join('--enable-'+x
for x
in os
.getenv('SANITIZERS').split('+')) if os
.getenv('SANITIZERS') != '' else ''
515 cflags
= '-O1 -Werror=vla -Werror=shadow -Wformat=2 -Werror=format-security -Werror=string-plus-int'
516 cxxflags
= cflags
+ ' -Wp,-D_GLIBCXX_ASSERTIONS ' + additional_flags
517 res
= c
.run(f
'''CFLAGS="%s" \
519 AR=llvm-ar-{clang_version} \
520 RANLIB=llvm-ranlib-{clang_version} \
522 CC='clang-{clang_version}' \
523 CXX='clang++-{clang_version}' \
524 --enable-option-checking=fatal \
525 --enable-fortify-source=auto \
526 --enable-auto-var-init=pattern \
528 --prefix=/opt/dnsdist %s %s %s''' % (cflags
, cxxflags
, features_set
, sanitizers
, unittests
), warn
=True)
530 c
.run('cat config.log')
531 raise UnexpectedExit(res
)
535 c
.run('make -j8 -k V=1')
538 def ci_auth_make_bear(c
):
539 # Needed for clang-tidy -line-filter vs project structure shenanigans
541 c
.run('bear --append -- make -j8 -k V=1 -C ..')
545 c
.run('make -j8 -k V=1')
548 def ci_rec_make_bear(c
):
549 # Assumed to be running under ./pdns/recursordist/
550 c
.run('bear --append -- make -j8 -k V=1')
553 def ci_dnsdist_make(c
):
554 c
.run('make -j4 -k V=1')
557 def ci_dnsdist_make_bear(c
):
558 # Assumed to be running under ./pdns/dnsdistdist/
559 c
.run('bear --append -- make -j4 -k V=1')
562 def ci_auth_install_remotebackend_test_deps(c
):
563 with c
.cd('modules/remotebackend'):
564 # c.run('bundle config set path vendor/bundle')
565 c
.run('sudo ruby -S bundle install')
566 c
.sudo('apt-get install -y socat')
569 def ci_auth_run_unit_tests(c
):
570 res
= c
.run('make check', warn
=True)
572 c
.run('cat pdns/test-suite.log', warn
=True)
573 c
.run('cat modules/remotebackend/test-suite.log', warn
=True)
574 raise UnexpectedExit(res
)
577 def ci_rec_run_unit_tests(c
):
578 res
= c
.run('make check', warn
=True)
580 c
.run('cat test-suite.log')
581 raise UnexpectedExit(res
)
584 def ci_dnsdist_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_make_install(c
):
592 res
= c
.run('make install') # FIXME: this builds auth docs - again
595 def add_auth_repo(c
, dist_name
, dist_release_name
, pdns_repo_version
):
596 c
.sudo('apt-get install -y curl gnupg2')
597 if pdns_repo_version
== 'master':
598 c
.sudo('curl -s -o /etc/apt/trusted.gpg.d/pdns-repo.asc https://repo.powerdns.com/CBC8B383-pub.asc')
600 c
.sudo('curl -s -o /etc/apt/trusted.gpg.d/pdns-repo.asc https://repo.powerdns.com/FD380FBB-pub.asc')
601 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")
602 c
.run("echo 'Package: pdns-*' | sudo tee /etc/apt/preferences.d/pdns")
603 c
.run("echo 'Pin: origin repo.powerdns.com' | sudo tee -a /etc/apt/preferences.d/pdns")
604 c
.run("echo 'Pin-Priority: 600' | sudo tee -a /etc/apt/preferences.d/pdns")
605 c
.sudo('apt-get update')
608 def test_api(c
, product
, backend
=''):
609 if product
== 'recursor':
610 with c
.cd('regression-tests.api'):
611 c
.run(f
'PDNSRECURSOR=/opt/pdns-recursor/sbin/pdns_recursor ./runtests recursor {backend}')
612 elif product
== 'auth':
613 with c
.cd('regression-tests.api'):
614 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}')
616 raise Failure('unknown product')
618 backend_regress_tests
= dict(
622 'bind-dnssec-nsec3-both',
623 'bind-dnssec-nsec3-optout-both',
624 'bind-dnssec-nsec3-narrow',
625 # FIXME 'bind-dnssec-pkcs11'
631 lua2
= ['lua2', 'lua2-dnssec'],
632 tinydns
= ['tinydns'],
634 'remotebackend-pipe',
635 'remotebackend-unix',
636 'remotebackend-http',
637 'remotebackend-zeromq',
638 'remotebackend-pipe-dnssec',
639 'remotebackend-unix-dnssec',
640 'remotebackend-http-dnssec',
641 'remotebackend-zeromq-dnssec'
644 'lmdb-nodnssec-both',
647 'lmdb-nsec3-optout-both',
652 'gmysql-nodnssec-both',
654 'gmysql-nsec3-optout-both',
655 'gmysql-nsec3-narrow',
660 'gpgsql-nodnssec-both',
662 'gpgsql-nsec3-optout-both',
663 'gpgsql-nsec3-narrow',
668 'gsqlite3-nodnssec-both',
669 'gsqlite3-nsec3-both',
670 'gsqlite3-nsec3-optout-both',
671 'gsqlite3-nsec3-narrow'
673 godbc_sqlite3
= ['godbc_sqlite3-nodnssec'],
676 'godbc_mssql-nodnssec',
678 'godbc_mssql-nsec3-optout',
679 'godbc_mssql-nsec3-narrow'
686 geoip_mmdb
= ['geoip'],
689 godbc_mssql_credentials
= {"username": "sa", "password": "SAsa12%%"}
695 Server={auth_backend_ip_addr}
700 [pdns-mssql-docker-nodb]
703 Server={auth_backend_ip_addr}
709 Database = pdns.sqlite3
713 Database = pdns.sqlite32
716 def setup_godbc_mssql(c
):
717 with
open(os
.path
.expanduser("~/.odbc.ini"), "a") as f
:
718 f
.write(godbc_config
)
719 c
.sudo('sh -c \'echo "Threading=1" | cat /usr/share/tdsodbc/odbcinst.ini - | tee -a /etc/odbcinst.ini\'')
720 c
.sudo('sed -i "s/libtdsodbc.so/\/usr\/lib\/x86_64-linux-gnu\/odbc\/libtdsodbc.so/g" /etc/odbcinst.ini')
721 c
.run(f
'echo "create database pdns" | isql -v pdns-mssql-docker-nodb {godbc_mssql_credentials["username"]} {godbc_mssql_credentials["password"]}')
722 # FIXME: Skip 8bit-txt-unescaped test
723 c
.run('touch ${PWD}/regression-tests/tests/8bit-txt-unescaped/skip')
725 def setup_godbc_sqlite3(c
):
726 with
open(os
.path
.expanduser("~/.odbc.ini"), "a") as f
:
727 f
.write(godbc_config
)
728 c
.sudo('sed -i "s/libsqlite3odbc.so/\/usr\/lib\/x86_64-linux-gnu\/odbc\/libsqlite3odbc.so/g" /etc/odbcinst.ini')
730 def setup_ldap_client(c
):
731 c
.sudo('DEBIAN_FRONTEND=noninteractive apt-get install -y ldap-utils')
732 c
.sudo(f
'sh -c \'echo "{auth_backend_ip_addr} ldapserver" | tee -a /etc/hosts\'')
735 def test_auth_backend(c
, backend
):
736 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'
738 if backend
== 'remote':
739 ci_auth_install_remotebackend_test_deps(c
)
741 if backend
== 'authpy':
742 c
.sudo(f
'sh -c \'echo "{auth_backend_ip_addr} kerberos-server" | tee -a /etc/hosts\'')
743 with c
.cd('regression-tests.auth-py'):
744 c
.run(f
'{pdns_auth_env_vars} WITHKERBEROS=YES ./runtests')
747 if backend
== 'godbc_sqlite3':
748 setup_godbc_sqlite3(c
)
749 with c
.cd('regression-tests'):
750 for variant
in backend_regress_tests
[backend
]:
751 c
.run(f
'{pdns_auth_env_vars} GODBC_SQLITE3_DSN=pdns-sqlite3-1 ./start-test-stop 5300 {variant}')
754 if backend
== 'godbc_mssql':
756 with c
.cd('regression-tests'):
757 for variant
in backend_regress_tests
[backend
]:
758 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}')
761 if backend
== 'ldap':
764 if backend
== 'geoip_mmdb':
765 with c
.cd('regression-tests'):
766 for variant
in backend_regress_tests
[backend
]:
767 c
.run(f
'{pdns_auth_env_vars} geoipdatabase=../modules/geoipbackend/regression-tests/GeoLiteCity.mmdb ./start-test-stop 5300 {variant}')
770 with c
.cd('regression-tests'):
771 if backend
== 'lua2':
772 c
.run('touch trustedkeys') # avoid silly error during cleanup
773 for variant
in backend_regress_tests
[backend
]:
774 c
.run(f
'{pdns_auth_env_vars} ./start-test-stop 5300 {variant}')
776 if backend
== 'gsqlite3':
777 if os
.getenv('SKIP_IPV6_TESTS'):
778 pdns_auth_env_vars
+= ' context=noipv6'
779 with c
.cd('regression-tests.nobackend'):
780 c
.run(f
'{pdns_auth_env_vars} ./runtests')
781 c
.run('/opt/pdns-auth/bin/pdnsutil test-algorithms')
785 def test_ixfrdist(c
):
786 with c
.cd('regression-tests.ixfrdist'):
787 c
.run('IXFRDISTBIN=/opt/pdns-auth/bin/ixfrdist ./runtests')
791 c
.run('chmod +x /opt/dnsdist/bin/*')
792 c
.run('ls -ald /var /var/agentx /var/agentx/master')
793 c
.run('ls -al /var/agentx/master')
794 with c
.cd('regression-tests.dnsdist'):
795 c
.run('DNSDISTBIN=/opt/dnsdist/bin/dnsdist ./runtests')
798 def test_regression_recursor(c
):
799 c
.run('/opt/pdns-recursor/sbin/pdns_recursor --version')
800 c
.run('PDNSRECURSOR=/opt/pdns-recursor/sbin/pdns_recursor RECCONTROL=/opt/pdns-recursor/bin/rec_control ./build-scripts/test-recursor')
803 def test_bulk_recursor(c
, threads
, mthreads
, shards
):
804 # We run an extremely small version of the bulk test, as GH does not seem to be able to handle the UDP load
805 with c
.cd('regression-tests'):
806 c
.run('curl -LO http://s3-us-west-1.amazonaws.com/umbrella-static/top-1m.csv.zip')
807 c
.run('unzip top-1m.csv.zip -d .')
808 c
.run('chmod +x /opt/pdns-recursor/bin/* /opt/pdns-recursor/sbin/*')
809 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}')
812 def install_swagger_tools(c
):
813 c
.run('npm install -g api-spec-converter')
816 def swagger_syntax_check(c
):
817 c
.run('api-spec-converter docs/http-api/swagger/authoritative-api-swagger.yaml -f swagger_2 -t openapi_3 -s json -c')
820 def install_coverity_tools(c
, project
):
821 token
= os
.getenv('COVERITY_TOKEN')
822 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)
825 def coverity_clang_configure(c
):
826 c
.sudo(f
'/usr/local/bin/cov-configure --template --comptype clangcc --compiler clang++-{clang_version}')
829 def coverity_make(c
):
830 c
.run('/usr/local/bin/cov-build --dir cov-int make -j8 -k')
833 def coverity_tarball(c
, tarball
):
834 c
.run(f
'tar caf {tarball} cov-int')
837 def coverity_upload(c
, email
, project
, tarball
):
838 token
= os
.getenv('COVERITY_TOKEN')
839 c
.run(f
'curl --form token={token} \
840 --form email="{email}" \
841 --form file=@{tarball} \
842 --form version="$(./builder-support/gen-version)" \
843 --form description="master build" \
844 https://scan.coverity.com/builds?project={project}', hide
=True)
848 if '/usr/lib/ccache' not in os
.environ
['PATH']:
849 os
.environ
['PATH']='/usr/lib/ccache:'+os
.environ
['PATH']