export PDNSRECURSOR=${PDNSRECURSOR:-${PWD}/../pdns/recursordist/build/pdns_recursor}
export RECCONTROL=${RECCONTROL:-${PWD}/../pdns/recursordist/build/rec_control}
-LIBFAKETIME_DEFAULT=/usr/lib/$(arch)-linux-gnu/faketime/libfaketimeMT.so.1 # ubuntu default
+LIBFAKETIME_DEFAULT=/usr/local/lib/faketime/libfaketimeMT.so.1 # location after building and installing from https://github.com/wolfcw/libfaketime
LIBAUTHBIND_DEFAULT=/usr/lib/authbind/libauthbind.so.1
if [ $(uname -s) = "Darwin" ]; then
# macOS is not /really/ supported here; it works for some tests, and then you might need sudo.
# Run with -m 'not unreliable_on_gh' to skip tests that are unreliable on GitHUb
# Run with -m 'not (external or unreliable_on_gh)' to skip both categories
-# LIBFAKETIME is only added to LD_PRELOAD by the pyton code when needed
+# LIBFAKETIME is only added to LD_PRELOAD by the python code when needed
if [ "${LIBASAN}" != "" -o "${LIBAUTHBIND}" != "" ]; then
LD_PRELOAD="${LIBASAN} ${LIBAUTHBIND}" authbind pytest --junitxml=pytest.xml "$@"
else
'curl',
'default-jre-headless',
'bind9-dnsutils',
- 'faketime',
'gawk',
'krb5-user',
'ldnsutils',
c.sudo('touch /etc/authbind/byport/!853')
c.sudo('chmod 755 /etc/authbind/byport/!853')
+# Builds and installs libfaketime from wolfcw/libfaketime (master)
+def build_and_install_libfaketime(c):
+ c.run(f'git clone https://github.com/wolfcw/libfaketime.git {repo_home}/libfaketime')
+ with c.cd(f'{repo_home}/libfaketime'):
+ c.run('git checkout master')
+ c.run('make && sudo make install')
+
auth_backend_test_deps = dict(
gsqlite3=['sqlite3'],
gmysql=['default-libmysqlclient-dev'],
extra.extend(auth_backend_test_deps[b])
c.sudo('apt-get update')
c.sudo('DEBIAN_FRONTEND=noninteractive apt-get -y install ' + ' '.join(extra+auth_test_deps))
+ # install libfaketime manually
+ build_and_install_libfaketime(c)
@task(help={'backend': 'Backend to install test deps for, e.g. gsqlite3; can be repeated'}, iterable=['backend'], optional=['backend'])
def install_auth_test_deps(c, backend): # FIXME: rename this, we do way more than apt-get
def install_rec_test_deps(c): # FIXME: rename this, we do way more than apt-get
c.sudo('apt-get --no-install-recommends install -y ' + ' '.join(rec_bulk_deps) + ' \
pdns-server pdns-backend-bind daemontools \
- jq libfaketime lua-posix lua-socket bc authbind \
+ jq lua-posix lua-socket bc authbind \
python3-venv python3-dev default-libmysqlclient-dev libpq-dev \
protobuf-compiler snmpd prometheus')
c.run('chmod +x /opt/pdns-recursor/bin/* /opt/pdns-recursor/sbin/*')
c.sudo('/etc/init.d/snmpd restart')
time.sleep(5)
c.sudo('chmod 755 /var/agentx')
+ # install libfaketime manually
+ build_and_install_libfaketime(c)
@task(optional=['skipXDP'])
def install_dnsdist_test_deps(c, skipXDP=False): # FIXME: rename this, we do way more than apt-get