liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 94e51db649493751446f089b67a5a3fda6afc7f9
parent 3205a38ac91b21f56aef869f79438b0daf7b0ca9
Author: Daniel Barlow <dan@telent.net>
Date:   Sun, 24 Sep 2023 00:24:48 +0100

tests: use run.sh instead of calling run-liminix-vm directly

this makes it easier to run tests on aarch64 where
qemu wants an Image file instead of a vmlinux

Diffstat:
Mmodules/outputs.nix | 2+-
Mtests/jffs2/test.nix | 4+---
Mtests/pppoe/test.nix | 3+--
Mtests/wlan/test.nix | 6++----
4 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/modules/outputs.nix b/modules/outputs.nix @@ -99,7 +99,7 @@ in echo ${cmdline} > commandline cat > run.sh << EOF #!${pkgs.runtimeShell} - CMDLINE=${cmdline} run-liminix-vm --arch ${arch} ${makeBootableImage} ${config.system.outputs.rootfs} + CMDLINE=${cmdline} ${pkgs.pkgsBuildBuild.run-liminix-vm}/bin/run-liminix-vm --arch ${arch} \$* ${makeBootableImage} ${config.system.outputs.rootfs} EOF chmod +x run.sh ''; diff --git a/tests/jffs2/test.nix b/tests/jffs2/test.nix @@ -7,15 +7,13 @@ let img = (import liminix { liminix-config = ./configuration.nix; }).outputs.vmroot; pkgs = import <nixpkgs> { overlays = [(import ../../overlay.nix)]; }; - inherit (pkgs.pkgsBuildBuild) routeros run-liminix-vm; in pkgs.runCommand "check" { nativeBuildInputs = with pkgs; [ - run-liminix-vm expect socat ] ; } '' mkdir vm -run-liminix-vm --background ./vm ${img}/vmlinux ${img}/rootfs +${img}/run.sh --background ./vm expect ${./script.expect} >$out '' diff --git a/tests/pppoe/test.nix b/tests/pppoe/test.nix @@ -15,7 +15,6 @@ in pkgs.runCommand "check" { jq socat routeros.routeros - run-liminix-vm ] ; } '' serverstatedir=$(mktemp -d -t routeros-XXXXXX) @@ -27,7 +26,7 @@ export MPLCONFIGDIR=$(mktemp -d -t routeros-XXXXXX) routeros $serverstatedir mkdir vm -run-liminix-vm --background ./vm ${img}/vmlinux ${img}/rootfs +${img}/run.sh --background ./vm expect ${./getaddress.expect} set -o pipefail diff --git a/tests/wlan/test.nix b/tests/wlan/test.nix @@ -10,14 +10,12 @@ let img = (import liminix { inherit (pkgs.pkgsBuildBuild) run-liminix-vm; in pkgs.runCommand "check" { nativeBuildInputs = with pkgs; [ - expect - run-liminix-vm - socat + expect socat ] ; } '' . ${../test-helpers.sh} mkdir vm -run-liminix-vm --background ./vm ${img}/vmlinux ${img}/rootfs +${img}/run.sh --background ./vm expect ${./wait-for-wlan.expect} |tee output && mv output $out ''