summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRandy MacLeod <Randy.MacLeod@windriver.com>2022-11-02 17:17:42 -0700
committerKhem Raj <raj.khem@gmail.com>2022-11-07 08:39:05 -0800
commit66585ce7cab26f7a5bb1a7bb74b6ecb51a17c049 (patch)
tree7a3c00e1476ed926abcd44abed516a40c4b05f27
parent89653bab7189bfe82419ebaf12145a6f1616e67e (diff)
downloadmeta-openembedded-66585ce7cab26f7a5bb1a7bb74b6ecb51a17c049.tar.gz
nftables: use automake ptest output format
Make run-ptest use the correct libdir for multilib builds. Log the ptest output to a date stamped file and append a test summary to the end of the log. Munge the log as it is produced to: - insert the expected automake keywords: PASS and FAIL. - remove escape sequences used for ANSI colours as well as movement commands Add additional discrete tool dependencies to the nftables-ptest list since the test suite does not work with the busybox versions. Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-networking/recipes-filter/nftables/nftables/run-ptest17
-rw-r--r--meta-networking/recipes-filter/nftables/nftables_1.0.5.bb4
2 files changed, 19 insertions, 2 deletions
diff --git a/meta-networking/recipes-filter/nftables/nftables/run-ptest b/meta-networking/recipes-filter/nftables/nftables/run-ptest
index 611b844853..27d780ace0 100644
--- a/meta-networking/recipes-filter/nftables/nftables/run-ptest
+++ b/meta-networking/recipes-filter/nftables/nftables/run-ptest
@@ -1,2 +1,17 @@
1#!/bin/sh 1#!/bin/sh
2tests/shell/run-tests.sh -v 2
3NFTABLESLIB=@libdir@/nftables
4cd ${NFTABLESLIB}/ptest
5
6LOG="${NFTABLESLIB}/ptest/nftables_ptest_$(date +%Y%m%d-%H%M%S).log"
7tests/shell/run-tests.sh -v | sed -e '/OK/ s/^/PASS: / ; /FAILED/ s/^/FAIL: /' | sed "s,\x1B\[[0-9;]*[a-zA-Z],,g" | tee -a ${LOG}
8
9passed=`grep PASS: ${LOG}|wc -l`
10failed=`grep FAIL: ${LOG}|wc -l`
11all=$((passed + failed))
12
13( echo "=== Test Summary ==="
14 echo "TOTAL: ${all}"
15 echo "PASSED: ${passed}"
16 echo "FAILED: ${failed}"
17) | tee -a ${LOG}
diff --git a/meta-networking/recipes-filter/nftables/nftables_1.0.5.bb b/meta-networking/recipes-filter/nftables/nftables_1.0.5.bb
index 1708786f49..c5a2968d18 100644
--- a/meta-networking/recipes-filter/nftables/nftables_1.0.5.bb
+++ b/meta-networking/recipes-filter/nftables/nftables_1.0.5.bb
@@ -35,7 +35,7 @@ PACKAGES =+ "${PN}-python"
35FILES:${PN}-python = "${nonarch_libdir}/${PYTHON_DIR}" 35FILES:${PN}-python = "${nonarch_libdir}/${PYTHON_DIR}"
36RDEPENDS:${PN}-python = "python3-core python3-json ${PN}" 36RDEPENDS:${PN}-python = "python3-core python3-json ${PN}"
37 37
38RDEPENDS:${PN}-ptest += " ${PN}-python make bash python3-core python3-ctypes python3-json python3-misc util-linux" 38RDEPENDS:${PN}-ptest += " ${PN}-python bash make iproute2 iputils-ping procps python3-core python3-ctypes python3-json python3-misc sed util-linux"
39 39
40TESTDIR = "tests" 40TESTDIR = "tests"
41 41
@@ -50,4 +50,6 @@ do_install_ptest() {
50 cp -rf ${S}/${TESTDIR} ${D}${PTEST_PATH}/${TESTDIR} 50 cp -rf ${S}/${TESTDIR} ${D}${PTEST_PATH}/${TESTDIR}
51 sed -i 's#/usr/bin/python#/usr/bin/python3#' ${D}${PTEST_PATH}/${TESTDIR}/json_echo/run-test.py 51 sed -i 's#/usr/bin/python#/usr/bin/python3#' ${D}${PTEST_PATH}/${TESTDIR}/json_echo/run-test.py
52 sed -i 's#/usr/bin/env python#/usr/bin/env python3#' ${D}${PTEST_PATH}/${TESTDIR}/py/nft-test.py 52 sed -i 's#/usr/bin/env python#/usr/bin/env python3#' ${D}${PTEST_PATH}/${TESTDIR}/py/nft-test.py
53 # handle multilib
54 sed -i s:@libdir@:${libdir}:g ${D}${PTEST_PATH}/run-ptest
53} 55}