aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-filter
diff options
context:
space:
mode:
authorTrevor Gamblin <trevor.gamblin@windriver.com>2021-12-16 14:15:04 -0500
committerKhem Raj <raj.khem@gmail.com>2021-12-21 18:48:51 -0800
commit668796b11c6b79f9e57175f8a9ea48095604e505 (patch)
treefa6d5a2a4e57d4449d1ac2d879844817cf9ea64d /meta-networking/recipes-filter
parentd288e98c257ce906d957f4c8c890bd0fd31fb94b (diff)
downloadmeta-openembedded-668796b11c6b79f9e57175f8a9ea48095604e505.tar.gz
libnftnl: add ptest
Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-networking/recipes-filter')
-rw-r--r--meta-networking/recipes-filter/libnftnl/libnftnl/0001-configure.ac-Add-serial-tests.patch33
-rw-r--r--meta-networking/recipes-filter/libnftnl/libnftnl/run-ptest2
-rw-r--r--meta-networking/recipes-filter/libnftnl/libnftnl_1.2.1.bb29
3 files changed, 63 insertions, 1 deletions
diff --git a/meta-networking/recipes-filter/libnftnl/libnftnl/0001-configure.ac-Add-serial-tests.patch b/meta-networking/recipes-filter/libnftnl/libnftnl/0001-configure.ac-Add-serial-tests.patch
new file mode 100644
index 0000000000..049ad2d39a
--- /dev/null
+++ b/meta-networking/recipes-filter/libnftnl/libnftnl/0001-configure.ac-Add-serial-tests.patch
@@ -0,0 +1,33 @@
+From 1cb59c1fed33607e4fb2bee9144ce45276e9cc96 Mon Sep 17 00:00:00 2001
+From: Trevor Gamblin <trevor.gamblin@windriver.com>
+Date: Tue, 14 Dec 2021 12:31:12 -0500
+Subject: [PATCH] configure.ac: Add serial-tests
+
+ptest needs buildtest-TESTS and runtest-TESTS targets.
+serial-tests is required to generate those targets.
+
+Upstream-Status: Inappropriate (default automake behavior incompatible with ptest)
+
+Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com>
+---
+ configure.ac | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 8e68035..2704214 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -8,7 +8,9 @@ AC_CONFIG_HEADERS([config.h])
+ m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
+
+ AM_INIT_AUTOMAKE([-Wall foreign tar-pax no-dist-gzip dist-bzip2
+- 1.6 subdir-objects])
++ 1.6 subdir-objects serial-tests])
++
++AM_EXTRA_RECURSIVE_TARGETS([buildtest-TESTS])
+
+ dnl kernel style compile messages
+ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+--
+2.33.1
+
diff --git a/meta-networking/recipes-filter/libnftnl/libnftnl/run-ptest b/meta-networking/recipes-filter/libnftnl/libnftnl/run-ptest
new file mode 100644
index 0000000000..133cf92d02
--- /dev/null
+++ b/meta-networking/recipes-filter/libnftnl/libnftnl/run-ptest
@@ -0,0 +1,2 @@
+#!/bin/sh
+make -C tests -k runtest-TESTS
diff --git a/meta-networking/recipes-filter/libnftnl/libnftnl_1.2.1.bb b/meta-networking/recipes-filter/libnftnl/libnftnl_1.2.1.bb
index 16de8589a7..ec4619e7b9 100644
--- a/meta-networking/recipes-filter/libnftnl/libnftnl_1.2.1.bb
+++ b/meta-networking/recipes-filter/libnftnl/libnftnl_1.2.1.bb
@@ -7,8 +7,35 @@ DEPENDS = "libmnl"
SRCREV = "09456c720e9c00eecc08e41ac6b7c291b3821ee5"
SRC_URI = "git://git.netfilter.org/libnftnl;branch=master \
file://0001-avoid-naming-local-function-as-one-of-printf-family.patch \
+ file://0001-configure.ac-Add-serial-tests.patch \
+ file://run-ptest \
"
S = "${WORKDIR}/git"
-inherit autotools pkgconfig
+inherit autotools pkgconfig ptest
+
+RDEPENDS:${PN}-ptest += " bash python3-core make"
+
+TESTDIR = "tests"
+
+do_compile_ptest() {
+ cp -rf ${S}/build-aux .
+ oe_runmake buildtest-TESTS
+}
+
+do_install_ptest() {
+ cp -rf ${B}/build-aux ${D}${PTEST_PATH}
+ install -d ${D}${PTEST_PATH}/${TESTDIR}
+ cp -rf ${B}/${TESTDIR}/Makefile ${D}${PTEST_PATH}/${TESTDIR}
+
+ # the binaries compiled in ${TESTDIR} will look for a compiler to
+ # use, which will cause failures. Substitute the binaries in
+ # ${TESTDIR}/.libs instead
+ cp -rf ${B}/${TESTDIR}/.libs/* ${D}${PTEST_PATH}/${TESTDIR}
+
+ # Alter the Makefile so that it does not try and rebuild anything in
+ # other nonexistent paths before running the actual tests
+ sed -i 's/^Makefile/_Makefile/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
+}
+