From: mingli.yu@windriver.com
To: meta-virtualization@lists.yoctoproject.org
Subject: [PATCH] netavark: Improve the ptest output
Date: Mon, 24 Jun 2024 17:10:10 +0800 [thread overview]
Message-ID: <20240624091010.787164-1-mingli.yu@windriver.com> (raw)
From: Mingli Yu <mingli.yu@windriver.com>
* The previous ptest result show as ✓ or ✗ , improve the result to
PASS or FAIL.
* Skip some cases related to sit0 device(sit kernel module) and
firewalld.
* Add nftables to RDEPENDS for netavark-ptest as 250-bridge-nftables.bats
needs it.
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
...rewalld-and-sit-module-related-cases.patch | 105 ++++++++++++++++++
recipes-containers/netavark/files/run-ptest | 2 +-
.../netavark/netavark_1.10.3.bb | 5 +
3 files changed, 111 insertions(+), 1 deletion(-)
create mode 100644 recipes-containers/netavark/files/0001-test-skip-firewalld-and-sit-module-related-cases.patch
diff --git a/recipes-containers/netavark/files/0001-test-skip-firewalld-and-sit-module-related-cases.patch b/recipes-containers/netavark/files/0001-test-skip-firewalld-and-sit-module-related-cases.patch
new file mode 100644
index 00000000..7fb58a63
--- /dev/null
+++ b/recipes-containers/netavark/files/0001-test-skip-firewalld-and-sit-module-related-cases.patch
@@ -0,0 +1,105 @@
+From d527af68458f071215e70d6e5f952017f882a626 Mon Sep 17 00:00:00 2001
+From: Mingli Yu <mingli.yu@windriver.com>
+Date: Mon, 24 Jun 2024 15:40:57 +0800
+Subject: [PATCH] test: skip firewalld and sit module related cases
+
+* Skip firewalld related cases as don't enable firewalld by default.
+
+* Skip some other cases as the sit0 device is automatically added to all
+network namespaces then this will break many test assumptions [1].
+
+[1] https://github.com/containers/netavark/issues/984
+
+Upstream-Status: Pending
+
+Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
+---
+ test/100-bridge-iptables.bats | 4 ++++
+ test/250-bridge-nftables.bats | 2 ++
+ test/300-macvlan.bats | 1 +
+ test/600-bridge-vrf.bats | 1 +
+ 4 files changed, 8 insertions(+)
+
+diff --git a/test/100-bridge-iptables.bats b/test/100-bridge-iptables.bats
+index 420547b..3ff5d04 100644
+--- a/test/100-bridge-iptables.bats
++++ b/test/100-bridge-iptables.bats
+@@ -496,6 +496,7 @@ fw_driver=iptables
+ }
+
+ @test "$fw_driver - port range forwarding dual - udp" {
++ skip
+ test_port_fw ip=dual proto=udp range=3
+ }
+
+@@ -858,6 +859,7 @@ EOF
+
+
+ @test "$fw_driver - bridge teardown" {
++ skip
+ create_container_ns
+ configs=()
+ for i in 1 2; do
+@@ -991,6 +993,7 @@ EOF
+ }
+
+ @test "$fw_driver - test firewalld reload" {
++ skip
+ setup_firewalld
+
+ run_netavark --file ${TESTSDIR}/testfiles/simplebridge.json setup $(get_container_netns_path)
+@@ -1024,6 +1027,7 @@ EOF
+ }
+
+ @test "$fw_driver - port forwarding ipv4 - tcp with firewalld reload" {
++ skip
+ test_port_fw firewalld_reload=true
+ }
+
+diff --git a/test/250-bridge-nftables.bats b/test/250-bridge-nftables.bats
+index 77bc12c..7876f53 100644
+--- a/test/250-bridge-nftables.bats
++++ b/test/250-bridge-nftables.bats
+@@ -913,6 +913,7 @@ EOF
+ }
+
+ @test "$fw_driver - test firewalld reload" {
++ skip
+ setup_firewalld
+
+ run_netavark --file ${TESTSDIR}/testfiles/simplebridge.json setup $(get_container_netns_path)
+@@ -944,6 +945,7 @@ EOF
+ }
+
+ @test "$fw_driver - port forwarding ipv4 - tcp with firewalld reload" {
++ skip
+ test_port_fw firewalld_reload=true
+ }
+
+diff --git a/test/300-macvlan.bats b/test/300-macvlan.bats
+index c062a7f..e646faf 100644
+--- a/test/300-macvlan.bats
++++ b/test/300-macvlan.bats
+@@ -329,6 +329,7 @@ EOF
+
+ @test "macvlan same interface name on container" {
+
++ skip
+ read -r -d '\0' config <<EOF
+ {
+ "container_id": "someID",
+diff --git a/test/600-bridge-vrf.bats b/test/600-bridge-vrf.bats
+index 4b95f93..dc90e92 100644
+--- a/test/600-bridge-vrf.bats
++++ b/test/600-bridge-vrf.bats
+@@ -6,6 +6,7 @@
+ load helpers
+
+ @test vrf - bridge with vrf {
++ skip
+ run_in_host_netns ip link add test-vrf type vrf table 10
+ run_in_host_netns ip link set dev test-vrf up
+
+--
+2.34.1
+
diff --git a/recipes-containers/netavark/files/run-ptest b/recipes-containers/netavark/files/run-ptest
index f6f90b15..59238d37 100644
--- a/recipes-containers/netavark/files/run-ptest
+++ b/recipes-containers/netavark/files/run-ptest
@@ -9,6 +9,6 @@ for i in `ls test`; do
if [ $i == "200-bridge-firewalld.bats" ] || [ $i == "500-plugin.bats" ] ; then
continue
fi
- [ ${i: -4 -1} == ".bats" ] && NETAVARK=/usr/libexec/podman/netavark bats test/$i
+ [ ${i: -4 -1} == ".bats" ] && NETAVARK=/usr/libexec/podman/netavark bats -t test/$i | sed -e '/^ok/ s/^ok/PASS: /g' | sed -e '/^not ok/ s/^not ok/FAIL: /g'
done
diff --git a/recipes-containers/netavark/netavark_1.10.3.bb b/recipes-containers/netavark/netavark_1.10.3.bb
index b65b73e8..30c26f0b 100644
--- a/recipes-containers/netavark/netavark_1.10.3.bb
+++ b/recipes-containers/netavark/netavark_1.10.3.bb
@@ -10,6 +10,7 @@ SRCREV = "d9f9fdc116ea3ed72a6eb4e59da33bf5d7c60b38"
#SRC_URI = "crate://crates.io/${BPN}/${PV}"
SRC_URI = "git://github.com/containers/netavark.git;protocol=https;branch=v1.10 \
file://tests.patch \
+ file://0001-test-skip-firewalld-and-sit-module-related-cases.patch \
file://run-ptest"
require ${BPN}-crates.inc
@@ -33,6 +34,9 @@ do_install:append() {
do_install_ptest() {
cp -r ${S}/test ${D}${PTEST_PATH}
+ for i in 200-bridge-firewalld.bats 400-ipvlan.bats 500-plugin.bats; do
+ [ -f ${D}${PTEST_PATH}/test/${i} ] && mv ${D}${PTEST_PATH}/test/${i} ${D}${PTEST_PATH}/test/${i}.bak;
+ done
}
# rdepends on aardvark-dns which rdepends on slirp4netns
@@ -54,6 +58,7 @@ RDEPENDS:${PN}-ptest += " \
iproute2 \
iputils \
jq \
+ nftables \
nmap \
procps-ps \
util-linux-nsenter \
--
2.34.1
next reply other threads:[~2024-06-24 9:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-24 9:10 mingli.yu [this message]
2024-06-24 21:04 ` [meta-virtualization] [PATCH] netavark: Improve the ptest output Bruce Ashfield
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240624091010.787164-1-mingli.yu@windriver.com \
--to=mingli.yu@windriver.com \
--cc=meta-virtualization@lists.yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.