From patchwork Thu Aug 1 08:22:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Martin_Hundeb=C3=B8ll?= X-Patchwork-Id: 47080 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94D07C3DA4A for ; Thu, 1 Aug 2024 08:23:15 +0000 (UTC) Received: from www530.your-server.de (www530.your-server.de [188.40.30.78]) by mx.groups.io with SMTP id smtpd.web11.63507.1722500586585099789 for ; Thu, 01 Aug 2024 01:23:07 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@geanix.com header.s=default2211 header.b=qvBY82vE; spf=pass (domain: geanix.com, ip: 188.40.30.78, mailfrom: martin@geanix.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=geanix.com; s=default2211; h=Content-Transfer-Encoding:Content-Type:MIME-Version: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References; bh=mf3kt2/StwQZZb/kAkt9cjwvi+vUziU0qf512+4JbXY=; b=qvBY82vEbGP/HUUi29/9Jq3Ahy cNJYfPiMsq6ACoznWX0FlTT4q6iAAgK7syPSoNzwJCproAh/8Ey+wve272D2/GOs9oDaYE52lpvqG TO5fcXr73cynPNYxPyAtOF9tgIIqRmofUtSdvYeIE2Kdk+IJHk6nMB+CaSAYs/r4mXeYBFR7lMg6y qZrJ5Wuj493qJ7AMbXYkgk+oOxielR143VjcAIhwV23DPINr2AH+zG/p4Qqa8coezwMpeGYhafbjm lj5g1kPHmEy12LsxwcWmirQ3BHdfxQnuDIDhLf1OXgPzXsr9e4+hhM/rQpAXEVxOVg+wcb+W7cHj7 BS3UxT5A==; Received: from sslproxy06.your-server.de ([78.46.172.3]) by www530.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sZR5U-000I2E-DS; Thu, 01 Aug 2024 10:23:04 +0200 Received: from [185.17.218.86] (helo=rap..) by sslproxy06.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1sZR5U-0004OZ-2I; Thu, 01 Aug 2024 10:23:04 +0200 From: =?utf-8?q?Martin_Hundeb=C3=B8ll?= To: openembedded-core@lists.openembedded.org Cc: =?utf-8?q?Martin_Hundeb=C3=B8ll?= Subject: [PATCH v3 1/2] ell: add ptests Date: Thu, 1 Aug 2024 10:22:50 +0200 Message-ID: <20240801082253.974486-1-martin@geanix.com> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-Authenticated-Sender: martin@geanix.com X-Virus-Scanned: Clear (ClamAV 0.103.10/27353/Wed Jul 31 10:27:25 2024) List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 01 Aug 2024 08:23:15 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/202727 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 --- .../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 From patchwork Thu Aug 1 08:22:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Martin_Hundeb=C3=B8ll?= X-Patchwork-Id: 47079 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95EF2C3DA64 for ; Thu, 1 Aug 2024 08:23:15 +0000 (UTC) Received: from www530.your-server.de (www530.your-server.de [188.40.30.78]) by mx.groups.io with SMTP id smtpd.web10.63485.1722500586626942944 for ; Thu, 01 Aug 2024 01:23:07 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@geanix.com header.s=default2211 header.b=HN/GZQko; spf=pass (domain: geanix.com, ip: 188.40.30.78, mailfrom: martin@geanix.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=geanix.com; s=default2211; h=Content-Transfer-Encoding:Content-Type:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID; bh=p3r1MDB66i8bd/li6tl8oyW1xsJ9qTY8PNmrDpJFVSg=; b=HN/GZQkoHYI9cd06IAhnagI4LB ra+XEM3NOfVSflDCPI8B8NCDEQxkoLLXzi61FDlQ5200EYDYZ9L6WrO1r7B3KH94LH0KfoKwN+7oJ KLhIEtxFjxzdzjPELvM58wzktNqSRA21GiuZ7v5tntoHP4emZbdr98pw3RG8FJwuknlUn0ahbt2mK /VNBm7/UW6f+uMT9/k9no0UoGMcSa39WDLS8ZtvmLW81q2JXk+d+qgiGO8D6pTr+z07xkp8RoSq/q R8NCxfRmOKUXDV9IgSDDFbVImSsfk1IdBYA7ZdrtpFDL5xlaXOIS7AyL+fBKiNZ1xzVI/PsEZyPdW BldoJCaA==; Received: from sslproxy06.your-server.de ([78.46.172.3]) by www530.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sZR5U-000I2F-Ii; Thu, 01 Aug 2024 10:23:04 +0200 Received: from [185.17.218.86] (helo=rap..) by sslproxy06.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1sZR5U-0004OZ-2f; Thu, 01 Aug 2024 10:23:04 +0200 From: =?utf-8?q?Martin_Hundeb=C3=B8ll?= To: openembedded-core@lists.openembedded.org Cc: =?utf-8?q?Martin_Hundeb=C3=B8ll?= Subject: [PATCH v3 2/2] ofono: add ptests Date: Thu, 1 Aug 2024 10:22:51 +0200 Message-ID: <20240801082253.974486-2-martin@geanix.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240801082253.974486-1-martin@geanix.com> References: <20240801082253.974486-1-martin@geanix.com> MIME-Version: 1.0 X-Authenticated-Sender: martin@geanix.com X-Virus-Scanned: Clear (ClamAV 0.103.10/27353/Wed Jul 31 10:27:25 2024) List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 01 Aug 2024 08:23:15 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/202728 Install and run the unit tests already provided by ofono. Test execution time is about a second. Signed-off-by: Martin Hundebøll --- 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}"