diff options
author | Zhang Peng <peng.zhang1.cn@windriver.com> | 2025-03-11 14:56:59 +0800 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2025-03-24 18:45:11 +0000 |
commit | c949c06f0b4d6ad6f518acffcffe854b5743b52e (patch) | |
tree | 06638b8ae99f3ec6e895833cb8b9e72fe23fc4c1 | |
parent | 18630a89a2cbd461a753a7959fce4b1ad13f60f8 (diff) | |
download | meta-virtualization-c949c06f0b4d6ad6f518acffcffe854b5743b52e.tar.gz |
cri-o: Add CONTAINER_DEFAULT_RUNTIME to run-ptest
CRI-O version 1.31 and later defaults to crun instead of runc.
This change cause ptests to fail if crun is not installed on the
target system, as the test runner verifies the runtime's availability
using 'command -v "$CONTAINER_DEFAULT_RUNTIME"'.
Additionally, CRI-O specifies the runtime via the
VIRTUAL-RUNTIME_container_runtime variable as a dependency.
This commit explicitly sets the CONTAINER_DEFAULT_RUNTIME environment
variable within the run-ptest script, based on the value of
VIRTUAL-RUNTIME_container_runtime. This ensures ptests execute with
the expected container runtime.
Signed-off-by: Zhang Peng <peng.zhang1.cn@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r-- | recipes-containers/cri-o/cri-o_git.bb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/recipes-containers/cri-o/cri-o_git.bb b/recipes-containers/cri-o/cri-o_git.bb index c178395f..2d971bd7 100644 --- a/recipes-containers/cri-o/cri-o_git.bb +++ b/recipes-containers/cri-o/cri-o_git.bb | |||
@@ -117,6 +117,16 @@ do_install_ptest() { | |||
117 | install -d ${D}${PTEST_PATH}/bin | 117 | install -d ${D}${PTEST_PATH}/bin |
118 | cp -rf ${S}/src/import/test ${D}${PTEST_PATH} | 118 | cp -rf ${S}/src/import/test ${D}${PTEST_PATH} |
119 | cp -rf ${S}/src/import/bin ${D}${PTEST_PATH} | 119 | cp -rf ${S}/src/import/bin ${D}${PTEST_PATH} |
120 | # CRI-O testing changed the default container runtime from runc to crun in version 1.31+. | ||
121 | # To maintain compatibility with older tests expecting runc, and to allow for other custom runtimes, | ||
122 | # this section explicitly sets CONTAINER_DEFAULT_RUNTIME in the run-ptest script. | ||
123 | # The value is determined by the VIRTUAL-RUNTIME_container_runtime variable. | ||
124 | if [ "${VIRTUAL-RUNTIME_container_runtime}" = "virtual-runc" ]; then | ||
125 | sed -i '/^.\/test\/test_runner/iexport CONTAINER_DEFAULT_RUNTIME=runc' ${D}${PTEST_PATH}/run-ptest | ||
126 | else | ||
127 | sed -i '/^.\/test\/test_runner/iexport CONTAINER_DEFAULT_RUNTIME=${VIRTUAL-RUNTIME_container_runtime}' ${D}${PTEST_PATH}/run-ptest | ||
128 | fi | ||
129 | |||
120 | } | 130 | } |
121 | 131 | ||
122 | FILES:${PN}-config = "${sysconfdir}/crio/config/*" | 132 | FILES:${PN}-config = "${sysconfdir}/crio/config/*" |