Skip to content

Commit

Permalink
unbound: Add ptest for unbound
Browse files Browse the repository at this point in the history
Adapt the compile 'test' phony target from Makefile and deploy as
ptest for unbound.
All test are successful on a trial and took around >9min and <10min.
Duration of ptest execution was 587 seconds on an average.

Signed-off-by: rajmohan r <[email protected]>
Signed-off-by: Khem Raj <[email protected]>
  • Loading branch information
rajmohantrgithub authored and kraj committed Jul 2, 2024
1 parent 3ae99d7 commit d8f21b1
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
17 changes: 17 additions & 0 deletions meta-networking/recipes-support/unbound/unbound/run-ptest
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

cd tests || exit 1
retVal=0
./unittest
./testbound -s
for x in ./testdata/*.rpl; do
output="$(./testbound -p $x -o -vvvvv 2>&1)"
if test $? -eq 0; then
echo "$x :Pass"
else
echo "$output"
echo "$x :Fail"
retVal=1
fi
done
exit $retVal
23 changes: 21 additions & 2 deletions meta-networking/recipes-support/unbound/unbound_1.20.0.bb
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ SECTION = "net"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=5308494bc0590c0cb036afd781d78f06"

SRC_URI = "git://github.com/NLnetLabs/unbound.git;protocol=https;branch=branch-1.20.0"
SRC_URI = "git://github.com/NLnetLabs/unbound.git;protocol=https;branch=branch-1.20.0 \
file://run-ptest \
"
SRCREV = "b9525c5fd47ba481a29b90109017d2253beb105d"

inherit autotools pkgconfig systemd update-rc.d
inherit autotools pkgconfig systemd update-rc.d ptest

DEPENDS = "openssl libtool-native bison-native expat"
RDEPENDS:${PN} = "bash openssl-bin daemonize"
Expand All @@ -32,6 +34,10 @@ 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
Expand All @@ -40,6 +46,19 @@ do_install:append() {
install -m 0755 ${S}/contrib/unbound.init_yocto ${D}${sysconfdir}/init.d/unbound
}

do_install_ptest() {
install -d ${D}${PTEST_PATH}/tests
install -d ${D}${PTEST_PATH}/tests/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 0644 ${S}/testdata/*.rpl ${D}/${PTEST_PATH}/tests/testdata/
}

SYSTEMD_SERVICE:${PN} = "${BPN}.service"

INITSCRIPT_NAME = "unbound"
Expand Down

0 comments on commit d8f21b1

Please sign in to comment.