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
hark-how-all-the-belkin-rings
Daniel Barlow 2023-09-24 00:24:48 +01:00
parent 3205a38ac9
commit 94e51db649
4 changed files with 5 additions and 10 deletions

View File

@ -99,7 +99,7 @@ in
echo ${cmdline} > commandline echo ${cmdline} > commandline
cat > run.sh << EOF cat > run.sh << EOF
#!${pkgs.runtimeShell} #!${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 EOF
chmod +x run.sh chmod +x run.sh
''; '';

View File

@ -7,15 +7,13 @@ let img = (import liminix {
liminix-config = ./configuration.nix; liminix-config = ./configuration.nix;
}).outputs.vmroot; }).outputs.vmroot;
pkgs = import <nixpkgs> { overlays = [(import ../../overlay.nix)]; }; pkgs = import <nixpkgs> { overlays = [(import ../../overlay.nix)]; };
inherit (pkgs.pkgsBuildBuild) routeros run-liminix-vm;
in pkgs.runCommand "check" { in pkgs.runCommand "check" {
nativeBuildInputs = with pkgs; [ nativeBuildInputs = with pkgs; [
run-liminix-vm
expect expect
socat socat
] ; ] ;
} '' } ''
mkdir vm mkdir vm
run-liminix-vm --background ./vm ${img}/vmlinux ${img}/rootfs ${img}/run.sh --background ./vm
expect ${./script.expect} >$out expect ${./script.expect} >$out
'' ''

View File

@ -15,7 +15,6 @@ in pkgs.runCommand "check" {
jq jq
socat socat
routeros.routeros routeros.routeros
run-liminix-vm
] ; ] ;
} '' } ''
serverstatedir=$(mktemp -d -t routeros-XXXXXX) serverstatedir=$(mktemp -d -t routeros-XXXXXX)
@ -27,7 +26,7 @@ export MPLCONFIGDIR=$(mktemp -d -t routeros-XXXXXX)
routeros $serverstatedir routeros $serverstatedir
mkdir vm mkdir vm
run-liminix-vm --background ./vm ${img}/vmlinux ${img}/rootfs ${img}/run.sh --background ./vm
expect ${./getaddress.expect} expect ${./getaddress.expect}
set -o pipefail set -o pipefail

View File

@ -10,14 +10,12 @@ let img = (import liminix {
inherit (pkgs.pkgsBuildBuild) run-liminix-vm; inherit (pkgs.pkgsBuildBuild) run-liminix-vm;
in pkgs.runCommand "check" { in pkgs.runCommand "check" {
nativeBuildInputs = with pkgs; [ nativeBuildInputs = with pkgs; [
expect expect socat
run-liminix-vm
socat
] ; ] ;
} '' } ''
. ${../test-helpers.sh} . ${../test-helpers.sh}
mkdir vm 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 expect ${./wait-for-wlan.expect} |tee output && mv output $out
'' ''