3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #74254 from tfc/nixos-test-ejabberd

nixos/ejabberd: Port test to python
This commit is contained in:
Robin Gloster 2019-11-27 17:38:45 +01:00 committed by GitHub
commit bf12ddebe8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,4 @@
import ../make-test.nix ({ pkgs, ... }: {
import ../make-test-python.nix ({ pkgs, ... }: {
name = "ejabberd";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ ajs124 ];
@ -248,13 +248,21 @@ import ../make-test.nix ({ pkgs, ... }: {
};
testScript = { nodes, ... }: ''
$server->waitForUnit('ejabberd.service');
$server->succeed('su ejabberd -s $(which ejabberdctl) status|grep started') =~ /ejabberd is running/;
$server->succeed('su ejabberd -s $(which ejabberdctl) register azurediamond example.com hunter2');
$server->succeed('su ejabberd -s $(which ejabberdctl) register cthon98 example.com nothunter2');
$server->fail('su ejabberd -s $(which ejabberdctl) register asdf wrong.domain');
$client->succeed('send-message');
$server->succeed('su ejabberd -s $(which ejabberdctl) unregister cthon98 example.com');
$server->succeed('su ejabberd -s $(which ejabberdctl) unregister azurediamond example.com');
ejabberd_prefix = "su ejabberd -s $(which ejabberdctl) "
server.wait_for_unit("ejabberd.service")
assert "status: started" in server.succeed(ejabberd_prefix + "status")
server.succeed(
ejabberd_prefix + "register azurediamond example.com hunter2",
ejabberd_prefix + "register cthon98 example.com nothunter2",
)
server.fail(ejabberd_prefix + "register asdf wrong.domain")
client.succeed("send-message")
server.succeed(
ejabberd_prefix + "unregister cthon98 example.com",
ejabberd_prefix + "unregister azurediamond example.com",
)
'';
})