liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

test.nix (597B)


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