From: "Martin Hundebøll" <martin@geanix.com>
To: openembedded-core@lists.openembedded.org
Cc: "Martin Hundebøll" <martin@geanix.com>
Subject: [PATCH v3 1/2] ell: add ptests
Date: Thu, 1 Aug 2024 10:22:50 +0200 [thread overview]
Message-ID: <20240801082253.974486-1-martin@geanix.com> (raw)
Depends on openssl-native and xxd-native to allow generating
certificates used for testing.
Create the ${B}/unit dir as that seems to be missing with the automake
patches used for building tests separately from running them.
In order to build the test cases, both --enable-tests and
--enable-maintainer-mode must be passed to configure.
A few unit tests looks for files in ../ell-0.67/unit (i.e. $(top_srcdir)
in automake) when running. Instead of playing games with symlinks or
install paths, the "correct" path is just (re)defined in CFLAGS.
Skip a few tests that require additional kernel modules to be enabled.
Test execution time is about 10 seconds.
Signed-off-by: Martin Hundebøll <martin@geanix.com>
---
.../distro/include/ptest-packagelists.inc | 1 +
meta/recipes-core/ell/ell_0.67.bb | 24 ++++++++++++++++---
meta/recipes-core/ell/files/run-ptest | 23 ++++++++++++++++++
3 files changed, 45 insertions(+), 3 deletions(-)
create mode 100644 meta/recipes-core/ell/files/run-ptest
diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
index e3ab7e862925..a655439f5ebe 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -15,6 +15,7 @@ PTESTS_FAST = "\
cpio \
diffstat \
diffutils \
+ ell \
ethtool \
expat \
expect \
diff --git a/meta/recipes-core/ell/ell_0.67.bb b/meta/recipes-core/ell/ell_0.67.bb
index 6b0ebbe62113..ee9aa73d2908 100644
--- a/meta/recipes-core/ell/ell_0.67.bb
+++ b/meta/recipes-core/ell/ell_0.67.bb
@@ -10,9 +10,27 @@ SECTION = "libs"
LICENSE = "LGPL-2.1-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=fb504b67c50331fc78734fed90fb0e09"
-DEPENDS = "dbus"
+DEPENDS = "dbus openssl-native xxd-native"
-inherit autotools pkgconfig
+inherit autotools pkgconfig ptest
-SRC_URI = "https://mirrors.edge.kernel.org/pub/linux/libs/${BPN}/${BPN}-${PV}.tar.xz"
+SRC_URI = " \
+ https://mirrors.edge.kernel.org/pub/linux/libs/${BPN}/${BPN}-${PV}.tar.xz \
+ file://run-ptest \
+"
SRC_URI[sha256sum] = "97942e8cefb130b632496e5485242f3f374f3b8846800fb74fffd76dc2a0c726"
+
+EXTRA_OECONF += "--enable-tests --enable-maintainer-mode"
+CFLAGS += "-UUNITDIR -DUNITDIR="\\"./unit/\\"""
+
+do_compile:prepend() {
+ mkdir -p ${B}/unit
+}
+
+do_install_ptest() {
+ install -m755 -Dt ${D}${PTEST_PATH} $(find ${B}/unit -executable -type f)
+ install -Dt ${D}${PTEST_PATH}/unit \
+ ${S}/unit/dbus.conf \
+ ${S}/unit/settings.test \
+ $(find ${B}/unit -name \*.pem -type f)
+}
diff --git a/meta/recipes-core/ell/files/run-ptest b/meta/recipes-core/ell/files/run-ptest
new file mode 100644
index 000000000000..5b3acdd98b8a
--- /dev/null
+++ b/meta/recipes-core/ell/files/run-ptest
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+ret_val=0
+
+for test in test-*; do
+ case "$test" in
+ test-pem | test-key)
+ if ! [ -d /sys/module/pkcs8_key_parser ]; then
+ echo "SKIP: $test"
+ continue
+ fi
+ ;;
+ esac
+
+ if "./$test" >> ell_test.log 2>&1; then
+ echo "PASS: $test"
+ else
+ echo "FAIL: $test"
+ ret_val=1
+ fi
+done
+
+exit $ret_val
--
2.45.2
next reply other threads:[~2024-08-01 8:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-01 8:22 Martin Hundebøll [this message]
2024-08-01 8:22 ` [PATCH v3 2/2] ofono: add ptests Martin Hundebøll
2024-08-02 12:39 ` [OE-core] " Ross Burton
2024-08-02 12:36 ` [OE-core] [PATCH v3 1/2] ell: " Ross Burton
2024-08-02 12:51 ` Richard Purdie
2024-08-03 21:07 ` Alexandre Belloni
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=20240801082253.974486-1-martin@geanix.com \
--to=martin@geanix.com \
--cc=openembedded-core@lists.openembedded.org \
/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