From c66a48d699ea9de03d46d786f159d476b2ebfc06 Mon Sep 17 00:00:00 2001 From: Christopher Obbard Date: Wed, 7 Jul 2021 16:58:10 +0100 Subject: [PATCH] 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 --- .github/workflows/build-test.yaml | 5 +++++ docker/README.md | 5 +++++ docker/recipes-test-uml.yml | 23 +++++++++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 docker/recipes-test-uml.yml diff --git a/.github/workflows/build-test.yaml b/.github/workflows/build-test.yaml index 1463f481..9f6b2d6c 100644 --- a/.github/workflows/build-test.yaml +++ b/.github/workflows/build-test.yaml @@ -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 diff --git a/docker/README.md b/docker/README.md index 2dc76ddb..4edb6089 100644 --- a/docker/README.md +++ b/docker/README.md @@ -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 +``` diff --git a/docker/recipes-test-uml.yml b/docker/recipes-test-uml.yml new file mode 100644 index 00000000..ff28598f --- /dev/null +++ b/docker/recipes-test-uml.yml @@ -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