nixos/couchdb: port test to python

This commit is contained in:
Marijan 2019-11-06 20:53:18 +01:00 committed by Marijan Petricevic
parent bf816e44c4
commit dd188ae2dc

View File

@ -1,4 +1,4 @@
import ./make-test.nix ({ pkgs, lib, ...}:
import ./make-test-python.nix ({ pkgs, lib, ...}:
with lib;
@ -35,22 +35,42 @@ with lib;
fi
'';
in ''
startAll;
start_all()
$couchdb1->waitForUnit("couchdb.service");
$couchdb1->waitUntilSucceeds("${curlJqCheck "GET" "" ".couchdb" "Welcome"}");
$couchdb1->waitUntilSucceeds("${curlJqCheck "GET" "_all_dbs" ". | length" "2"}");
$couchdb1->succeed("${curlJqCheck "PUT" "foo" ".ok" "true"}");
$couchdb1->succeed("${curlJqCheck "GET" "_all_dbs" ". | length" "3"}");
$couchdb1->succeed("${curlJqCheck "DELETE" "foo" ".ok" "true"}");
$couchdb1->succeed("${curlJqCheck "GET" "_all_dbs" ". | length" "2"}");
couchdb1.wait_for_unit("couchdb.service")
couchdb1.wait_until_succeeds(
"${curlJqCheck "GET" "" ".couchdb" "Welcome"}"
)
couchdb1.wait_until_succeeds(
"${curlJqCheck "GET" "_all_dbs" ". | length" "2"}"
)
couchdb1.succeed("${curlJqCheck "PUT" "foo" ".ok" "true"}")
couchdb1.succeed(
"${curlJqCheck "GET" "_all_dbs" ". | length" "3"}"
)
couchdb1.succeed(
"${curlJqCheck "DELETE" "foo" ".ok" "true"}"
)
couchdb1.succeed(
"${curlJqCheck "GET" "_all_dbs" ". | length" "2"}"
)
$couchdb2->waitForUnit("couchdb.service");
$couchdb2->waitUntilSucceeds("${curlJqCheck "GET" "" ".couchdb" "Welcome"}");
$couchdb2->waitUntilSucceeds("${curlJqCheck "GET" "_all_dbs" ". | length" "0"}");
$couchdb2->succeed("${curlJqCheck "PUT" "foo" ".ok" "true"}");
$couchdb2->succeed("${curlJqCheck "GET" "_all_dbs" ". | length" "1"}");
$couchdb2->succeed("${curlJqCheck "DELETE" "foo" ".ok" "true"}");
$couchdb2->succeed("${curlJqCheck "GET" "_all_dbs" ". | length" "0"}");
couchdb2.wait_for_unit("couchdb.service")
couchdb2.wait_until_succeeds(
"${curlJqCheck "GET" "" ".couchdb" "Welcome"}"
)
couchdb2.wait_until_succeeds(
"${curlJqCheck "GET" "_all_dbs" ". | length" "0"}"
)
couchdb2.succeed("${curlJqCheck "PUT" "foo" ".ok" "true"}")
couchdb2.succeed(
"${curlJqCheck "GET" "_all_dbs" ". | length" "1"}"
)
couchdb2.succeed(
"${curlJqCheck "DELETE" "foo" ".ok" "true"}"
)
couchdb2.succeed(
"${curlJqCheck "GET" "_all_dbs" ". | length" "0"}"
)
'';
})