From: "Martin Hundebøll" <martin@geanix.com>
To: openembedded-core@lists.openembedded.org
Cc: "Martin Hundebøll" <martin@geanix.com>
Subject: [PATCH v3 2/2] ofono: add ptests
Date: Thu, 1 Aug 2024 10:22:51 +0200 [thread overview]
Message-ID: <20240801082253.974486-2-martin@geanix.com> (raw)
In-Reply-To: <20240801082253.974486-1-martin@geanix.com>
Install and run the unit tests already provided by ofono. Test execution
time is about a second.
Signed-off-by: Martin Hundebøll <martin@geanix.com>
---
Change since v2:
* disable basic mux test that requires phonesim service to connect to
Change since v1:
* add missing run-ptest file
.../distro/include/ptest-packagelists.inc | 1 +
.../ofono/ofono/run-ptest | 25 +++++++++++++++++++
meta/recipes-connectivity/ofono/ofono_2.9.bb | 12 ++++++++-
3 files changed, 37 insertions(+), 1 deletion(-)
create mode 100644 meta/recipes-connectivity/ofono/ofono/run-ptest
diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
index a655439f5ebe..ad117c1bcc76 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -54,6 +54,7 @@ PTESTS_FAST = "\
lzo \
m4 \
nettle \
+ ofono \
opkg \
popt \
python3-atomicwrites \
diff --git a/meta/recipes-connectivity/ofono/ofono/run-ptest b/meta/recipes-connectivity/ofono/ofono/run-ptest
new file mode 100644
index 000000000000..99a79376382a
--- /dev/null
+++ b/meta/recipes-connectivity/ofono/ofono/run-ptest
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+ret_val=0
+
+for test in test-*; do
+ case "$test" in
+ test-mux)
+ # the basic mux test requires a phonesim server process
+ # to connect to
+ args="-s /testmux/basic"
+ ;;
+ *)
+ args=""
+ ;;
+ esac
+
+ if "./$test" $args >> ofono_test.log 2>&1; then
+ echo "PASS: $test"
+ else
+ echo "FAIL: $test"
+ ret_val=1
+ fi
+done
+
+exit $ret_val
diff --git a/meta/recipes-connectivity/ofono/ofono_2.9.bb b/meta/recipes-connectivity/ofono/ofono_2.9.bb
index 26cb9bb7ffb7..6b641a6e854d 100644
--- a/meta/recipes-connectivity/ofono/ofono_2.9.bb
+++ b/meta/recipes-connectivity/ofono/ofono_2.9.bb
@@ -10,10 +10,11 @@ DEPENDS = "dbus glib-2.0 udev mobile-broadband-provider-info ell"
SRC_URI = "\
${KERNELORG_MIRROR}/linux/network/${BPN}/${BP}.tar.xz \
file://ofono \
+ file://run-ptest \
"
SRC_URI[sha256sum] = "9d2612925a23a7fb668f297a044b5ea136215cc399ecc3f127135c8f2a9845f9"
-inherit autotools pkgconfig update-rc.d systemd gobject-introspection-data
+inherit autotools pkgconfig update-rc.d systemd gobject-introspection-data ptest
INITSCRIPT_NAME = "ofono"
INITSCRIPT_PARAMS = "defaults 22"
@@ -28,11 +29,20 @@ PACKAGECONFIG[bluez] = "--enable-bluetooth, --disable-bluetooth, bluez5"
EXTRA_OECONF += "--enable-test --enable-external-ell"
+do_compile_ptest() {
+ oe_runmake buildtest-TESTS
+}
+
do_install:append() {
install -d ${D}${sysconfdir}/init.d/
install -m 0755 ${UNPACKDIR}/ofono ${D}${sysconfdir}/init.d/ofono
}
+do_install_ptest() {
+ install -m755 -Dt ${D}${PTEST_PATH} $(find ${B}/unit -executable -type f)
+ install -m644 -Dt ${D}${PTEST_PATH}/unit ${B}/unit/test-provision.db
+}
+
PACKAGES =+ "${PN}-tests"
FILES:${PN} += "${systemd_unitdir}"
--
2.45.2
next prev parent 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 [PATCH v3 1/2] ell: add ptests Martin Hundebøll
2024-08-01 8:22 ` Martin Hundebøll [this message]
2024-08-02 12:39 ` [OE-core] [PATCH v3 2/2] ofono: " 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-2-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