1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-21 05:00:16 +00:00

Merge pull request #73933 from flokli/nixos-test-port-mongodb

nixosTests.mongodb: port to python
This commit is contained in:
WilliButz 2019-11-22 23:58:41 +01:00 committed by GitHub
commit be5dcb4606
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,6 @@
# This test start mongodb, runs a query using mongo shell
import ./make-test.nix ({ pkgs, ...} : let
import ./make-test-python.nix ({ pkgs, ...} : let
testQuery = pkgs.writeScript "nixtest.js" ''
db.greetings.insert({ "greeting": "hello" });
print(db.greetings.findOne().greeting);
@ -33,8 +33,10 @@ in {
};
testScript = ''
startAll;
$one->waitForUnit("mongodb.service");
$one->succeed("mongo -u nixtest -p nixtest nixtest ${testQuery}") =~ /hello/ or die;
start_all()
one.wait_for_unit("mongodb.service")
one.succeed(
"mongo -u nixtest -p nixtest nixtest ${testQuery} | grep -q hello"
)
'';
})