diff --git a/.github/workflows/integration_test.yml b/.github/workflows/integration_test.yml new file mode 100644 index 00000000..f84ed914 --- /dev/null +++ b/.github/workflows/integration_test.yml @@ -0,0 +1,32 @@ +name: Integration test + +on: + pull_request: + push: + branches: + - main + - releases/* + +jobs: + test: + runs-on: ubuntu-latest + timeout-minutes: 15 + container: jinuxdev/jinux:0.2.1 + steps: + - run: echo "Running in jinuxdev/jinux:0.2.1" + + - uses: actions/checkout@v3 + + - name: Boot Test (Multiboot) + id: boot_test_mb + run: RUSTFLAGS="-C opt-level=1" make run AUTO_TEST=dummy ENABLE_KVM=0 BOOT_PROTOCOL=multiboot + + - name: Boot Test (Multiboot2) + id: boot_test_mb2 + run: RUSTFLAGS="-C opt-level=1" make run AUTO_TEST=dummy ENABLE_KVM=0 BOOT_PROTOCOL=multiboot2 + + - name: Syscall Test (Linux Boot Protocol) + id: syscall_test_linux + run: RUSTFLAGS="-C opt-level=1" make run AUTO_TEST=syscall ENABLE_KVM=0 BOOT_PROTOCOL=linux + + # TODO: include the integration tests for MicroVM, which is not ready yet. diff --git a/.github/workflows/syscall_test.yml b/.github/workflows/syscall_test.yml deleted file mode 100644 index 7cba7a5e..00000000 --- a/.github/workflows/syscall_test.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Syscall test - -on: - pull_request: - push: - branches: - - main - - releases/* - -jobs: - test: - runs-on: ubuntu-latest - timeout-minutes: 15 - container: jinuxdev/jinux:0.2.1 - steps: - - run: echo "Running in jinuxdev/jinux:0.2.1" - - - uses: actions/checkout@v3 - - - name: Syscall Test (Multiboot) - id: syscall_test_mb - run: RUSTFLAGS="-C opt-level=1" make run AUTO_SYSCALL_TEST=1 ENABLE_KVM=0 SKIP_GRUB_MENU=1 BOOT_METHOD=qemu-grub BOOT_PROTOCOL=multiboot - - - name: Syscall Test (Multiboot2) - id: syscall_test_mb2 - run: RUSTFLAGS="-C opt-level=1" make run AUTO_SYSCALL_TEST=1 ENABLE_KVM=0 SKIP_GRUB_MENU=1 BOOT_METHOD=qemu-grub BOOT_PROTOCOL=multiboot2 - - - name: Syscall Test (Linux Boot Protocol) - id: syscall_test_lbp - run: RUSTFLAGS="-C opt-level=1" make run AUTO_SYSCALL_TEST=1 ENABLE_KVM=0 SKIP_GRUB_MENU=1 BOOT_METHOD=qemu-grub BOOT_PROTOCOL=linux - - # TODO: include the integration tests for MicroVM, which is not ready yet. diff --git a/Makefile b/Makefile index 6a875624..e4a19983 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # Make arguments and their defaults -AUTO_SYSCALL_TEST ?= 0 +AUTO_TEST ?= 0 BOOT_METHOD ?= qemu-grub BOOT_PROTOCOL ?= multiboot2 BUILD_SYSCALL_TEST ?= 0 @@ -8,22 +8,22 @@ ENABLE_KVM ?= 1 GDB_CLIENT ?= 0 GDB_SERVER ?= 0 INTEL_TDX ?= 0 -SKIP_GRUB_MENU ?= 0 +SKIP_GRUB_MENU ?= 1 # End of Make arguments KERNEL_CMDLINE := SHELL="/bin/sh" LOGNAME="root" HOME="/" USER="root" PATH="/bin" init=/usr/bin/busybox -- sh -l -ifeq ($(AUTO_SYSCALL_TEST), 1) +ifeq ($(AUTO_TEST), syscall) +BUILD_SYSCALL_TEST := 1 KERNEL_CMDLINE += /opt/syscall_test/run_syscall_test.sh endif +ifeq ($(AUTO_TEST), dummy) +KERNEL_CMDLINE += -c exit 0 +endif CARGO_KBUILD_ARGS := CARGO_KRUN_ARGS := -- '$(KERNEL_CMDLINE)' -ifeq ($(AUTO_SYSCALL_TEST), 1) -BUILD_SYSCALL_TEST := 1 -endif - CARGO_KRUN_ARGS += --boot-method="$(BOOT_METHOD)" CARGO_KRUN_ARGS += --boot-protocol="$(BOOT_PROTOCOL)" diff --git a/README.md b/README.md index fb3cd3e1..c0466229 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ cargo component-check This command will build the syscall test binary and automatically run Jinux with the tests using QEMU. ```bash -make run AUTO_SYSCALL_TEST=1 +make run AUTO_TEST=syscall ``` Alternatively, if you wish to test it interactively inside a shell in Jinux.