nixosTests.predictable-interface-names: python

This commit is contained in:
Martin Milata 2019-12-01 03:16:32 +01:00
parent e1456b291c
commit 8d6bcf80a2

View File

@ -4,7 +4,7 @@
}:
let
inherit (import ../lib/testing.nix { inherit system pkgs; }) makeTest;
inherit (import ../lib/testing-python.nix { inherit system pkgs; }) makeTest;
in pkgs.lib.listToAttrs (pkgs.lib.crossLists (predictable: withNetworkd: {
name = pkgs.lib.optionalString (!predictable) "un" + "predictable"
+ pkgs.lib.optionalString withNetworkd "Networkd";
@ -20,8 +20,8 @@ in pkgs.lib.listToAttrs (pkgs.lib.crossLists (predictable: withNetworkd: {
};
testScript = ''
print $machine->succeed("ip link");
$machine->${if predictable then "fail" else "succeed"}("ip link show eth0 ");
print(machine.succeed("ip link"))
machine.${if predictable then "fail" else "succeed"}("ip link show eth0")
'';
};
}) [[true false] [true false]])