From 34e44809505a64c045a79be185afd3d163d1fb7f Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN" Date: Mon, 14 Jul 2025 22:25:55 +0200 Subject: [PATCH] support/testing: add a crun-based runtime test for docker-compose Via the docker-compose runtime test, we can exercise the full suite of the docker-related packages: docker-compose, of course, but also docker-engine, which in turn allows exercising containerd. The latter by defualt uses runc as the container runtime, but can alternatively use crun. Extend the docker-compose runtime test with a variant that enables crun. Signed-off-by: Yann E. MORIN Signed-off-by: Julien Olivain --- .../tests/package/test_docker_compose.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/support/testing/tests/package/test_docker_compose.py b/support/testing/tests/package/test_docker_compose.py index 16027c9c3a..6a8f6f4010 100644 --- a/support/testing/tests/package/test_docker_compose.py +++ b/support/testing/tests/package/test_docker_compose.py @@ -3,7 +3,7 @@ import os import infra.basetest -class TestDockerCompose(infra.basetest.BRTest): +class BaseTestDockerCompose(infra.basetest.BRTest): scripts = ["conf/docker-compose.yml", "tests/package/sample_python_docker.py"] config = \ @@ -53,7 +53,7 @@ class TestDockerCompose(infra.basetest.BRTest): def python_docker_test(self): self.assertRunOk('python3 ./sample_python_docker.py', 120) - def test_run(self): + def do_test(self): kernel = os.path.join(self.builddir, "images", "bzImage") rootfs = os.path.join(self.builddir, "images", "rootfs.ext2") self.emulator.boot(arch="x86_64", @@ -70,3 +70,17 @@ class TestDockerCompose(infra.basetest.BRTest): self.docker_test() self.docker_compose_test() self.python_docker_test() + + +class TestDockerComposeRunc(BaseTestDockerCompose): + def test_run(self): + self.do_test() + + +class TestDockerComposeCrun(BaseTestDockerCompose): + config = BaseTestDockerCompose.config + """ + BR2_PACKAGE_CRUN=y + """ + + def test_run(self): + self.do_test()