nixos/ejabberd: Port test to python
This commit is contained in:
parent
ba85932bae
commit
76605b2127
|
@ -1,4 +1,4 @@
|
||||||
import ../make-test.nix ({ pkgs, ... }: {
|
import ../make-test-python.nix ({ pkgs, ... }: {
|
||||||
name = "ejabberd";
|
name = "ejabberd";
|
||||||
meta = with pkgs.stdenv.lib.maintainers; {
|
meta = with pkgs.stdenv.lib.maintainers; {
|
||||||
maintainers = [ ajs124 ];
|
maintainers = [ ajs124 ];
|
||||||
|
@ -248,13 +248,21 @@ import ../make-test.nix ({ pkgs, ... }: {
|
||||||
};
|
};
|
||||||
|
|
||||||
testScript = { nodes, ... }: ''
|
testScript = { nodes, ... }: ''
|
||||||
$server->waitForUnit('ejabberd.service');
|
ejabberd_prefix = "su ejabberd -s $(which ejabberdctl) "
|
||||||
$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.wait_for_unit("ejabberd.service")
|
||||||
$server->succeed('su ejabberd -s $(which ejabberdctl) register cthon98 example.com nothunter2');
|
|
||||||
$server->fail('su ejabberd -s $(which ejabberdctl) register asdf wrong.domain');
|
assert "status: started" in server.succeed(ejabberd_prefix + "status")
|
||||||
$client->succeed('send-message');
|
|
||||||
$server->succeed('su ejabberd -s $(which ejabberdctl) unregister cthon98 example.com');
|
server.succeed(
|
||||||
$server->succeed('su ejabberd -s $(which ejabberdctl) unregister azurediamond example.com');
|
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",
|
||||||
|
)
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue