1
0
Fork 0
mirror of https://github.com/containers/youki synced 2024-05-03 22:26:32 +02:00

add docker-in-docker e2e test (#2645)

Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
This commit is contained in:
Jorge Prendes 2024-01-20 01:16:08 +00:00 committed by GitHub
parent fb8f5f7aaf
commit 3f08ae7167
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 54 additions and 0 deletions

View File

@ -182,3 +182,27 @@ jobs:
run: chmod +x ./youki
- name: Run tests
run: just test-rootless-podman
docker-in-docker:
runs-on: ${{ matrix.os }}
needs: [youki-build]
timeout-minutes: 5
strategy:
matrix:
# ubuntu 20.04 has cgroups-v1
# ubuntu 22.04 has cgroups-v2
os: [ "ubuntu-22.04", "ubuntu-20.04" ]
steps:
- uses: actions/checkout@v3
- name: Install just
uses: taiki-e/install-action@just
- name: Download youki binary
uses: actions/download-artifact@v3
with:
name: youki-x86_64-musl
- name: Add the permission to run
run: chmod +x ./youki
- name: Run tests
run: just test-dind

View File

@ -65,6 +65,9 @@ validate-contest-runc: contest
test-rootless-podman:
{{ cwd }}/tests/rootless-tests/run.sh {{ cwd }}/youki
# test docker-in-docker works with youki
test-dind:
{{ cwd }}/tests/dind/run.sh
# run containerd integration tests
containerd-test: youki-dev

7
tests/dind/daemon.json Normal file
View File

@ -0,0 +1,7 @@
{
"runtimes": {
"youki": {
"path": "/usr/bin/youki"
}
}
}

20
tests/dind/run.sh Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
set -e
ROOT=$(git rev-parse --show-toplevel)
docker run --privileged -dq \
--name youki-test-dind \
-v $ROOT/youki:/usr/bin/youki \
-v $ROOT/tests/dind/daemon.json:/etc/docker/daemon.json \
docker:dind > /dev/null
trap "docker rm -f youki-test-dind > /dev/null" EXIT
# wait for docker to start
timeout 30s \
grep -q -m1 "/var/run/docker.sock" \
<(docker logs -f youki-test-dind 2>&1)
docker exec -i youki-test-dind \
docker run -q --runtime=youki hello-world