Merge pull request #73699 from NinjaTrappeur/wg-test-python

tests/systemd-networkd-wireguard: migrate to python test runner
This commit is contained in:
Florian Klink 2019-11-22 20:25:25 +01:00 committed by GitHub
commit 0b0da4c944
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -45,7 +45,7 @@ let generateNodeConf = { lib, pkgs, config, privkpath, pubk, peerId, nodeId, ...
};
};
};
in import ./make-test.nix ({pkgs, ... }: {
in import ./make-test-python.nix ({pkgs, ... }: {
name = "networkd-wireguard";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ ninjatrappeur ];
@ -70,12 +70,12 @@ in import ./make-test.nix ({pkgs, ... }: {
in generateNodeConf (attrs // localConf);
};
testScript = ''
startAll;
$node1->waitForUnit('systemd-networkd-wait-online.service');
$node2->waitForUnit('systemd-networkd-wait-online.service');
$node1->succeed('ping -c 5 10.0.0.2');
$node2->succeed('ping -c 5 10.0.0.1');
start_all()
node1.wait_for_unit("systemd-networkd-wait-online.service")
node2.wait_for_unit("systemd-networkd-wait-online.service")
node1.succeed("ping -c 5 10.0.0.2")
node2.succeed("ping -c 5 10.0.0.1")
# Is the fwmark set?
$node2->succeed('wg | grep -q 42');
node2.succeed("wg | grep -q 42")
'';
})