From: romeroalx Date: Wed, 17 Dec 2025 17:09:53 +0000 (+0100) Subject: build and use libfaketime from source X-Git-Tag: rec-5.4.0-beta1~25^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=50c046dcb465d903620bf9ef0bdb30e0d8c6bcc0;p=thirdparty%2Fpdns.git build and use libfaketime from source --- diff --git a/regression-tests.nobackend/soa-edit/command b/regression-tests.nobackend/soa-edit/command index e935fdd985..3ff8c78ca5 100755 --- a/regression-tests.nobackend/soa-edit/command +++ b/regression-tests.nobackend/soa-edit/command @@ -33,7 +33,7 @@ delta=$((now-1418860790)) # Wed Dec 17 23:59:50 2014 UTC $PDNSUTIL --config-dir=soa-edit create-bind-db soa-edit/bind-dnssec.db $PDNSUTIL --config-dir soa-edit/ set-meta minimal.com SOA-EDIT INCREMENT-WEEKS -faketime -m -f -$delta $PDNS --config-dir=soa-edit & +LD_PRELOAD=/usr/local/lib/faketime/libfaketime.so.1 FAKETIME=-$delta $PDNS --config-dir=soa-edit & bindwait $SDIG 127.0.0.1 $port minimal.com SOA | LC_ALL=C sort diff --git a/regression-tests.recursor-dnssec/runtests b/regression-tests.recursor-dnssec/runtests index 6dadae6016..d83a3f67e7 100755 --- a/regression-tests.recursor-dnssec/runtests +++ b/regression-tests.recursor-dnssec/runtests @@ -35,7 +35,7 @@ export PDNSMODULEDIR=${PDNSMODULEDIR:-${PWD}/../regression-tests/modules} 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. @@ -73,7 +73,7 @@ fi # 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 diff --git a/tasks.py b/tasks.py index 87df630a13..a676da44eb 100644 --- a/tasks.py +++ b/tasks.py @@ -112,7 +112,6 @@ auth_test_deps = [ # FIXME: we should be generating some of these from shlibde 'curl', 'default-jre-headless', 'bind9-dnsutils', - 'faketime', 'gawk', 'krb5-user', 'ldnsutils', @@ -249,6 +248,13 @@ def setup_authbind(c): 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'], @@ -273,6 +279,8 @@ def install_auth_test_deps_only(c, backend): 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 @@ -303,7 +311,7 @@ def install_rec_bulk_ubicloud_deps(c): # FIXME: rename this, we do way more than 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/*') @@ -314,6 +322,8 @@ def install_rec_test_deps(c): # FIXME: rename this, we do way more than apt-get 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