Use dummy tests for other boot protocols

This commit is contained in:
Zhang Junyang 2023-10-23 18:58:40 +08:00 committed by Tate, Hongliang Tian
parent a532340c65
commit 33ec7dec02
4 changed files with 40 additions and 40 deletions

32
.github/workflows/integration_test.yml vendored Normal file
View File

@ -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.

View File

@ -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.

View File

@ -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)"

View File

@ -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.