nixosTest.gocd-agent: port to python

This commit is contained in:
Florian Klink 2019-11-24 22:48:59 +01:00
parent 0d534c0740
commit 46daafa269

View File

@ -9,14 +9,14 @@ let
header = "Accept: application/vnd.go.cd.v2+json";
in
import ./make-test.nix ({ pkgs, ...} : {
import ./make-test-python.nix ({ pkgs, ...} : {
name = "gocd-agent";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ grahamc swarren83 ];
};
nodes = {
gocd_agent =
agent =
{ ... }:
{
virtualisation.memorySize = 2046;
@ -30,11 +30,15 @@ import ./make-test.nix ({ pkgs, ...} : {
};
testScript = ''
startAll;
$gocd_agent->waitForUnit("gocd-server");
$gocd_agent->waitForOpenPort("8153");
$gocd_agent->waitForUnit("gocd-agent");
$gocd_agent->waitUntilSucceeds("curl ${serverUrl} -H '${header}' | ${pkgs.jq}/bin/jq -e ._embedded.agents[0].uuid");
$gocd_agent->succeed("curl ${serverUrl} -H '${header}' | ${pkgs.jq}/bin/jq -e ._embedded.agents[0].agent_state | grep -q Idle");
start_all()
agent.wait_for_unit("gocd-server")
agent.wait_for_open_port("8153")
agent.wait_for_unit("gocd-agent")
agent.wait_until_succeeds(
"curl ${serverUrl} -H '${header}' | ${pkgs.jq}/bin/jq -e ._embedded.agents[0].uuid"
)
agent.succeed(
"curl ${serverUrl} -H '${header}' | ${pkgs.jq}/bin/jq -e ._embedded.agents[0].agent_state | grep -q Idle"
)
'';
})