nixosTests.cockroachdb: port to python

This commit is contained in:
Florian Klink 2019-11-22 21:01:22 +01:00
parent 8e9e77ee7d
commit e7e05ad957

@ -95,7 +95,7 @@ let
''; '';
}; };
in import ./make-test.nix ({ pkgs, ...} : { in import ./make-test-python.nix ({ pkgs, ...} : {
name = "cockroachdb"; name = "cockroachdb";
meta.maintainers = with pkgs.stdenv.lib.maintainers; meta.maintainers = with pkgs.stdenv.lib.maintainers;
[ thoughtpolice ]; [ thoughtpolice ];
@ -110,17 +110,13 @@ in import ./make-test.nix ({ pkgs, ...} : {
# there's otherwise no way to guarantee that node1 will start before the others try # there's otherwise no way to guarantee that node1 will start before the others try
# to join it. # to join it.
testScript = '' testScript = ''
$node1->start; for node in node1, node2, node3:
$node1->waitForUnit("cockroachdb"); node.start()
node.wait_for_unit("cockroachdb")
$node2->start; node1.succeed(
$node2->waitForUnit("cockroachdb"); "cockroach sql --host=192.168.1.1 --insecure -e 'SHOW ALL CLUSTER SETTINGS' 2>&1",
"cockroach workload init bank 'postgresql://root@192.168.1.1:26257?sslmode=disable'",
$node3->start; "cockroach workload run bank --duration=1m 'postgresql://root@192.168.1.1:26257?sslmode=disable'",
$node3->waitForUnit("cockroachdb"); )
$node1->mustSucceed("cockroach sql --host=192.168.1.1 --insecure -e 'SHOW ALL CLUSTER SETTINGS' 2>&1");
$node1->mustSucceed("cockroach workload init bank 'postgresql://root\@192.168.1.1:26257?sslmode=disable'");
$node1->mustSucceed("cockroach workload run bank --duration=1m 'postgresql://root\@192.168.1.1:26257?sslmode=disable'");
''; '';
}) })