diff options
author | Florian Klink <flokli@flokli.de> | 2019-11-22 20:56:43 +0100 |
---|---|---|
committer | Florian Klink <flokli@flokli.de> | 2019-11-22 20:56:43 +0100 |
commit | 86a947297a9538c38233ff9412a6964359f19b63 (patch) | |
tree | 355960c8726a228052f57e607a2791518f8590e9 /nixos | |
parent | c81e4f10c2fb8d63a0694a5c5661ed9ade050990 (diff) | |
download | nixlib-86a947297a9538c38233ff9412a6964359f19b63.tar nixlib-86a947297a9538c38233ff9412a6964359f19b63.tar.gz nixlib-86a947297a9538c38233ff9412a6964359f19b63.tar.bz2 nixlib-86a947297a9538c38233ff9412a6964359f19b63.tar.lz nixlib-86a947297a9538c38233ff9412a6964359f19b63.tar.xz nixlib-86a947297a9538c38233ff9412a6964359f19b63.tar.zst nixlib-86a947297a9538c38233ff9412a6964359f19b63.zip |
nixosTests.mongodb: port to python
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/tests/mongodb.nix | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/nixos/tests/mongodb.nix b/nixos/tests/mongodb.nix index 0ccbeb062f92..9ebf84eed232 100644 --- a/nixos/tests/mongodb.nix +++ b/nixos/tests/mongodb.nix @@ -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" + ) ''; }) |