about summary refs log tree commit diff
path: root/nixos/tests/multipass.nix
blob: 0980e9195f5aa13b683aa0a74e40f5fd09de9bee (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
import ./make-test-python.nix ({ pkgs, lib, ... }:

let
  multipass-image = import ../release.nix {
    configuration = {
      # Building documentation makes the test unnecessarily take a longer time:
      documentation.enable = lib.mkForce false;
    };
  };

in
{
  name = "multipass";

  meta.maintainers = [ lib.maintainers.jnsgruk ];

  nodes.machine = { lib, ... }: {
    virtualisation = {
      cores = 1;
      memorySize = 1024;
      diskSize = 4096;

      multipass.enable = true;
    };
  };

  testScript = ''
    machine.wait_for_unit("sockets.target")
    machine.wait_for_unit("multipass.service")
    machine.wait_for_file("/var/lib/multipass/data/multipassd/network/multipass_subnet")

    # Wait for Multipass to settle
    machine.sleep(1)

    machine.succeed("multipass list")
  '';
})