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 <yann.morin.1998@free.fr>
Signed-off-by: Julien Olivain <ju.o@free.fr>
(cherry picked from commit 34e4480950)
Signed-off-by: Thomas Perale <thomas.perale@mind.be>
This commit is contained in:
Yann E. MORIN
2025-07-14 22:25:55 +02:00
committed by Arnout Vandecappelle
parent 321e6745b1
commit d5dd06fb07

View File

@@ -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()