mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-28 14:22:50 +03:00
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
|
||||
# mapping.
|
||||
|
||||
import ./make-test.nix ({ pkgs, ... }:
|
||||
import ./make-test-python.nix ({ pkgs, ... }:
|
||||
|
||||
let
|
||||
internalRouterAddress = "192.168.3.1";
|
||||
@ -75,20 +75,20 @@ in
|
||||
testScript =
|
||||
{ nodes, ... }:
|
||||
''
|
||||
startAll;
|
||||
start_all()
|
||||
|
||||
# Wait for network and miniupnpd.
|
||||
$router->waitForUnit("network-online.target");
|
||||
# $router->waitForUnit("nat");
|
||||
$router->waitForUnit("firewall.service");
|
||||
$router->waitForUnit("miniupnpd");
|
||||
router.wait_for_unit("network-online.target")
|
||||
# $router.wait_for_unit("nat")
|
||||
router.wait_for_unit("firewall.service")
|
||||
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");
|
||||
$client2->waitUntilSucceeds("curl http://${externalRouterAddress}:9000/");
|
||||
client1.wait_for_unit("httpd")
|
||||
client2.wait_until_succeeds("curl http://${externalRouterAddress}:9000/")
|
||||
'';
|
||||
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user