diff options
author | Khem Raj <raj.khem@gmail.com> | 2024-04-10 15:49:13 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2024-04-10 16:06:30 -0700 |
commit | 614956c5d7904ae55558a0294630323359d3197c (patch) | |
tree | 531496daebadf3331edb325c27662adcd3813ef4 | |
parent | 13c554605557b06ba09e54ce7ecad01a31f0c02d (diff) | |
download | meta-openembedded-614956c5d7904ae55558a0294630323359d3197c.tar.gz |
nftables: Fix ptest runs
It gets OOMs with memory < 2G on x86_64 qemu
Export NFT variable in run-ptest script its used by few tests
Add required runtime dependencies for ptests to pass
This also requires changes to kernel config
features/nf_tables/nft_test.scc and CONFIG_VETH
Signed-off-by: Khem Raj <raj.khem@gmail.com>
3 files changed, 25 insertions, 3 deletions
diff --git a/meta-networking/recipes-core/images/meta-networking-image-ptest.bb b/meta-networking/recipes-core/images/meta-networking-image-ptest.bb index f458b761f..295da982e 100644 --- a/meta-networking/recipes-core/images/meta-networking-image-ptest.bb +++ b/meta-networking/recipes-core/images/meta-networking-image-ptest.bb | |||
@@ -27,6 +27,7 @@ IMAGE_ROOTFS_EXTRA_SPACE = "324288" | |||
27 | QB_MEM = "-m 1024" | 27 | QB_MEM = "-m 1024" |
28 | # If a particular ptest needs more memroy, it can be customized: | 28 | # If a particular ptest needs more memroy, it can be customized: |
29 | #QB_MEM:virtclass-mcextend-<pn> = "-m 4096" | 29 | #QB_MEM:virtclass-mcextend-<pn> = "-m 4096" |
30 | QB_MEM:virtclass-mcextend-nftables = "-m 2048" | ||
30 | 31 | ||
31 | TEST_SUITES = "ping ssh parselogs ptest" | 32 | TEST_SUITES = "ping ssh parselogs ptest" |
32 | 33 | ||
diff --git a/meta-networking/recipes-filter/nftables/nftables/run-ptest b/meta-networking/recipes-filter/nftables/nftables/run-ptest index 363a1ee25..32ddf9f45 100644 --- a/meta-networking/recipes-filter/nftables/nftables/run-ptest +++ b/meta-networking/recipes-filter/nftables/nftables/run-ptest | |||
@@ -4,6 +4,7 @@ NFTABLESLIB=@libdir@/nftables | |||
4 | cd ${NFTABLESLIB}/ptest || exit 1 | 4 | cd ${NFTABLESLIB}/ptest || exit 1 |
5 | 5 | ||
6 | LOG="${NFTABLESLIB}/ptest/nftables_ptest_$(date +%Y%m%d-%H%M%S).log" | 6 | LOG="${NFTABLESLIB}/ptest/nftables_ptest_$(date +%Y%m%d-%H%M%S).log" |
7 | NFT=nft | ||
7 | tests/shell/run-tests.sh -v | sed -E '/I: \[OK\]/ s/^/PASS: / ; /W: \[(CHK DUMP|VALGRIND|TAINTED|DUMP FAIL|FAILED)\]/ s/^/FAIL: /' | sed "s,\x1B\[[0-9;]*[a-zA-Z],,g" | tee -a "${LOG}" | 8 | tests/shell/run-tests.sh -v | sed -E '/I: \[OK\]/ s/^/PASS: / ; /W: \[(CHK DUMP|VALGRIND|TAINTED|DUMP FAIL|FAILED)\]/ s/^/FAIL: /' | sed "s,\x1B\[[0-9;]*[a-zA-Z],,g" | tee -a "${LOG}" |
8 | 9 | ||
9 | passed=$(grep -c PASS: "${LOG}") | 10 | passed=$(grep -c PASS: "${LOG}") |
diff --git a/meta-networking/recipes-filter/nftables/nftables_1.0.9.bb b/meta-networking/recipes-filter/nftables/nftables_1.0.9.bb index ad99a80a6..771892274 100644 --- a/meta-networking/recipes-filter/nftables/nftables_1.0.9.bb +++ b/meta-networking/recipes-filter/nftables/nftables_1.0.9.bb | |||
@@ -37,8 +37,6 @@ SETUPTOOLS_SETUP_PATH = "${S}/py" | |||
37 | 37 | ||
38 | inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'setuptools3', '', d)} | 38 | inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'setuptools3', '', d)} |
39 | 39 | ||
40 | RRECOMMENDS:${PN} += "kernel-module-nf-tables" | ||
41 | |||
42 | PACKAGES =+ "${PN}-python" | 40 | PACKAGES =+ "${PN}-python" |
43 | FILES:${PN}-python = "${PYTHON_SITEPACKAGES_DIR}" | 41 | FILES:${PN}-python = "${PYTHON_SITEPACKAGES_DIR}" |
44 | RDEPENDS:${PN}-python = "python3-core python3-json ${PN}" | 42 | RDEPENDS:${PN}-python = "python3-core python3-json ${PN}" |
@@ -66,7 +64,29 @@ do_install() { | |||
66 | fi | 64 | fi |
67 | } | 65 | } |
68 | 66 | ||
69 | RDEPENDS:${PN}-ptest += " ${PN}-python bash make iproute2 iputils-ping procps python3-core python3-ctypes python3-json python3-misc sed util-linux" | 67 | RDEPENDS:${PN}-ptest += " ${PN}-python bash coreutils make iproute2 iputils-ping procps python3-core python3-ctypes python3-json python3-misc sed util-linux" |
68 | |||
69 | RRECOMMENDS:${PN}-ptest += "\ | ||
70 | kernel-module-nft-chain-nat kernel-module-nft-queue \ | ||
71 | kernel-module-nft-compat kernel-module-nft-quota \ | ||
72 | kernel-module-nft-connlimit kernel-module-nft-redir \ | ||
73 | kernel-module-nft-ct kernel-module-nft-reject \ | ||
74 | kernel-module-nft-flow-offload kernel-module-nft-reject-inet \ | ||
75 | kernel-module-nft-hash kernel-module-nft-reject-ipv4 \ | ||
76 | kernel-module-nft-limit kernel-module-nft-reject-ipv6 \ | ||
77 | kernel-module-nft-log kernel-module-nft-socket \ | ||
78 | kernel-module-nft-masq kernel-module-nft-synproxy \ | ||
79 | kernel-module-nft-nat kernel-module-nft-tunnel \ | ||
80 | kernel-module-nft-numgen kernel-module-nft-xfrm \ | ||
81 | kernel-module-nft-osf \ | ||
82 | kernel-module-nf-flow-table \ | ||
83 | kernel-module-nf-flow-table-inet \ | ||
84 | kernel-module-nf-nat \ | ||
85 | kernel-module-nf-log-syslog \ | ||
86 | kernel-module-nf-nat-ftp \ | ||
87 | kernel-module-nf-nat-sip \ | ||
88 | kernel-module-8021q \ | ||
89 | kernel-module-dummy" | ||
70 | 90 | ||
71 | TESTDIR = "tests" | 91 | TESTDIR = "tests" |
72 | 92 | ||