about summary refs log tree commit diff
path: root/pkgs/build-support/vm/test.nix
blob: 50dbfeb750be55df5efb2ae5feb1a9df9887518a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
let
  pkgs = import ../../.. { };

  inherit (pkgs)
    hello
    patchelf
    pcmanfm
    stdenv
    ;

  inherit (pkgs.vmTools)
    buildRPM
    diskImages
    makeImageTestScript
    runInLinuxImage
    runInLinuxVM
    ;
in

{


  # Run the PatchELF derivation in a VM.
  buildPatchelfInVM = runInLinuxVM patchelf;

  buildHelloInVM = runInLinuxVM hello;

  buildPcmanrmInVM = runInLinuxVM (pcmanfm.overrideAttrs (old: {
    # goes out-of-memory with many cores
    enableParallelBuilding = false;
  }));

  testRPMImage = makeImageTestScript diskImages.fedora27x86_64;


  buildPatchelfRPM = buildRPM {
    name = "patchelf-rpm";
    src = patchelf.src;
    diskImage = diskImages.fedora27x86_64;
    diskImageFormat = "qcow2";
  };


  testUbuntuImage = makeImageTestScript diskImages.ubuntu1804i386;


  buildInDebian = runInLinuxImage (stdenv.mkDerivation {
    name = "deb-compile";
    src = patchelf.src;
    diskImage = diskImages.ubuntu1804i386;
    diskImageFormat = "qcow2";
    memSize = 512;
    postHook = ''
      dpkg-query --list
    '';
  });

}