nixosTests.predictable-interface-names: port to python (#74765)

nixosTests.predictable-interface-names: port to python
This commit is contained in:
Jörg Thalheim 2019-12-01 10:40:29 +00:00 committed by GitHub
commit 7e6718e425
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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]])