at 18.09-beta 951 B view raw
1{ system ? builtins.currentSystem }: 2 3let 4 inherit (import ../lib/testing.nix { inherit system; }) makeTest pkgs; 5in pkgs.lib.listToAttrs (pkgs.lib.crossLists (predictable: withNetworkd: { 6 name = pkgs.lib.optionalString (!predictable) "un" + "predictable" 7 + pkgs.lib.optionalString withNetworkd "Networkd"; 8 value = makeTest { 9 name = "${if predictable then "" else "un"}predictableInterfaceNames${if withNetworkd then "-with-networkd" else ""}"; 10 meta = {}; 11 12 machine = { lib, ... }: { 13 networking.usePredictableInterfaceNames = lib.mkForce predictable; 14 networking.useNetworkd = withNetworkd; 15 networking.dhcpcd.enable = !withNetworkd; 16 }; 17 18 testScript = '' 19 print $machine->succeed("ip link"); 20 $machine->succeed("ip link show ${if predictable then "ens3" else "eth0"}"); 21 $machine->fail("ip link show ${if predictable then "eth0" else "ens3"}"); 22 ''; 23 }; 24}) [[true false] [true false]])