From: Pratik Farkase Date: Fri, 13 Feb 2026 10:31:07 +0000 (+0100) Subject: libksba: add ptest support X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f50a2005dda8cecf3a9db44edb131e7e332fa42d;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git libksba: add ptest support Add ptest support to enable automated testing of libksba using ptest-runner. The implementation builds and installs test executables from the tests/ directory along with the required test data files from the samples/ directory. Test results on qemux86-64: PASS: cert-basic PASS: t-cms-parser PASS: t-crl-parser PASS: t-der-builder PASS: t-dnparser PASS: t-ocsp PASS: t-oid PASS: t-reader All 8 tests pass. Signed-off-by: Pratik Farkase Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc index 1a735fe9341..1bb7458fc9d 100644 --- a/meta/conf/distro/include/ptest-packagelists.inc +++ b/meta/conf/distro/include/ptest-packagelists.inc @@ -35,6 +35,7 @@ PTESTS_FAST = "\ libconvert-asn1-perl \ libexif \ libgpg-error\ + libksba \ libmd \ libnl \ libpcre \ diff --git a/meta/recipes-support/libksba/libksba/run-ptest b/meta/recipes-support/libksba/libksba/run-ptest new file mode 100755 index 00000000000..d09bbb0cdfe --- /dev/null +++ b/meta/recipes-support/libksba/libksba/run-ptest @@ -0,0 +1,12 @@ +#!/bin/sh + +cd tests + +for t in cert-basic t-cms-parser t-crl-parser t-der-builder t-dnparser t-ocsp t-oid t-reader; do + ./$t + if [ $? -eq 0 ]; then + echo "PASS: $t" + else + echo "FAIL: $t" + fi +done diff --git a/meta/recipes-support/libksba/libksba_1.6.7.bb b/meta/recipes-support/libksba/libksba_1.6.7.bb index d97fa849774..4b9e22538c5 100644 --- a/meta/recipes-support/libksba/libksba_1.6.7.bb +++ b/meta/recipes-support/libksba/libksba_1.6.7.bb @@ -18,13 +18,15 @@ DEPENDS = "libgpg-error" BINCONFIG = "${bindir}/ksba-config" -inherit autotools binconfig-disabled pkgconfig texinfo +inherit autotools binconfig-disabled pkgconfig texinfo ptest require recipes-support/gnupg/drop-unknown-suffix.inc UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html" SRC_URI = "${GNUPG_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \ - file://ksba-add-pkgconfig-support.patch" + file://ksba-add-pkgconfig-support.patch \ + file://run-ptest \ + " SRC_URI[sha256sum] = "cf72510b8ebb4eb6693eef765749d83677a03c79291a311040a5bfd79baab763" @@ -33,4 +35,20 @@ do_configure:prepend () { rm -f ${S}/m4/gpg-error.m4 } +do_compile_ptest() { + oe_runmake -C tests check TESTS= +} + +do_install_ptest() { + install -d ${D}${PTEST_PATH}/tests + + for test in ${B}/tests/cert-basic ${B}/tests/t-cms-parser ${B}/tests/t-crl-parser \ + ${B}/tests/t-der-builder ${B}/tests/t-dnparser ${B}/tests/t-ocsp \ + ${B}/tests/t-oid ${B}/tests/t-reader; do + ${B}/libtool --mode=install install -m 0755 $test ${D}${PTEST_PATH}/tests/ + done + + cp -r ${S}/tests/samples ${D}${PTEST_PATH}/tests/ +} + BBCLASSEXTEND = "native nativesdk"