1 { system ? builtins.currentSystem,
3 pkgs ? import ../.. { inherit system config; }
7 inherit (import ../lib/testing-python.nix { inherit system pkgs; }) makeTest;
8 testCombinations = pkgs.lib.cartesianProductOfSets {
9 predictable = [true false];
10 withNetworkd = [true false];
12 in pkgs.lib.listToAttrs (builtins.map ({ predictable, withNetworkd }: {
13 name = pkgs.lib.optionalString (!predictable) "un" + "predictable"
14 + pkgs.lib.optionalString withNetworkd "Networkd";
16 name = "${if predictable then "" else "un"}predictableInterfaceNames${if withNetworkd then "-with-networkd" else ""}";
19 nodes.machine = { lib, ... }: {
20 networking.usePredictableInterfaceNames = lib.mkForce predictable;
21 networking.useNetworkd = withNetworkd;
22 networking.dhcpcd.enable = !withNetworkd;
23 networking.useDHCP = !withNetworkd;
25 # Check if predictable interface names are working in stage-1
26 boot.initrd.postDeviceCommands = ''
28 ip link show eth0 ${if predictable then "&&" else "||"} exit 1
33 print(machine.succeed("ip link"))
34 machine.${if predictable then "fail" else "succeed"}("ip link show eth0")