nixosTests.nzbget: Port tests to python

This commit is contained in:
Christian Kampka 2019-12-15 19:29:17 +01:00
parent 57e8bd9ebe
commit 065770607e
No known key found for this signature in database
GPG Key ID: B88E140DB4FE1AA5
1 changed files with 11 additions and 7 deletions

View File

@ -1,4 +1,4 @@
import ./make-test.nix ({ pkgs, ...} : { import ./make-test-python.nix ({ pkgs, ...} : {
name = "nzbget"; name = "nzbget";
meta = with pkgs.stdenv.lib.maintainers; { meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ aanderse flokli ]; maintainers = [ aanderse flokli ];
@ -15,12 +15,16 @@ import ./make-test.nix ({ pkgs, ...} : {
}; };
testScript = '' testScript = ''
startAll; start_all()
$server->waitForUnit("nzbget.service"); server.wait_for_unit("nzbget.service")
$server->waitForUnit("network.target"); server.wait_for_unit("network.target")
$server->waitForOpenPort(6789); server.wait_for_open_port(6789)
$server->succeed("curl -s -u nzbget:tegbzn6789 http://127.0.0.1:6789 | grep -q 'This file is part of nzbget'"); assert "This file is part of nzbget" in server.succeed(
$server->succeed("${pkgs.nzbget}/bin/nzbget -n -o ControlIP=127.0.0.1 -o ControlPort=6789 -o ControlPassword=tegbzn6789 -V"); "curl -s -u nzbget:tegbzn6789 http://127.0.0.1:6789"
)
server.succeed(
"${pkgs.nzbget}/bin/nzbget -n -o Control_iP=127.0.0.1 -o Control_port=6789 -o Control_password=tegbzn6789 -V"
)
''; '';
}) })