nixos/upnp: port test to python

This commit is contained in:
Jan Hrnko 2019-11-06 07:54:45 +01:00
parent 13febec464
commit 38b2e18faa
1 changed files with 10 additions and 10 deletions

View File

@ -5,7 +5,7 @@
# this succeeds an external client will try to connect to the port # this succeeds an external client will try to connect to the port
# mapping. # mapping.
import ./make-test.nix ({ pkgs, ... }: import ./make-test-python.nix ({ pkgs, ... }:
let let
internalRouterAddress = "192.168.3.1"; internalRouterAddress = "192.168.3.1";
@ -75,20 +75,20 @@ in
testScript = testScript =
{ nodes, ... }: { nodes, ... }:
'' ''
startAll; start_all()
# Wait for network and miniupnpd. # Wait for network and miniupnpd.
$router->waitForUnit("network-online.target"); router.wait_for_unit("network-online.target")
# $router->waitForUnit("nat"); # $router.wait_for_unit("nat")
$router->waitForUnit("firewall.service"); router.wait_for_unit("firewall.service")
$router->waitForUnit("miniupnpd"); router.wait_for_unit("miniupnpd")
$client1->waitForUnit("network-online.target"); client1.wait_for_unit("network-online.target")
$client1->succeed("upnpc -a ${internalClient1Address} 9000 9000 TCP"); client1.succeed("upnpc -a ${internalClient1Address} 9000 9000 TCP")
$client1->waitForUnit("httpd"); client1.wait_for_unit("httpd")
$client2->waitUntilSucceeds("curl http://${externalRouterAddress}:9000/"); client2.wait_until_succeeds("curl http://${externalRouterAddress}:9000/")
''; '';
}) })