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
This commit is contained in:
parent
3205a38ac9
commit
94e51db649
4 changed files with 5 additions and 10 deletions
|
@ -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
|
||||
'';
|
||||
|
|
|
@ -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
|
||||
''
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
''
|
||||
|
|
Loading…
Reference in a new issue