nixos/upnp: port test to python
This commit is contained in:
parent
13febec464
commit
38b2e18faa
|
@ -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/")
|
||||||
'';
|
'';
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue