diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-11-21 22:44:32 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-11-21 22:44:54 +0900 |
| commit | 8871bad4d46c73594ae9f3e8c4cc29bd0b87fbff (patch) | |
| tree | c97c787c636c0f729e1d4acee918240e13a886c6 /internal/rosa/package/hakurei.az | |
| parent | aa285d230942873674473944b6ebef321e853275 (diff) | |
internal/rosa: run cmd/hakurei/testsuite
This adds a specialised Rosa OS image and runs cmd/hakurei/testsuite
in a Rosa OS qemu guest. Emulation for riscv64 and ppc64le is currently
broken.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/rosa/package/hakurei.az')
| -rw-r--r-- | internal/rosa/package/hakurei.az | 118 |
1 files changed, 118 insertions, 0 deletions
diff --git a/internal/rosa/package/hakurei.az b/internal/rosa/package/hakurei.az index 7e71ae72..3ffef1c6 100644 --- a/internal/rosa/package/hakurei.az +++ b/internal/rosa/package/hakurei.az @@ -219,3 +219,121 @@ go build -trimpath -o /work/ -ldflags="-s -w tools = [ go ]; } + +package system-image-test { + description = "Rosa OS system image for hakurei-test"; + version = unversioned; + exclude = true; + + extra = [ + musl, + mksh, + toybox, + hakurei, + xdg-dbus-proxy, + + kmod, + kernel, + + acl, + util-linux, + noto, + sway, + mako, + libnotify, + wayland-utils, + pulseaudio-client, + xset, + foot, + dbus, + pipewire, + wireplumber, + ]; + overlay = "/mnt"; + + exec = generic { + cross = "\x00"; + build = ` +mksquashfs \ + /mnt`+prefix+` \ + /work/system.img \ + -all-root`; + }; + + tools = [ squashfs-tools ]; +} + +package hakurei-tests { + description = "hakurei integration test suite in a Rosa OS guest"; + exclude = true; + + source = hakurei-source; + enterSource = true; + + env = [ + "GOCACHE=/tmp/gocache", + "CC=clang -O3 -Werror", + ]; + + extra = [ + kernel, + kernel-source, + initramfs-image, + system-image-test, + ]; + exec = generic { + chdir = false; + cross = ` +export GOARCH=`+arch+` +`; + build = ` +go build \ + -trimpath \ + -o /work/ \ + -tags=testsuite,rosa \ + ./cmd/hakurei/testsuite +../extra/kernel-source/scripts/extract-vmlinux \ + ../extra/kernel/`+arch { + default = "vmlinuz.efi"; + amd64 = "bzImage"; + }+` > /tmp/kernel +`; + check = ` +qemu-system-`+linuxArch+` \ + `+arch { + default = "-enable-kvm"; + cross = ""; + }+` \ + -machine `+arch { + default = "virt"; + amd64 = "q35"; + }+` \ + -cpu `+arch { + default = "host"; + cross = "max"; + }+` \ + -serial stdio \ + -m 4G \ + -smp `+jobsE+` \ + -kernel /tmp/kernel \ + -initrd ../extra/initramfs-image/initramfs.zst \ + -drive file=../extra/system-image-test/system.img,readonly=on,format=raw,if=virtio \ + -virtfs local,path=/work,mount_tag=rosa,security_model=none,readonly=on \ + -append 'console=`+arch { + default = "ttyS0"; + arm64 = "ttyAMA0"; + }+`,115200n8 -- strict no_recover no_remount bindable_misc mount_tmp 9p early_hsurc system="`+arch { + default = "/devices/pci*/*/virtio*/block/*"; + arm64 = "/devices/platform/*.pcie/pci*/*/virtio*/block/*"; + }+`" initial="/host/testsuite"' | + stdbuf -o 0 tr -d '\r' | tee /dev/stderr | \ + (grep -q -m 1 'unable to continue, please reboot and resolve the problem manually' && kill -KILL "$$" || true) +`; + }; + + tools = [ + go, + qemu, + coreutils, + ]; +} |
