mirror of
https://github.com/openRuyi-Project/openRuyi-zero.git
synced 2026-04-28 08:23:08 +00:00
smoke-test.tcl: Add smoke test
Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn>
This commit is contained in:
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -19,6 +19,8 @@ jobs:
|
||||
run: docker build -t buildenv .
|
||||
- name: Build
|
||||
run: docker run --rm -v "$(pwd):$(pwd)" -w "$(pwd)" buildenv ./build.sh
|
||||
- name: Smoke test
|
||||
run: docker run --rm -v "$(pwd):$(pwd)" -w "$(pwd)" buildenv ./smoke-test.tcl
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
FROM fedora
|
||||
RUN dnf install -y cpio dnf5 kmod
|
||||
RUN dnf install -y cpio dnf5 kmod expect qemu-system-riscv
|
||||
|
||||
63
smoke-test.tcl
Executable file
63
smoke-test.tcl
Executable file
@@ -0,0 +1,63 @@
|
||||
#!/usr/bin/env expect
|
||||
exec sh -c "exec cat out/openruyi-base.* out/openruyi-linux-modules-* > initramfs.img"
|
||||
|
||||
proc abort {} {
|
||||
send_error "Timeout!"
|
||||
exit 1
|
||||
}
|
||||
|
||||
set timeout 30
|
||||
|
||||
spawn sh -c {
|
||||
exec qemu-system-riscv64 \
|
||||
-nographic \
|
||||
-M virt -m 4G -cpu rva23s64 \
|
||||
-device virtio-gpu-pci \
|
||||
-kernel out/openruyi-linux-core-* \
|
||||
-initrd initramfs.img
|
||||
}
|
||||
|
||||
expect {
|
||||
timeout abort
|
||||
"Run /init as init process"
|
||||
}
|
||||
|
||||
expect {
|
||||
timeout abort
|
||||
"Welcome to openRuyi"
|
||||
}
|
||||
|
||||
expect {
|
||||
timeout abort
|
||||
"virtio-gpu-pci" {
|
||||
sleep 1
|
||||
send "\n"
|
||||
}
|
||||
}
|
||||
|
||||
expect {
|
||||
timeout abort
|
||||
"# " { send "\n" }
|
||||
}
|
||||
|
||||
expect {
|
||||
timeout abort
|
||||
"# " { send "lsmod\n" }
|
||||
}
|
||||
|
||||
expect {
|
||||
timeout abort
|
||||
"virtio_gpu"
|
||||
}
|
||||
|
||||
expect {
|
||||
timeout abort
|
||||
"# " { send "poweroff\n" }
|
||||
}
|
||||
|
||||
expect {
|
||||
timeout abort
|
||||
"Power down"
|
||||
}
|
||||
|
||||
interact
|
||||
Reference in New Issue
Block a user