lksctp-tools: move ptest from problem-list to slow-list
PATCH 1/3 lksctp-tools: move ptest from problem-list to slow-list
The tests execute and pass successfully - I managed to run them successfully, without a change on x86-64 and aarch64.
--- .../conf/include/ptest-packagelists-meta-networking.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta-networking/conf/include/ptest-packagelists-meta-networking.inc +1 -1
@@ -34,12 +34,12 @@ PTESTS_FAST_META_NETWORKING:remove:libc-musl = "\ # firewalld currently hangs forever so disable it for now # firewalld PTESTS_SLOW_META_NETWORKING = "\ + lksctp-tools \ net-snmp \ openvpn \ " PTESTS_PROBLEMS_META_NETWORKING = "\ - lksctp-tools \ nftables \ python3-scapy \ "
PATCH 2/3 python3-scapy: fix ptests
1. Install missing test files
2. Enable network access by setting a nameserver in resolv.conf because some tests require this
3. One test tries to ping Google through IPv6 - this test requires ipv6 DISTRO_FEATURE. In case ipv6 is not enabled, skip this test from the run-ptest script.
NB: the last mentioned test to work also requires IPv6 support from your ISP. My ISP is IPv4-only, and I couldn't try it out. The above comes from my reading of the testcode.
--- .../include/ptest-packagelists-meta-networking.inc | 2 +- .../recipes-devtools/python/python3-scapy/run-ptest | 7 +++++++ .../recipes-devtools/python/python3-scapy_2.6.0.bb | 12 ++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-)
meta-networking/conf/include/ptest-packagelists-meta-networking.inc +1 -1
@@ -20,6 +20,7 @@ PTESTS_FAST_META_NETWORKING = "\ mbedtls \ openhpi \ openl2tp \ + python3-scapy \ squid \ tcpdump \ wolfssl \
@@ -41,7 +42,6 @@ PTESTS_SLOW_META_NETWORKING = "\ PTESTS_PROBLEMS_META_NETWORKING = "\ nftables \ - python3-scapy \ " PTESTS_PROBLEMS_META_NETWORKING:append:libc-musl = "\ libtalloc \
meta-networking/recipes-devtools/python/python3-scapy/run-ptest +7 -0
@@ -1,4 +1,11 @@ #!/bin/sh + +if ! nslookup example.com; then + mv /etc/resolv.conf /etc/resolv.conf.bak + echo "nameserver 8.8.8.8" > /etc/resolv.conf + trap "mv /etc/resolv.conf.bak /etc/resolv.conf" INT EXIT +fi + python3 UTscapy.py -t regression.uts -f text -l -C \ -o @PTEST_PATH@/scapy_ptest_$(date +%Y%m%d-%H%M%S).log \ 2>&1 | sed -e 's/^passed None/PASS:/' -e 's/^failed None/FAIL:/'
meta-networking/recipes-devtools/python/python3-scapy_2.6.0.bb +12 -0
@@ -30,9 +30,19 @@ do_install:append() { } do_install_ptest() { + install -d ${D}${libdir}/test/pcaps install -m 0644 ${S}/scapy/tools/UTscapy.py ${D}${PTEST_PATH} install -m 0644 ${S}/test/regression.uts ${D}${PTEST_PATH} + install -m 0644 ${S}/test/pcaps/bad_rsn_parsing_overrides_ssid.pcap ${D}${libdir}/test/pcaps/ + install -m 0644 ${S}/test/pcaps/macos.pcapng.gz ${D}${libdir}/test/pcaps/ sed -i 's,@PTEST_PATH@,${PTEST_PATH},' ${D}${PTEST_PATH}/run-ptest + + # note1: if ipv6 isn't enabled, skip the related test (add '-K ipv6' argument) + # note2: to make this test work, your ISP also must support ipv6 - the test is trying + # to ping google.com through ipv6. + if [ "${@oe.utils.all_distro_features(d, 'ipv6', 'true', 'false')}" = "false" ]; then + sed -i 's/UTscapy.py/UTscapy.py -K ipv6/g' ${D}${PTEST_PATH}/run-ptest + fi } RDEPENDS:${PN} = "tcpdump python3-compression python3-cryptography python3-netclient \
@@ -41,3 +51,5 @@ RDEPENDS:${PN} = "tcpdump python3-compression python3-cryptography python3-netcl python3-difflib" RDEPENDS:${PN}-ptest += "python3-json python3-mock python3-multiprocessing \ iproute2 tshark" + +FILES:${PN}-ptest += "${libdir}/test/"
PATCH 3/3 nftables: fix ptests
In reply to Gyorgy SarvariAdd missing kernel module dependencies, fix a script that is trying to run python instead of python3, and add a patch that fixes a test (submitted upstream).
There are 2 notes:
1. For the tests to succeed the kernel must be compiled with CONFIG_NFT_TPROXY
2. There is 1 testcase that seems to be flaky: 0002-persist testcase randomly fails. When it is comparing the test output with the expected output, sometimes there is a comment present, and sometimes there isn't. Couldn't get to the bottom of this.
The second point is the reason why the recipe remains on the PTESTS_PROBLEMS_META_NETWORKING list.
--- .../0001-fix-typo-in-test-script.patch | 35 +++++++++++++++++++ .../recipes-filter/nftables/nftables_1.1.5.bb | 7 +++- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 meta-networking/recipes-filter/nftables/nftables/0001-fix-typo-in-test-script.patch
meta-networking/recipes-filter/nftables/nftables/0001-fix-typo-in-test-script.patch new file +35 -0
@@ -0,0 +1,35 @@ +From 956e7d89865b497f889483c90bc7fed9bec4e030 Mon Sep 17 00:00:00 2001 +From: Gyorgy Sarvari <[email protected]> +Date: Sun, 26 Oct 2025 18:55:06 +0100 +Subject: [PATCH 1/2] fix typo in test script + +While executing the test suite from tests/shell/testcases folder, a lot of errors +are displayed: + +tests/shell/testcases/maps/vmap_timeout: line 48: [: : integer expected + +Looking at the script, a non-existing variable (expires) is tested instead of +the existing one (expire). + +This change corrects this. + +Upstream-Status: Submitted [https://lore.kernel.org/netfilter-devel/[email protected]/T/#u] + +Signed-off-by: Gyorgy Sarvari <[email protected]> +--- + tests/shell/testcases/maps/vmap_timeout | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/shell/testcases/maps/vmap_timeout b/tests/shell/testcases/maps/vmap_timeout +index 8ac7e8e7..55d1c1b9 100755 +--- a/tests/shell/testcases/maps/vmap_timeout ++++ b/tests/shell/testcases/maps/vmap_timeout +@@ -45,7 +45,7 @@ for i in $(seq 1 100) ; do + expire=$((RANDOM%utimeout)) + + expire_str="" +- if [ "$expires" -gt 0 ]; then ++ if [ "$expire" -gt 0 ]; then + expire_str="expires ${expire}s" + fi +
meta-networking/recipes-filter/nftables/nftables_1.1.5.bb +6 -1
@@ -12,6 +12,7 @@ DEPENDS = "libmnl libnftnl bison-native \ ${@bb.utils.contains('PACKAGECONFIG', 'mini-gmp', '', 'gmp', d)}" SRC_URI = "http://www.netfilter.org/projects/nftables/files/${BP}.tar.xz \ + file://0001-fix-typo-in-test-script.patch \ file://run-ptest \ " SRC_URI[sha256sum] = "1daf10f322e14fd90a017538aaf2c034d7cc1eb1cc418ded47445d714ea168d4"
@@ -67,6 +68,9 @@ do_install() { RDEPENDS:${PN}-ptest += " ${PN}-python bash coreutils make iproute2 iputils-ping procps python3-core python3-ctypes python3-json python3-misc sed util-linux" + +# For ptests compile the kernel with CONFIG_NFT_TPROXY + RRECOMMENDS:${PN}-ptest += "\ kernel-module-nft-chain-nat kernel-module-nft-queue \ kernel-module-nft-compat kernel-module-nft-quota \
@@ -79,7 +83,7 @@ kernel-module-nft-log kernel-module-nft-socket \ kernel-module-nft-masq kernel-module-nft-synproxy \ kernel-module-nft-nat kernel-module-nft-tunnel \ kernel-module-nft-numgen kernel-module-nft-xfrm \ -kernel-module-nft-osf \ +kernel-module-nft-osf kernel-module-nft-tproxy \ kernel-module-nf-flow-table \ kernel-module-nf-flow-table-inet \ kernel-module-nf-nat \
@@ -102,6 +106,7 @@ do_install_ptest() { cp -rf ${S}/${TESTDIR} ${D}${PTEST_PATH}/${TESTDIR} sed -i 's#/usr/bin/python#/usr/bin/python3#' ${D}${PTEST_PATH}/${TESTDIR}/json_echo/run-test.py sed -i 's#/usr/bin/env python#/usr/bin/env python3#' ${D}${PTEST_PATH}/${TESTDIR}/py/nft-test.py + sed -i 's#exec python -c#exec python3 -c#' ${D}${PTEST_PATH}/${TESTDIR}/shell/helpers/json-pretty.sh # handle multilib sed -i s:@libdir@:${libdir}:g ${D}${PTEST_PATH}/run-ptest }