Skip to content

Commit

Permalink
Run recipe tests using UML on GitHub actions
Browse files Browse the repository at this point in the history
Running the tests on the host is a good first step; to test Debos
properly we should run inside a Fakemachine. Since GitHub actions
do not support creating nested virtual machines, use the
user-mode-linux backend in Fakemachine to create a user process
to run the tests inside of.

Since Docker autobuild does not support UML the docker-compose
file purposely does not have a suffix of `.test.yml` so that the
test will not be picked up to run on Docker autobuild.

Signed-off-by: Christopher Obbard <[email protected]>
  • Loading branch information
obbardc authored and sjoerdsimons committed Jul 7, 2021
1 parent ea8aca0 commit c66a48d
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,8 @@ jobs:
run: |
docker-compose -f docker/recipes.test.yml \
up --build --exit-code-from=sut
- name: Run test recipes using UML backend
run: |
docker-compose -f docker/recipes-test-uml.yml \
up --build --exit-code-from=sut
5 changes: 5 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,8 @@ Run test recipes on host:
```
docker-compose -f docker/recipes.test.yml up --build --exit-code-from=sut
```

Run test recipes using UML backend:
```
docker-compose -f docker/recipes-test-uml.yml up --build --exit-code-from=sut
```
23 changes: 23 additions & 0 deletions docker/recipes-test-uml.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: '3.6'

services:
sut:
build:
context: ..
dockerfile: docker/Dockerfile
target: runner
volumes:
- type: bind
source: ../tests
target: /recipes
tmpfs:
- /scratch:exec
environment:
- TMP=/scratch
cap_add:
- SYS_PTRACE
security_opt:
- label:disable
working_dir: /recipes
entrypoint: ./tests.sh
command: --fakemachine-backend=uml

0 comments on commit c66a48d

Please sign in to comment.