nixos/test/networking: test unusual interface names

This commit is contained in:
rnhmjoj 2023-05-27 19:10:44 +02:00
parent 6732106210
commit ea0b4a694a
No known key found for this signature in database
GPG key ID: BFBAF4C975F76450

View file

@ -998,6 +998,31 @@ let
machine.fail("ip address show wlan0 | grep -q ${testMac}")
'';
};
naughtyInterfaceNames = let
ifnames = [
# flags of ip-address
"home" "temporary" "optimistic"
"bridge_slave" "flush"
# flags of ip-route
"up" "type" "nomaster" "address"
# other
"very_loong_name" "lowerUpper" "-"
];
in {
name = "naughtyInterfaceNames";
nodes.machine = { pkgs, ... }: {
networking.useNetworkd = networkd;
networking.bridges = listToAttrs
(flip map ifnames
(name: { inherit name; value.interfaces = []; }));
};
testScript = ''
machine.start()
machine.wait_for_unit("network.target")
for ifname in ${builtins.toJSON ifnames}:
machine.wait_until_succeeds(f"ip link show dev '{ifname}' | grep -q '{ifname}'")
'';
};
caseSensitiveRenaming = {
name = "CaseSensitiveRenaming";
nodes.machine = { pkgs, ... }: {