diff options
author | Michele Guerini Rocco <rnhmjoj@users.noreply.github.com> | 2021-02-20 20:49:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-20 20:49:19 +0100 |
commit | 19d715c5734ead0c605d0f6baabd46b4851e7f25 (patch) | |
tree | ada14262c96d83f33177e001f3716d20f7d53db1 /nixos/tests/networking.nix | |
parent | 008a2b294940b7c410b7b79b991d675923ceb0c4 (diff) | |
parent | d683d26d899c9c3011cf651d7e5ade072d4c800d (diff) |
Merge pull request #107382 from rnhmjoj/no-udev-settle
nixos/{networkd,dhcpcd}: remove udev-settle hack
Diffstat (limited to 'nixos/tests/networking.nix')
-rw-r--r-- | nixos/tests/networking.nix | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/nixos/tests/networking.nix b/nixos/tests/networking.nix index 58adab9d40a7b..1ea61f99a9513 100644 --- a/nixos/tests/networking.nix +++ b/nixos/tests/networking.nix @@ -672,6 +672,30 @@ let ), "The IPv6 routing table has not been properly cleaned:\n{}".format(ipv6Residue) ''; }; + rename = { + name = "RenameInterface"; + machine = { pkgs, ... }: { + virtualisation.vlans = [ 1 ]; + networking = { + useNetworkd = networkd; + useDHCP = false; + }; + } // + (if networkd + then { systemd.network.links."10-custom_name" = { + matchConfig.MACAddress = "52:54:00:12:01:01"; + linkConfig.Name = "custom_name"; + }; + } + else { services.udev.initrdRules = '' + SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="52:54:00:12:01:01", KERNEL=="eth*", NAME="custom_name" + ''; + }); + testScript = '' + machine.succeed("udevadm settle") + print(machine.succeed("ip link show dev custom_name")) + ''; + }; # even with disabled networkd, systemd.network.links should work # (as it's handled by udev, not networkd) link = { |