summary refs log tree commit diff
path: root/nixos/tests/initrd-network.nix
blob: ed9b82e2da773df8e53a3939a72aff6bf091063c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import ./make-test.nix ({ pkgs, ...} : {
  name = "initrd-network";

  meta.maintainers = [ pkgs.stdenv.lib.maintainers.eelco ];

  machine = { ... }: {
    imports = [ ../modules/profiles/minimal.nix ];
    boot.initrd.network.enable = true;
    boot.initrd.network.postCommands =
      ''
        ip addr | grep 10.0.2.15 || exit 1
        ping -c1 10.0.2.2 || exit 1
      '';
  };

  testScript =
    ''
      startAll;
      $machine->waitForUnit("multi-user.target");
      $machine->succeed("ip link >&2");
    '';
})