diff options
| author | Gyorgy Sarvari <skandigraun@gmail.com> | 2025-12-16 12:58:37 +0100 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2025-12-16 19:57:34 -0800 |
| commit | 70a2b417c60d01e47d0921a7c1459a5b9026626a (patch) | |
| tree | 8cef0a91ee60e2f883d9b192c07e9b43f202b689 | |
| parent | 0df484a9222fe1624f3e03f4981c12ca24a6ba84 (diff) | |
| download | meta-openembedded-70a2b417c60d01e47d0921a7c1459a5b9026626a.tar.gz | |
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>
3 files changed, 24 insertions, 5 deletions
diff --git a/meta-networking/conf/include/ptest-packagelists-meta-networking.inc b/meta-networking/conf/include/ptest-packagelists-meta-networking.inc index 838aee94d3..9bbae5ac91 100644 --- a/meta-networking/conf/include/ptest-packagelists-meta-networking.inc +++ b/meta-networking/conf/include/ptest-packagelists-meta-networking.inc | |||
| @@ -23,6 +23,7 @@ PTESTS_FAST_META_NETWORKING = "\ | |||
| 23 | python3-scapy \ | 23 | python3-scapy \ |
| 24 | squid \ | 24 | squid \ |
| 25 | tcpdump \ | 25 | tcpdump \ |
| 26 | unbound \ | ||
| 26 | wolfssl \ | 27 | wolfssl \ |
| 27 | " | 28 | " |
| 28 | PTESTS_FAST_META_NETWORKING:remove:libc-musl = "\ | 29 | PTESTS_FAST_META_NETWORKING:remove:libc-musl = "\ |
diff --git a/meta-networking/recipes-support/unbound/unbound/run-ptest b/meta-networking/recipes-support/unbound/unbound/run-ptest index 433a687c65..3801233eeb 100644 --- a/meta-networking/recipes-support/unbound/unbound/run-ptest +++ b/meta-networking/recipes-support/unbound/unbound/run-ptest | |||
| @@ -2,15 +2,27 @@ | |||
| 2 | 2 | ||
| 3 | cd tests || exit 1 | 3 | cd tests || exit 1 |
| 4 | retVal=0 | 4 | retVal=0 |
| 5 | ./unittest | 5 | if ./unittest; then |
| 6 | ./testbound -s | 6 | echo PASS: unittest |
| 7 | else | ||
| 8 | echo FAIL: unittest | ||
| 9 | retVal=1 | ||
| 10 | fi | ||
| 11 | |||
| 12 | if ./testbound -s; then | ||
| 13 | echo PASS: testbound selftest | ||
| 14 | else | ||
| 15 | echo FAIL: testbound selftest | ||
| 16 | retVal=1 | ||
| 17 | fi | ||
| 18 | |||
| 7 | for x in ./testdata/*.rpl; do | 19 | for x in ./testdata/*.rpl; do |
| 8 | output="$(./testbound -p $x -o -vvvvv 2>&1)" | 20 | output="$(./testbound -p $x -o -vvvvv 2>&1)" |
| 9 | if test $? -eq 0; then | 21 | if test $? -eq 0; then |
| 10 | echo "$x :Pass" | 22 | echo "PASS: $x" |
| 11 | else | 23 | else |
| 12 | echo "$output" | 24 | echo "$output" |
| 13 | echo "$x :Fail" | 25 | echo "FAIL: $x" |
| 14 | retVal=1 | 26 | retVal=1 |
| 15 | fi | 27 | fi |
| 16 | done | 28 | done |
diff --git a/meta-networking/recipes-support/unbound/unbound_1.24.2.bb b/meta-networking/recipes-support/unbound/unbound_1.24.2.bb index 4ae8db4d08..e41e2dc065 100644 --- a/meta-networking/recipes-support/unbound/unbound_1.24.2.bb +++ b/meta-networking/recipes-support/unbound/unbound_1.24.2.bb | |||
| @@ -47,8 +47,11 @@ do_install:append() { | |||
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | do_install_ptest() { | 49 | do_install_ptest() { |
| 50 | install -d ${D}${PTEST_PATH}/tests | ||
| 51 | install -d ${D}${PTEST_PATH}/tests/testdata | 50 | install -d ${D}${PTEST_PATH}/tests/testdata |
| 51 | install -d ${D}${PTEST_PATH}/sources/${BP} | ||
| 52 | # unittests are looking for the data in the source folder, though it's the | ||
| 53 | # same data used by the other tests | ||
| 54 | ln -sr ${D}${PTEST_PATH}/tests ${D}${PTEST_PATH}/sources/${BP}/testdata | ||
| 52 | 55 | ||
| 53 | install -m 0544 ${B}/unittest ${D}${PTEST_PATH}/tests/ | 56 | install -m 0544 ${B}/unittest ${D}${PTEST_PATH}/tests/ |
| 54 | install -m 0544 ${B}/testbound ${D}${PTEST_PATH}/tests/ | 57 | install -m 0544 ${B}/testbound ${D}${PTEST_PATH}/tests/ |
| @@ -56,7 +59,10 @@ do_install_ptest() { | |||
| 56 | install -m 0664 ${S}/testdata/test_sigs* ${D}${PTEST_PATH}/tests/ | 59 | install -m 0664 ${S}/testdata/test_sigs* ${D}${PTEST_PATH}/tests/ |
| 57 | install -m 0664 ${S}/testdata/test_ds* ${D}${PTEST_PATH}/tests/ | 60 | install -m 0664 ${S}/testdata/test_ds* ${D}${PTEST_PATH}/tests/ |
| 58 | install -m 0664 ${S}/testdata/test_nsec3_hash* ${D}${PTEST_PATH}/tests/ | 61 | install -m 0664 ${S}/testdata/test_nsec3_hash* ${D}${PTEST_PATH}/tests/ |
| 62 | install -m 0664 ${S}/testdata/test_ldnsrr* ${D}${PTEST_PATH}/tests/ | ||
| 63 | install -m 0664 ${S}/testdata/zonemd.example* ${D}${PTEST_PATH}/tests/ | ||
| 59 | install -m 0644 ${S}/testdata/*.rpl ${D}/${PTEST_PATH}/tests/testdata/ | 64 | install -m 0644 ${S}/testdata/*.rpl ${D}/${PTEST_PATH}/tests/testdata/ |
| 65 | |||
| 60 | } | 66 | } |
| 61 | 67 | ||
| 62 | SYSTEMD_SERVICE:${PN} = "${BPN}.service" | 68 | SYSTEMD_SERVICE:${PN} = "${BPN}.service" |
