liminix/tests/min-copy-closure/test.nix

32 lines
868 B
Nix
Raw Normal View History

2023-05-07 23:02:10 +02:00
{
liminix
, nixpkgs
}:
let lmx = (import liminix {
device = import "${liminix}/devices/qemu/";
liminix-config = ./configuration.nix;
});
rogue = lmx.pkgs.rogue;
img = lmx.outputs.vmroot;
pkgs = import <nixpkgs> { overlays = [(import ../../overlay.nix)]; };
2023-09-20 19:33:08 +02:00
inherit (pkgs.pkgsBuildBuild) run-liminix-vm;
2023-05-07 23:02:10 +02:00
in pkgs.runCommand "check" {
nativeBuildInputs = with pkgs; [
expect
2023-09-20 19:33:08 +02:00
run-liminix-vm
2023-05-07 23:02:10 +02:00
socat
min-copy-closure
rogue
] ;
} ''
2023-05-08 00:01:24 +02:00
. ${../test-helpers.sh}
2023-05-07 23:02:10 +02:00
mkdir vm
2023-09-20 19:33:08 +02:00
LAN=user,hostfwd=tcp::2022-:22 run-liminix-vm --background ./vm ${img}/vmlinux ${img}/rootfs
2023-05-07 23:02:10 +02:00
expect ${./wait-until-ready.expect}
export SSH_COMMAND="ssh -o StrictHostKeyChecking=no -p 2022 -i ${./id}"
$SSH_COMMAND root@localhost echo ready
IN_NIX_BUILD=true min-copy-closure root@localhost ${rogue}
$SSH_COMMAND root@localhost ls -l ${rogue} >$out
''