test.nix (609B)
1 let 2 overlay = import <liminix/overlay.nix>; 3 pkgs = import <nixpkgs> { overlays = [ overlay ]; }; 4 fixture = pkgs.callPackage ./fixture.nix { }; 5 in 6 pkgs.runCommand "check" 7 { 8 nativeBuildInputs = with pkgs; [ 9 squashfsTools 10 qprint 11 ]; 12 } 13 '' 14 set -e 15 diff ${fixture} ${./result.expected} 16 test -f /tmp/out.squashfs && rm /tmp/out.squashfs 17 mksquashfs - /tmp/out.squashfs -p '/ d 755 0 0' -pf ${fixture} -quiet -no-progress 18 foo="$(unsquashfs -cat /tmp/out.squashfs service/s6-linux-init-runleveld/run)" 19 test "$foo" = "$(printf "hello\nworld")" 20 date > $out 21 ''