summaryrefslogtreecommitdiffstats
path: root/nixos/tests/cockroachdb.nix
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2019-11-22 21:01:22 +0100
committerFlorian Klink <flokli@flokli.de>2020-04-03 00:34:18 +0200
commite7e05ad9575156e87468dafaf0964253cc628ea2 (patch)
treeb047dd33dfec5e7ee0f93ec97cec120d6340315b /nixos/tests/cockroachdb.nix
parent8e9e77ee7dc0d612616ebe0f93d67be89b931131 (diff)
nixosTests.cockroachdb: port to python
Diffstat (limited to 'nixos/tests/cockroachdb.nix')
-rw-r--r--nixos/tests/cockroachdb.nix22
1 files changed, 9 insertions, 13 deletions
diff --git a/nixos/tests/cockroachdb.nix b/nixos/tests/cockroachdb.nix
index 496283fddc7b..33ff7c31b25f 100644
--- a/nixos/tests/cockroachdb.nix
+++ b/nixos/tests/cockroachdb.nix
@@ -95,7 +95,7 @@ let
'';
};
-in import ./make-test.nix ({ pkgs, ...} : {
+in import ./make-test-python.nix ({ pkgs, ...} : {
name = "cockroachdb";
meta.maintainers = with pkgs.stdenv.lib.maintainers;
[ 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
# to join it.
testScript = ''
- $node1->start;
- $node1->waitForUnit("cockroachdb");
-
- $node2->start;
- $node2->waitForUnit("cockroachdb");
-
- $node3->start;
- $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'");
+ for node in node1, node2, node3:
+ node.start()
+ node.wait_for_unit("cockroachdb")
+ node1.succeed(
+ "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'",
+ "cockroach workload run bank --duration=1m 'postgresql://root@192.168.1.1:26257?sslmode=disable'",
+ )
'';
})