diff --git a/nixos/tests/xmpp/prosody.nix b/nixos/tests/xmpp/prosody.nix index 9d947c52e5da..08c49637918c 100644 --- a/nixos/tests/xmpp/prosody.nix +++ b/nixos/tests/xmpp/prosody.nix @@ -7,33 +7,26 @@ let mkdir -p $out cp key.pem cert.pem $out ''; + + # Creates and set password for the 2 xmpp test users. + # + # Doing that in a bash script instead of doing that in the test + # script allow us to easily provision the users when running that + # test interactively. createUsers = pkgs: pkgs.writeScriptBin "create-prosody-users" '' #!${pkgs.bash}/bin/bash set -e - - # Creates and set password for the 2 xmpp test users. - # - # Doing that in a bash script instead of doing that in the test - # script allow us to easily provision the users when running that - # test interactively. - prosodyctl register cthon98 example.com nothunter2 prosodyctl register azurediamond example.com hunter2 ''; + # Deletes the test users. delUsers = pkgs: pkgs.writeScriptBin "delete-prosody-users" '' #!${pkgs.bash}/bin/bash set -e - - # Deletes the test users. - # - # Doing that in a bash script instead of doing that in the test - # script allow us to easily provision the users when running that - # test interactively. - prosodyctl deluser cthon98@example.com prosodyctl deluser azurediamond@example.com ''; @@ -45,7 +38,6 @@ import ../make-test-python.nix { { nodes, pkgs, - config, ... }: { @@ -60,6 +52,7 @@ import ../make-test-python.nix { (pkgs.callPackage ./xmpp-sendmessage.nix { connectTo = "example.com"; }) ]; }; + server = { config, pkgs, ... }: { @@ -97,16 +90,14 @@ import ../make-test-python.nix { }; }; - testScript = - { nodes, ... }: - '' - # Check with sqlite storage - start_all() - server.wait_for_unit("prosody.service") - server.succeed('prosodyctl status | grep "Prosody is running"') + testScript = _: '' + # Check with sqlite storage + start_all() + server.wait_for_unit("prosody.service") + server.succeed('prosodyctl status | grep "Prosody is running"') - server.succeed("create-prosody-users") - client.succeed("send-message") - server.succeed("delete-prosody-users") - ''; + server.succeed("create-prosody-users") + client.succeed("send-message") + server.succeed("delete-prosody-users") + ''; }