Skip to content

Commit c66a48d

Browse files
obbardcsjoerdsimons
authored andcommitted
Run recipe tests using UML on GitHub actions
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]>
1 parent ea8aca0 commit c66a48d

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

.github/workflows/build-test.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,8 @@ jobs:
2222
run: |
2323
docker-compose -f docker/recipes.test.yml \
2424
up --build --exit-code-from=sut
25+
26+
- name: Run test recipes using UML backend
27+
run: |
28+
docker-compose -f docker/recipes-test-uml.yml \
29+
up --build --exit-code-from=sut

docker/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,8 @@ Run test recipes on host:
3939
```
4040
docker-compose -f docker/recipes.test.yml up --build --exit-code-from=sut
4141
```
42+
43+
Run test recipes using UML backend:
44+
```
45+
docker-compose -f docker/recipes-test-uml.yml up --build --exit-code-from=sut
46+
```

docker/recipes-test-uml.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
version: '3.6'
2+
3+
services:
4+
sut:
5+
build:
6+
context: ..
7+
dockerfile: docker/Dockerfile
8+
target: runner
9+
volumes:
10+
- type: bind
11+
source: ../tests
12+
target: /recipes
13+
tmpfs:
14+
- /scratch:exec
15+
environment:
16+
- TMP=/scratch
17+
cap_add:
18+
- SYS_PTRACE
19+
security_opt:
20+
- label:disable
21+
working_dir: /recipes
22+
entrypoint: ./tests.sh
23+
command: --fakemachine-backend=uml

0 commit comments

Comments
 (0)