mirror of
git://git.yoctoproject.org/meta-virtualization.git
synced 2025-07-19 12:50:22 +02:00
netavark: Add ptest support
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
This commit is contained in:
parent
3e4863e579
commit
e14985f0e3
3
recipes-containers/netavark/files/run-ptest
Normal file
3
recipes-containers/netavark/files/run-ptest
Normal file
|
@ -0,0 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
NETAVARK=/usr/libexec/podman/netavark bats ./test/
|
17
recipes-containers/netavark/files/tests.patch
Normal file
17
recipes-containers/netavark/files/tests.patch
Normal file
|
@ -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"
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user