nixos/miniflux: port test to python

This commit is contained in:
Jan Hrnko 2019-11-09 20:35:50 +01:00 committed by Florian Klink
parent 32ef9dbfea
commit bc1d542f09

View file

@ -1,4 +1,4 @@
import ./make-test.nix ({ pkgs, lib, ... }:
import ./make-test-python.nix ({ pkgs, lib, ... }:
let
port = 3142;
@ -37,16 +37,20 @@ with lib;
};
};
testScript = ''
startAll;
start_all()
$default->waitForUnit('miniflux.service');
$default->waitForOpenPort(${toString defaultPort});
$default->succeed("curl --fail 'http://localhost:${toString defaultPort}/healthcheck' | grep -q OK");
$default->succeed("curl 'http://localhost:${toString defaultPort}/v1/me' -u '${defaultUsername}:${defaultPassword}' -H Content-Type:application/json | grep -q '\"is_admin\":true'");
default.wait_for_unit("miniflux.service")
default.wait_for_open_port(${toString defaultPort})
default.succeed("curl --fail 'http://localhost:${toString defaultPort}/healthcheck' | grep -q OK")
default.succeed(
"curl 'http://localhost:${toString defaultPort}/v1/me' -u '${defaultUsername}:${defaultPassword}' -H Content-Type:application/json | grep -q '\"is_admin\":true'"
)
$customized->waitForUnit('miniflux.service');
$customized->waitForOpenPort(${toString port});
$customized->succeed("curl --fail 'http://localhost:${toString port}/healthcheck' | grep -q OK");
$customized->succeed("curl 'http://localhost:${toString port}/v1/me' -u '${username}:${password}' -H Content-Type:application/json | grep -q '\"is_admin\":true'");
customized.wait_for_unit("miniflux.service")
customized.wait_for_open_port(${toString port})
customized.succeed("curl --fail 'http://localhost:${toString port}/healthcheck' | grep -q OK")
customized.succeed(
"curl 'http://localhost:${toString port}/v1/me' -u '${username}:${password}' -H Content-Type:application/json | grep -q '\"is_admin\":true'"
)
'';
})