-
-
Notifications
You must be signed in to change notification settings - Fork 180
feat(test): 增加系统启动后执行syscall集成测试的make命令并将其加入流水线中 #1306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
09f82a3
666ca84
6c14368
35fbafc
8c1aca1
3485565
d88d0e9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| name: Test x86_64 | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| branches: ["master", "feat-*", "fix-*"] | ||
| pull_request: | ||
| branches: ["master", "feat-*", "fix-*"] | ||
|
|
||
| env: | ||
| ARCH: x86_64 | ||
| HOME: /root | ||
| RUSTUP_DIST_SERVER: "https://rsproxy.cn" | ||
| RUSTUP_UPDATE_ROOT: "https://rsproxy.cn/rustup" | ||
|
|
||
| jobs: | ||
| integration-test: | ||
| name: Integration Test | ||
| runs-on: ubuntu-latest | ||
| container: | ||
| image: dragonos/dragonos-dev:v1.14 | ||
| options: --privileged -v /dev:/dev | ||
| steps: | ||
| - name: Checkout DragonOS code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Run syscall test | ||
| shell: bash -ileo pipefail {0} | ||
| run: | | ||
| make test-syscall |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -153,6 +153,16 @@ run-docker: check_arch | |||||||||||||||||||||
| $(MAKE) write_diskimage || exit 1 | ||||||||||||||||||||||
| $(MAKE) qemu | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| test-syscall: check_arch | ||||||||||||||||||||||
| @echo "构建运行并执行syscall测试" | ||||||||||||||||||||||
| bash user/apps/tests/syscall/gvisor/enable_compile_gvisor.sh | ||||||||||||||||||||||
| $(MAKE) all -j $(NPROCS) | ||||||||||||||||||||||
| $(MAKE) write_diskimage || exit 1 | ||||||||||||||||||||||
| $(MAKE) qemu-nographic AUTO_TEST=syscall SYSCALL_TEST_DIR=/opt/tests/gvisor & | ||||||||||||||||||||||
| QEMU_PID=$$! | ||||||||||||||||||||||
| bash user/apps/tests/syscall/gvisor/monitor_test_results.sh || { bash user/apps/tests/syscall/gvisor/disable_compile_gvisor.sh; exit 1; } | ||||||||||||||||||||||
| bash user/apps/tests/syscall/gvisor/disable_compile_gvisor.sh | ||||||||||||||||||||||
|
Comment on lines
+161
to
+164
|
||||||||||||||||||||||
| $(MAKE) qemu-nographic AUTO_TEST=syscall SYSCALL_TEST_DIR=/opt/tests/gvisor & | |
| QEMU_PID=$$! | |
| bash user/apps/tests/syscall/gvisor/monitor_test_results.sh || { bash user/apps/tests/syscall/gvisor/disable_compile_gvisor.sh; exit 1; } | |
| bash user/apps/tests/syscall/gvisor/disable_compile_gvisor.sh | |
| { \ | |
| $(MAKE) qemu-nographic AUTO_TEST=syscall SYSCALL_TEST_DIR=/opt/tests/gvisor & \ | |
| QEMU_PID=$$!; \ | |
| bash user/apps/tests/syscall/gvisor/monitor_test_results.sh $$QEMU_PID || { bash user/apps/tests/syscall/gvisor/disable_compile_gvisor.sh; exit 1; }; \ | |
| bash user/apps/tests/syscall/gvisor/disable_compile_gvisor.sh; \ | |
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| ==================================== | ||
| Device | ||
| ==================================== | ||
|
|
||
| .. toctree:: | ||
| :maxdepth: 1 | ||
|
|
||
| tty |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| #!/bin/bash | ||
|
|
||
| CONFIG_FILE=config/app-blocklist.toml | ||
|
|
||
| sed -i \ | ||
| -e '/^\s*#\s*\[\[blocked_apps\]\]\s*$/ s/^\s*#\s*//' \ | ||
| -e '/^\s*#\s*name\s*=\s*"gvisor syscall tests"\s*$/ s/^\s*#\s*//' \ | ||
| -e '/^\s*#\s*reason\s*=\s*"由于文件较大,因此屏蔽。如果要允许系统调用测试,则把这几行取消注释即可"\s*$/ s/^\s*#\s*//' \ | ||
| $CONFIG_FILE |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| #!/bin/bash | ||
|
|
||
| CONFIG_FILE=config/app-blocklist.toml | ||
|
|
||
| sed -i -E \ | ||
| -e 's/^[[:space:]]*#*[[:space:]]*(\[\[blocked_apps\]\])[[:space:]]*$/# \1/' \ | ||
| -e 's/^[[:space:]]*#*[[:space:]]*(name[[:space:]]*=[[:space:]]*"gvisor syscall tests")[[:space:]]*$/# \1/' \ | ||
| -e 's/^[[:space:]]*#*[[:space:]]*(reason[[:space:]]*=[[:space:]]*"由于文件较大,因此屏蔽。如果要允许系统调用测试,则把这几行取消注释即可")[[:space:]]*$/# \1/' \ | ||
| $CONFIG_FILE |
fslongjin marked this conversation as resolved.
Show resolved
Hide resolved
|
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,34 @@ | ||||||
| #!/bin/busybox sh | ||||||
|
|
||||||
| # 串口文件路径 | ||||||
| SERIAL_FILE="serial_opt.txt" | ||||||
| # qemu进程PID | ||||||
| QEMU_PID=${QEMU_PID} | ||||||
|
||||||
| QEMU_PID=${QEMU_PID} | |
| QEMU_PID=$(pgrep -f qemu) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| #!/bin/busybox sh | ||
|
|
||
| cd $SYSCALL_TEST_DIR | ||
| ./gvisor-test-runner |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,8 @@ | ||
| #!/bin/sh | ||
| echo "[rcS] Running system init script..." | ||
| /bin/about.elf | ||
| /bin/about.elf | ||
|
|
||
| # 根据环境变量AUTO_TEST决定是否进行自动测试 | ||
| if [ "$AUTO_TEST" = "syscall" ]; then | ||
| /bin/busybox sh $SYSCALL_TEST_DIR/run_tests.sh | ||
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: QEMU PID Capture Fails in Test Script
The
test-syscalltarget incorrectly captures the QEMU process ID. TheQEMU_PID=$$!assignment on line 162 is on a separate line from the backgrounded QEMU command, causing$$!to expand to the current shell's PID instead of QEMU's. The PID is also not exported. This preventsmonitor_test_results.shfrom terminating QEMU.