nixos/miniflux: port test to python
This commit is contained in:
parent
32ef9dbfea
commit
bc1d542f09
1 changed files with 14 additions and 10 deletions
|
@ -1,4 +1,4 @@
|
||||||
import ./make-test.nix ({ pkgs, lib, ... }:
|
import ./make-test-python.nix ({ pkgs, lib, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
port = 3142;
|
port = 3142;
|
||||||
|
@ -37,16 +37,20 @@ with lib;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
testScript = ''
|
testScript = ''
|
||||||
startAll;
|
start_all()
|
||||||
|
|
||||||
$default->waitForUnit('miniflux.service');
|
default.wait_for_unit("miniflux.service")
|
||||||
$default->waitForOpenPort(${toString defaultPort});
|
default.wait_for_open_port(${toString defaultPort})
|
||||||
$default->succeed("curl --fail 'http://localhost:${toString defaultPort}/healthcheck' | grep -q OK");
|
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.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.wait_for_unit("miniflux.service")
|
||||||
$customized->waitForOpenPort(${toString port});
|
customized.wait_for_open_port(${toString port})
|
||||||
$customized->succeed("curl --fail 'http://localhost:${toString port}/healthcheck' | grep -q OK");
|
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.succeed(
|
||||||
|
"curl 'http://localhost:${toString port}/v1/me' -u '${username}:${password}' -H Content-Type:application/json | grep -q '\"is_admin\":true'"
|
||||||
|
)
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue