aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/rosa/package/hakurei.az
diff options
context:
space:
mode:
Diffstat (limited to 'internal/rosa/package/hakurei.az')
-rw-r--r--internal/rosa/package/hakurei.az118
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,
+ ];
+}