Gyorgy Sarvari 70a2b417c6
unbound: complete ptest support
The recipe had already an almost working ptest config which
wasn't enabled, it just needed some small fixes to make it work:
correct the output of the run-ptest script, and install some
extra testdata.

Execution is quick, single digit seconds:

root@qemux86-64:/usr/lib/unbound/ptest/tests# ptest-runner
START: ptest-runner
2025-12-16T11:53
BEGIN: /usr/lib/unbound/ptest
Start of unbound 1.24.2 unit test.
test authzone functions
test negative cache functions
test ub_random functions
[...many lines...]
PASS: ./testdata/val_unsecds_negcache.rpl
PASS: ./testdata/val_unsecds_qtypeds.rpl
PASS: ./testdata/val_wild_pos.rpl
PASS: ./testdata/version_bind.rpl
PASS: ./testdata/version_bind_hide.rpl
PASS: ./testdata/views.rpl
DURATION: 4
END: /usr/lib/unbound/ptest
2025-12-16T11:53
STOP: ptest-runner
TOTAL: 1 FAIL: 0

Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2025-12-16 19:57:34 -08:00

72 lines
2.7 KiB
BlitzBasic

SUMMARY = "Unbound is a validating, recursive, and caching DNS resolver"
DESCRIPTION = "Unbound's design is a set of modular components which incorporate \
features including enhanced security (DNSSEC) validation, Internet Protocol \
Version 6 (IPv6), and a client resolver library API as an integral part of the \
architecture"
HOMEPAGE = "https://www.unbound.net/"
SECTION = "net"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=5308494bc0590c0cb036afd781d78f06"
SRC_URI = "git://github.com/NLnetLabs/unbound.git;protocol=https;branch=master;tag=release-${PV} \
file://run-ptest \
"
SRCREV = "f6269baa605d31859f28770e01a24e3677e5f82c"
inherit autotools pkgconfig systemd update-rc.d ptest
DEPENDS = "openssl libtool-native bison-native expat"
RDEPENDS:${PN} = "bash openssl-bin daemonize"
EXTRA_OECONF = "--with-libexpat=${STAGING_EXECPREFIXDIR} \
--disable-rpath --with-ssl=${STAGING_EXECPREFIXDIR} \
--enable-largefile"
PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
PACKAGECONFIG[dnscrypt] = "--enable-dnscrypt, --disable-dnscrypt, libsodium"
PACKAGECONFIG[systemd] = "--enable-systemd,--disable-systemd,systemd"
PACKAGECONFIG[libevent] = "--with-libevent=${STAGING_EXECPREFIXDIR},,libevent"
do_configure:append() {
sed -i -e 's#${RECIPE_SYSROOT}##g' ${B}/config.h
}
do_compile:append() {
oe_runmake tests
}
do_install:append() {
install -d ${D}${systemd_unitdir}/system
install -m 0644 ${B}/contrib/unbound.service ${D}${systemd_unitdir}/system
install -d ${D}${sysconfdir}/init.d
install -m 0755 ${S}/contrib/unbound.init_yocto ${D}${sysconfdir}/init.d/unbound
}
do_install_ptest() {
install -d ${D}${PTEST_PATH}/tests/testdata
install -d ${D}${PTEST_PATH}/sources/${BP}
# unittests are looking for the data in the source folder, though it's the
# same data used by the other tests
ln -sr ${D}${PTEST_PATH}/tests ${D}${PTEST_PATH}/sources/${BP}/testdata
install -m 0544 ${B}/unittest ${D}${PTEST_PATH}/tests/
install -m 0544 ${B}/testbound ${D}${PTEST_PATH}/tests/
install -m 0664 ${S}/testdata/test_signatures* ${D}${PTEST_PATH}/tests/
install -m 0664 ${S}/testdata/test_sigs* ${D}${PTEST_PATH}/tests/
install -m 0664 ${S}/testdata/test_ds* ${D}${PTEST_PATH}/tests/
install -m 0664 ${S}/testdata/test_nsec3_hash* ${D}${PTEST_PATH}/tests/
install -m 0664 ${S}/testdata/test_ldnsrr* ${D}${PTEST_PATH}/tests/
install -m 0664 ${S}/testdata/zonemd.example* ${D}${PTEST_PATH}/tests/
install -m 0644 ${S}/testdata/*.rpl ${D}/${PTEST_PATH}/tests/testdata/
}
SYSTEMD_SERVICE:${PN} = "${BPN}.service"
INITSCRIPT_NAME = "unbound"
INITSCRIPT_PARAMS = "defaults"