podman: Add ptest support for system tests

Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
This commit is contained in:
Andrei Gherzan 2022-09-05 13:30:03 +02:00 committed by Bruce Ashfield
parent 481b716f7c
commit 758da82203
2 changed files with 39 additions and 1 deletions

View File

@ -0,0 +1,13 @@
#!/bin/sh
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: MIT
#
# Podman system tests
#
# The system tests don't need any go related variables. Dummy-define them to
# avoid useless warnings/errors.
GOOS=undefined GO=true BUILDTAGS= make localsystem

View File

@ -21,6 +21,7 @@ SRCREV = "754ec89a8a185d308ca5ed08afaf34d6cbda08da"
SRC_URI = " \
git://github.com/containers/libpod.git;branch=v4.2;protocol=https \
${@bb.utils.contains('PACKAGECONFIG', 'rootless', 'file://50-podman-rootless.conf', '', d)} \
file://run-ptest \
"
LICENSE = "Apache-2.0"
@ -49,7 +50,7 @@ TOOLCHAIN = "gcc"
export BUILDFLAGS="${GOBUILDFLAGS}"
inherit go goarch
inherit systemd pkgconfig
inherit systemd pkgconfig ptest
do_configure[noexec] = "1"
@ -110,6 +111,17 @@ do_install() {
fi
}
do_install_ptest () {
cp ${S}/src/import/Makefile ${D}${PTEST_PATH}
install -d ${D}${PTEST_PATH}/test
cp -r ${S}/src/import/test/system ${D}${PTEST_PATH}/test
# Some compatibility links for the Makefile assumptions.
install -d ${D}${PTEST_PATH}/bin
ln -s ${bindir}/podman ${D}${PTEST_PATH}/bin/podman
ln -s ${bindir}/podman-remote ${D}${PTEST_PATH}/bin/podman-remote
}
FILES:${PN} += " \
${systemd_unitdir}/system/* \
${systemd_unitdir}/user/* \
@ -129,3 +141,16 @@ RDEPENDS:${PN} += "\
"
RRECOMMENDS:${PN} += "slirp4netns kernel-module-xt-masquerade kernel-module-xt-comment"
RCONFLICTS:${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'docker', 'docker', '', d)}"
RDEPENDS:${PN}-ptest += " \
bash \
bats \
buildah \
catatonit \
coreutils \
file \
gnupg \
jq \
make \
tar \
"