---
recipes-containers/netavark/files/run-ptest | 3 ++
recipes-containers/netavark/files/tests.patch | 17 ++++++++++
recipes-containers/netavark/netavark.inc | 31 +++++++++++++++++++
3 files changed, 51 insertions(+)
create mode 100644 recipes-containers/netavark/files/run-ptest
create mode 100644 recipes-containers/netavark/files/tests.patch
diff --git a/recipes-containers/netavark/files/run-ptest
b/recipes-containers/netavark/files/run-ptest
new file mode 100644
index 0000000..41a37dc
--- /dev/null
+++ b/recipes-containers/netavark/files/run-ptest
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+NETAVARK=/usr/libexec/podman/netavark bats ./test/
diff --git a/recipes-containers/netavark/files/tests.patch
b/recipes-containers/netavark/files/tests.patch
new file mode 100644
index 0000000..254e4e9
--- /dev/null
+++ b/recipes-containers/netavark/files/tests.patch
@@ -0,0 +1,17 @@
+diff --git a/test/helpers.bash b/test/helpers.bash
+index 89866ec..017b2b5 100644
+--- a/test/helpers.bash
++++ b/test/helpers.bash
+@@ -552,10 +552,10 @@ function run_nc_test() {
+ fi
+
+ nsenter -n -t "${CONTAINER_NS_PIDS[$container_ns]}" timeout --foreground
-v --kill=10 5 \
+- nc $nc_common_args -l -p $container_port &>"$NETAVARK_TMPDIR/nc-out"
<$stdin &
++ ncat $nc_common_args -l -p $container_port
&>"$NETAVARK_TMPDIR/nc-out" <$stdin &
+
+ data=$(random_string)
+- run_in_host_netns nc $nc_common_args $connect_ip $host_port <<<"$data"
++ run_in_host_netns ncat $nc_common_args $connect_ip $host_port <<<"$data"
+
+ got=$(cat "$NETAVARK_TMPDIR/nc-out")
+ assert "$got" == "$data" "ncat received data"
diff --git a/recipes-containers/netavark/netavark.inc
b/recipes-containers/netavark/netavark.inc
index ae3e847..1127adb 100644
--- a/recipes-containers/netavark/netavark.inc
+++ b/recipes-containers/netavark/netavark.inc
@@ -1,3 +1,5 @@
+inherit ptest
+
PACKAGECONFIG ?= "aardvark-dns"
# From the documentation of netavark
@@ -7,9 +9,38 @@ PACKAGECONFIG ?= "aardvark-dns"
PACKAGECONFIG[aardvark-dns]= " , , , aardvark-dns"
+SRC_URI += " \
+ file://run-ptest \
+ file://tests.patch \
+"
+
# Cargo installs the binary to bin so move it to where podman expects it
do_install:append() {
install -d ${D}${libexecdir}/podman/
mv ${D}${bindir}/* ${D}${libexecdir}/podman/
rm -rf ${D}${bindir}/
}
+
+
+do_install_ptest () {
+ cp -r ${S}/test ${D}${PTEST_PATH}
+}
+
+RDEPENDS:${PN}-ptest += " \
+ bats \
+ bash \
+ coreutils \
+ jq \
+ iproute2 \
+ dbus-daemon-proxy \
+ util-linux-unshare \
+ nmap \
+ procps-ps \
+ util-linux-nsenter \
+ bind-utils \
+"
+
+
+# bind-utils is used to install dig
+# procps is necessary because the ps from busybox is
+# not having the same behavior
--
2.34.1
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#7658):
https://lists.yoctoproject.org/g/meta-virtualization/message/7658
Mute This Topic: https://lists.yoctoproject.org/mt/94381612/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-