add CI job to test tftpboot

This commit is contained in:
Daniel Barlow
2023-12-18 22:42:29 +00:00
parent 9ca9723c9d
commit e5db2691e5
7 changed files with 123 additions and 3 deletions

31
tests/tftpboot/test.nix Normal file
View File

@@ -0,0 +1,31 @@
{
liminix
}:
let derivation = (import liminix {
device = import "${liminix}/devices/qemu-armv7l/";
liminix-config = ./configuration.nix;
});
img = derivation.outputs.tftpboot;
pkgs = derivation.pkgs;
pkgsBuild = pkgs.pkgsBuildBuild;
in pkgsBuild.runCommand "check" {
nativeBuildInputs = with pkgsBuild; [
expect
socat
run-liminix-vm
] ;
} ''
mkdir vm
ln -s ${img} result
run-liminix-vm \
--background ./vm \
--u-boot ${pkgs.ubootQemuArm}/u-boot.bin \
--arch arm \
--flag -S \
--phram-address 0x40200000 \
--lan "user,tftp=`pwd`" \
--disk-image result/rootfs \
result/uimage result/rootfs
expect ${./script.expect} 2>&1 |tee $out
''