Skip to content

Commit

Permalink
add docker-in-docker e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
jprendes committed Jan 19, 2024
1 parent fb8f5f7 commit 032db70
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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


3 changes: 3 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions tests/dind/daemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"runtimes": {
"youki": {
"path": "/usr/bin/youki"
}
}
}
19 changes: 19 additions & 0 deletions tests/dind/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh

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

# give dockerd time to start
sleep 2

docker exec -i youki-test-dind \
docker run -q --runtime=youki hello-world

0 comments on commit 032db70

Please # to comment.