diff options
author | Florian Klink <flokli@flokli.de> | 2020-03-11 00:24:50 +0100 |
---|---|---|
committer | Florian Klink <flokli@flokli.de> | 2020-03-11 10:21:37 +0100 |
commit | 36ef112a477034fc6d1d9170bf1bcda0140a8d1d (patch) | |
tree | 878196d56a94c5fcb7edb72f4e5a0f1a274f0070 /nixos/tests/networking.nix | |
parent | 1115959a8d4d73ad73341563dc8bbf52230a281e (diff) |
nixos/networkd: respect systemd.network.links also with disabled systemd-networkd
This mirrors the behaviour of systemd - It's udev that parses `.link` files, not `systemd-networkd`.
Diffstat (limited to 'nixos/tests/networking.nix')
-rw-r--r-- | nixos/tests/networking.nix | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/nixos/tests/networking.nix b/nixos/tests/networking.nix index 9e07db18a7bff..a519ca065943a 100644 --- a/nixos/tests/networking.nix +++ b/nixos/tests/networking.nix @@ -654,6 +654,31 @@ let ), "The IPv6 routing table has not been properly cleaned:\n{}".format(ipv6Residue) ''; }; + # even with disabled networkd, systemd.network.links should work + # (as it's handled by udev, not networkd) + link = { + name = "Link"; + nodes.client = { pkgs, ... }: { + virtualisation.vlans = [ 1 ]; + networking = { + useNetworkd = networkd; + useDHCP = false; + }; + systemd.network.links."50-foo" = { + matchConfig = { + Name = "foo"; + Driver = "dummy"; + }; + linkConfig.MTUBytes = "1442"; + }; + }; + testScript = '' + print(client.succeed("ip l add name foo type dummy")) + print(client.succeed("stat /etc/systemd/network/50-foo.link")) + client.succeed("udevadm settle") + assert "mtu 1442" in client.succeed("ip l show dummy0") + ''; + }; }; in pkgs.lib.mapAttrs (pkgs.lib.const (attrs: makeTest (attrs // { |