about summary refs log tree commit diff
path: root/tests/labnet/heinrich.nix
blob: a7839c42942b2960dbfebf85c8562fe660de278e (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
{
  name = "heinrich";

  nodes = let
    common = { lib, ... }: {
      networking.useNetworkd = true;
      systemd.network.netdevs."40-eth0".netdevConfig = {
        Name = "eth0";
        Kind = "dummy";
      };
    };
  in {
    heinrich = {
      imports = [ common (import ../../machines {}).labnet.heinrich.config ];
      virtualisation.vlans = [ 1 8 14 ];
      vuizvui.machines.heinrich.internalInterface = "eth1";
      vuizvui.machines.heinrich.externalInterface = "eth2";
    };
    hotelturm = { lib, ... }: {
      imports = [ common ];
      virtualisation.vlans = [ 8 ];
      networking.useDHCP = false;
      networking.interfaces.eth1.ip4 = lib.singleton {
        address = "10.11.77.16";
        prefixLength = 24;
      };
    };
    moritz = { lib, ... }: {
      imports = [ common ];
      virtualisation.vlans = [ 14 ];
      networking.useDHCP = false;
      networking.interfaces.eth1.ip4 = lib.singleton {
        address = "192.168.0.1";
        prefixLength = 24;
      };
    };
    client = {
      imports = [ common ];
      virtualisation.vlans = [ 1 ];
    };
  };

  testScript = ''
    startAll;
    $heinrich->waitForUnit("dnsmasq.service");
    $client->waitForUnit("network-interfaces.target");
    $client->waitForUnit("network.target");

    $client->succeed("ip addr >&2");
  '';
}