liminix/tests/pseudofiles/test.nix

16 lines
557 B
Nix
Raw Normal View History

2023-01-29 21:39:34 +00:00
let
overlay = import <liminix/overlay.nix>;
2024-10-06 15:39:24 +00:00
pkgs = import <nixpkgs> { overlays = [overlay]; };
fixture = pkgs.callPackage ./fixture.nix {};
in pkgs.runCommand "check" {
nativeBuildInputs = with pkgs; [ squashfsTools qprint ] ;
2023-01-29 21:39:34 +00:00
} ''
set -e
diff ${fixture} ${./result.expected}
test -f /tmp/out.squashfs && rm /tmp/out.squashfs
mksquashfs - /tmp/out.squashfs -p '/ d 755 0 0' -pf ${fixture} -quiet -no-progress
foo="$(unsquashfs -cat /tmp/out.squashfs service/s6-linux-init-runleveld/run)"
test "$foo" = "$(printf "hello\nworld")"
date > $out
2023-01-29 21:42:53 +00:00
''