All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bruce Ashfield <bruce.ashfield@gmail.com>
To: peng.zhang1.cn@windriver.com
Cc: meta-virtualization@lists.yoctoproject.org
Subject: Re: [meta-virtualization][PATCH] cri-o: enable ptest
Date: Thu, 21 Nov 2024 04:34:30 +0000	[thread overview]
Message-ID: <Zz64Vljz9C29rI2H@gmail.com> (raw)
In-Reply-To: <20241115141231.1778125-1-peng.zhang1.cn@windriver.com>

In message: [meta-virtualization][PATCH] cri-o: enable ptest
on 15/11/2024 Zhang, Peng (Paul) (CN) via lists.yoctoproject.org wrote:

> From: Zhang Peng <peng.zhang1.cn@windriver.com>
> 
> The ptest build for cri-o was previously disabled due to issues
> introduced with Go 1.11, which borken the build process. With the
> current Go version, these issues no longer occur, and the ptest build is
> now functional.
> This commit enables ptest support and resolves the "TMPDIR
> [buildpaths]" issue encountered during the ptest build process.

Can you include a log of the ptest running in the commit log ?
That way the baseline pass/fail is understood and captured.

> 
> Signed-off-by: Zhang Peng <peng.zhang1.cn@windriver.com>
> ---
>  recipes-containers/cri-o/cri-o_git.bb         | 37 ++++++++++++++++++-
>  .../0001-Add-trimpath-to-build-nri.test.patch | 31 ++++++++++++++++
>  recipes-containers/cri-o/files/run-ptest      | 11 ++++++
>  3 files changed, 77 insertions(+), 2 deletions(-)
>  create mode 100644 recipes-containers/cri-o/files/0001-Add-trimpath-to-build-nri.test.patch
>  create mode 100644 recipes-containers/cri-o/files/run-ptest
> 
> diff --git a/recipes-containers/cri-o/cri-o_git.bb b/recipes-containers/cri-o/cri-o_git.bb
> index efc86fbe..596a43e2 100644
> --- a/recipes-containers/cri-o/cri-o_git.bb
> +++ b/recipes-containers/cri-o/cri-o_git.bb
> @@ -17,7 +17,9 @@ At a high level, we expect the scope of cri-o to be restricted to the following
>  SRCREV_cri-o = "20c06a19cb395445620c31730c0f1a0a1922eaae"
>  SRC_URI = "\
>  	git://github.com/kubernetes-sigs/cri-o.git;branch=release-1.31;name=cri-o;protocol=https;destsuffix=${GO_SRCURI_DESTSUFFIX} \
> +        file://0001-Add-trimpath-to-build-nri.test.patch \
>          file://crio.conf \
> +        file://run-ptest \
>  	"
>  
>  # Apache-2.0 for docker
> @@ -28,7 +30,7 @@ GO_IMPORT = "import"
>  
>  PV = "1.31.0+git${SRCREV_cri-o}"
>  
> -inherit features_check
> +inherit features_check ptest
>  REQUIRED_DISTRO_FEATURES ?= "seccomp"
>  
>  DEPENDS = " \
> @@ -69,6 +71,13 @@ do_compile() {
>  	oe_runmake binaries
>  }
>  
> +do_compile_ptest() {
> +    set +e
> +
> +    cd ${S}/src/import
> +
> +    oe_runmake test-binaries
> +}
>  SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','',d)}"
>  SYSTEMD_SERVICE:${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','crio.service','',d)}"
>  SYSTEMD_AUTO_ENABLE:${PN} = "enable"
> @@ -100,6 +109,14 @@ do_install() {
>      install -d ${D}${localstatedir}/lib/crio
>  }
>  
> +do_install_ptest() {
> +    install -d ${D}${PTEST_PATH}/test
> +    install -d ${D}${PTEST_PATH}/bin
> +    install -d ${D}${PTEST_PATH}/vendor
> +    cp -rf ${S}/src/import/test ${D}${PTEST_PATH}
> +    cp -rf ${S}/src/import/bin ${D}${PTEST_PATH}
> +    cp -rf ${S}/src/import/vendor ${D}${PTEST_PATH}
> +}

I'm curious. Why does the vendor directory need to be
copied / installed for the ptest ?

>  FILES:${PN}-config = "${sysconfdir}/crio/config/*"
>  FILES:${PN} += "${systemd_unitdir}/system/*"
>  FILES:${PN} += "/usr/local/bin/*"
> @@ -109,7 +126,23 @@ FILES:${PN} += "/usr/share/containers/oci/hooks.d"
>  ALLOW_EMPTY:${PN} = "1"
>  
>  INSANE_SKIP:${PN} += "ldflags already-stripped textrel"
> +INSANE_SKIP:${PN}-ptest += "textrel"
>  
> -deltask compile_ptest_base
> +RDEPENDS:${PN}-ptest += " \
> +    bash \
> +    bats \
> +    cni \
> +    crictl \
> +    bind-utils \
> +    coreutils \
> +    dbus-daemon-proxy \
> +    iproute2 \
> +    util-linux-unshare \
> +    jq \
> +    ipcalc \
> +    slirp4netns \
> +    parallel \
> +    podman \
> +"

This is an extensive list of rdepends for a ptest.
What exactly is it testing ? I think we need to document
in a README what exactly is being tested, since this
dependency list tells me that it is not trivial and it
will be prone to breakage.

Bruce

>  
>  COMPATIBLE_HOST = "^(?!(qemu)?mips).*"
> diff --git a/recipes-containers/cri-o/files/0001-Add-trimpath-to-build-nri.test.patch b/recipes-containers/cri-o/files/0001-Add-trimpath-to-build-nri.test.patch
> new file mode 100644
> index 00000000..c6be41f0
> --- /dev/null
> +++ b/recipes-containers/cri-o/files/0001-Add-trimpath-to-build-nri.test.patch
> @@ -0,0 +1,31 @@
> +From 0bf230f59d211044e7993543e010b0d7f9dcead3 Mon Sep 17 00:00:00 2001
> +From: Peng Zhang <peng.zhang1.cn@windriver.com>
> +Date: Fri, 25 Oct 2024 10:42:02 +0800
> +Subject: [PATCH] Add --trimpath to build nri.test
> +
> +when build test-binary, TMPDIR[buildpaths] error found in nri.test
> +to fix this error, add "--trimpath" option to build nri.test.
> +
> +Upstream-Status: Inappropriate [oe specific]
> +
> +Signed-off-by: Peng Zhang <peng.zhang1.cn@windriver.com>
> +---
> + Makefile | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +Index: cri-o-1.31.0+git20c06a19cb395445620c31730c0f1a0a1922eaae/src/import/Makefile
> +===================================================================
> +--- cri-o-1.31.0+git20c06a19cb395445620c31730c0f1a0a1922eaae.orig/src/import/Makefile
> ++++ cri-o-1.31.0+git20c06a19cb395445620c31730c0f1a0a1922eaae/src/import/Makefile
> +@@ -169,7 +169,7 @@ test/checkcriu/checkcriu: $(GO_FILES)
> + 	$(GO_BUILD) $(GCFLAGS) $(GO_LDFLAGS) -tags "$(BUILDTAGS)" -o $@ ./test/checkcriu
> + 
> + test/nri/nri.test: $(wildcard test/nri/*.go)
> +-	$(GO) test --tags "test $(BUILDTAGS)" -c ./test/nri -o $@
> ++	$(GO) test --tags "test $(BUILDTAGS)" -c ./test/nri -o $@ ${TRIMPATH}
> + 
> + bin/crio: $(GO_FILES)
> + 	$(GO_BUILD) $(GCFLAGS) $(GO_LDFLAGS) -tags "$(BUILDTAGS)" -o $@ ./cmd/crio
> +-- 
> +2.34.1
> +
> diff --git a/recipes-containers/cri-o/files/run-ptest b/recipes-containers/cri-o/files/run-ptest
> new file mode 100644
> index 00000000..62abe959
> --- /dev/null
> +++ b/recipes-containers/cri-o/files/run-ptest
> @@ -0,0 +1,11 @@
> +#!/bin/sh
> +
> +./test/test_runner.sh | while IFS= read -r line; do
> +	if [[ $line =~ ^not\ ok ]]; then
> +		echo "FAIL: ${line#not ok }"
> +	elif [[ $line =~ ^ok && ! $line =~ \#\ skip ]]; then
> +		echo "PASS: ${line#ok }"
> +	elif [[ $line =~ ^ok.*#\ skip ]]; then
> +		echo "SKIP: ${line#ok }"
> +	fi
> +done
> -- 
> 2.35.5
> 

> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#8971): https://lists.yoctoproject.org/g/meta-virtualization/message/8971
> Mute This Topic: https://lists.yoctoproject.org/mt/109593003/1050810
> Group Owner: meta-virtualization+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [bruce.ashfield@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
> 



  reply	other threads:[~2024-11-21  4:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-15 14:12 [meta-virtualization][PATCH] cri-o: enable ptest peng.zhang1.cn
2024-11-21  4:34 ` Bruce Ashfield [this message]
2024-11-21  9:12   ` Zhang, Peng (Paul) (CN)
2024-11-21 14:04     ` Bruce Ashfield
2024-11-28  8:20       ` Zhang, Peng (Paul) (CN)

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=Zz64Vljz9C29rI2H@gmail.com \
    --to=bruce.ashfield@gmail.com \
    --cc=meta-virtualization@lists.yoctoproject.org \
    --cc=peng.zhang1.cn@windriver.com \
    /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.