From 84dad2bcaaad52ab89372201039c22ce2685696a Mon Sep 17 00:00:00 2001 From: JMARyA Date: Tue, 15 Apr 2025 00:16:46 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9A=97=EF=B8=8F=20automated=20testing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/min.toml | 15 +++++++++++++++ test/test.sh | 22 ++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 test/min.toml create mode 100644 test/test.sh diff --git a/test/min.toml b/test/min.toml new file mode 100644 index 0000000..d1eddbd --- /dev/null +++ b/test/min.toml @@ -0,0 +1,15 @@ +[drive] +disk = "/dev/vda" + +[general] +mode = "Base" +locale = "de_DE.UTF-8" +keyboard_layout = "de" +keyboard_variant = "mac" +timezone = "Europe/Berlin" +hostname = "navos_min" +root_password = "root" +firewall = false + +[pkg] +pkg = [] \ No newline at end of file diff --git a/test/test.sh b/test/test.sh new file mode 100644 index 0000000..e979cb6 --- /dev/null +++ b/test/test.sh @@ -0,0 +1,22 @@ +function test_config() { + echo "Testing $1" + + mkdir "${1%.*}" + cd "${1%.*}" + + echo "Creating ISO" + doas navinstall create-iso --install "../$1" + mv -v *.iso nav.iso + + echo "Starting QEMU" + qemu-img create -f qcow2 disk.qcow2 16G + qemu-system-x86_64 -m 4G \ + -drive file=$(pwd)/disk.qcow2,if=virtio,format=qcow2 \ + -drive file=$(pwd)/nav.iso,media=cdrom,if=virtio,id=raw \ + -boot d -cpu host -enable-kvm -smp 4 -display sdl \ + -bios /usr/share/ovmf/x64/OVMF.4m.fd -machine q35,accel=kvm + + cd .. + echo "Cleaning up test env" + doas rm -rv "${1%.*}" +}