nixosTests.mongodb: port to python
This commit is contained in:
parent
c81e4f10c2
commit
86a947297a
@ -1,6 +1,6 @@
|
|||||||
# This test start mongodb, runs a query using mongo shell
|
# 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" ''
|
testQuery = pkgs.writeScript "nixtest.js" ''
|
||||||
db.greetings.insert({ "greeting": "hello" });
|
db.greetings.insert({ "greeting": "hello" });
|
||||||
print(db.greetings.findOne().greeting);
|
print(db.greetings.findOne().greeting);
|
||||||
@ -33,8 +33,10 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
testScript = ''
|
testScript = ''
|
||||||
startAll;
|
start_all()
|
||||||
$one->waitForUnit("mongodb.service");
|
one.wait_for_unit("mongodb.service")
|
||||||
$one->succeed("mongo -u nixtest -p nixtest nixtest ${testQuery}") =~ /hello/ or die;
|
one.succeed(
|
||||||
|
"mongo -u nixtest -p nixtest nixtest ${testQuery} | grep -q hello"
|
||||||
|
)
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user