From: Pratik Farkase <pratik.farkase@est.tech>
To: openembedded-core@lists.openembedded.org
Cc: pratik.farkase@ericsson.com, Pratik Farkase <pratik.farkase@est.tech>
Subject: [OE-core][PATCH v2] libksba: add ptest support
Date: Fri, 13 Feb 2026 11:31:07 +0100 [thread overview]
Message-ID: <20260213103107.19853-1-pratik.farkase@est.tech> (raw)
In-Reply-To: <20260213101425.8492-1-pratik.farkase@est.tech>
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 <pratik.farkase@est.tech>
---
Changes in v2:
- Fix SRC_URI syntax: add missing backslash after
ksba-add-pkgconfig-support.patch
---
.../distro/include/ptest-packagelists.inc | 1 +
.../recipes-support/libksba/libksba/run-ptest | 12 ++++++++++
meta/recipes-support/libksba/libksba_1.6.7.bb | 22 +++++++++++++++++--
3 files changed, 33 insertions(+), 2 deletions(-)
create mode 100755 meta/recipes-support/libksba/libksba/run-ptest
diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
index fbbd118255..d11caa745d 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -32,6 +32,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 0000000000..d09bbb0cdf
--- /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 d97fa84977..4b9e22538c 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"
--
2.43.0
prev parent reply other threads:[~2026-02-13 10:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-13 10:14 [OE-core][PATCH v1] libksba: add ptest support Pratik Farkase
2026-02-13 10:31 ` Pratik Farkase [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260213103107.19853-1-pratik.farkase@est.tech \
--to=pratik.farkase@est.tech \
--cc=openembedded-core@lists.openembedded.org \
--cc=pratik.farkase@ericsson.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox