2019-12-24 18:10:34 +03:00
|
|
|
import ./make-test-python.nix ({ pkgs, ...} :
|
2014-04-01 08:33:46 +04:00
|
|
|
|
|
|
|
let
|
2018-07-20 23:56:59 +03:00
|
|
|
client = { pkgs, ... }: {
|
2014-04-01 08:33:46 +04:00
|
|
|
imports = [ ./common/x11.nix ];
|
|
|
|
environment.systemPackages = [ pkgs.mumble ];
|
|
|
|
};
|
2020-10-07 12:27:05 +03:00
|
|
|
|
|
|
|
# outside of tests, this file should obviously not come from the nix store
|
|
|
|
envFile = pkgs.writeText "nixos-test-mumble-murmurd.env" ''
|
|
|
|
MURMURD_PASSWORD=testpassword
|
|
|
|
'';
|
|
|
|
|
2014-04-01 08:33:46 +04:00
|
|
|
in
|
|
|
|
{
|
2014-06-28 18:04:49 +04:00
|
|
|
name = "mumble";
|
2021-01-10 22:08:30 +03:00
|
|
|
meta = with pkgs.lib.maintainers; {
|
2019-02-22 18:14:13 +03:00
|
|
|
maintainers = [ thoughtpolice eelco ];
|
2015-07-12 13:09:40 +03:00
|
|
|
};
|
2014-06-28 18:04:49 +04:00
|
|
|
|
2014-04-01 08:33:46 +04:00
|
|
|
nodes = {
|
2018-07-20 23:56:59 +03:00
|
|
|
server = { config, ... }: {
|
2020-10-07 12:27:05 +03:00
|
|
|
services.murmur.enable = true;
|
2014-04-01 08:33:46 +04:00
|
|
|
services.murmur.registerName = "NixOS tests";
|
2020-10-07 12:27:05 +03:00
|
|
|
services.murmur.password = "$MURMURD_PASSWORD";
|
|
|
|
services.murmur.environmentFile = envFile;
|
2014-04-11 19:15:56 +04:00
|
|
|
networking.firewall.allowedTCPPorts = [ config.services.murmur.port ];
|
2014-04-01 08:33:46 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
client1 = client;
|
|
|
|
client2 = client;
|
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
2019-12-24 18:10:34 +03:00
|
|
|
start_all()
|
2014-04-01 08:33:46 +04:00
|
|
|
|
2019-12-24 18:10:34 +03:00
|
|
|
server.wait_for_unit("murmur.service")
|
|
|
|
client1.wait_for_x()
|
|
|
|
client2.wait_for_x()
|
2014-04-01 08:33:46 +04:00
|
|
|
|
2021-11-05 03:43:22 +03:00
|
|
|
client1.execute("mumble mumble://client1:testpassword\@server/test >&2 &")
|
|
|
|
client2.execute("mumble mumble://client2:testpassword\@server/test >&2 &")
|
2014-04-01 08:33:46 +04:00
|
|
|
|
|
|
|
# cancel client audio configuration
|
2019-12-24 18:10:34 +03:00
|
|
|
client1.wait_for_window(r"Audio Tuning Wizard")
|
|
|
|
client2.wait_for_window(r"Audio Tuning Wizard")
|
|
|
|
server.sleep(5) # wait because mumble is slow to register event handlers
|
|
|
|
client1.send_key("esc")
|
|
|
|
client2.send_key("esc")
|
2014-04-01 08:33:46 +04:00
|
|
|
|
|
|
|
# cancel client cert configuration
|
2019-12-24 18:10:34 +03:00
|
|
|
client1.wait_for_window(r"Certificate Management")
|
|
|
|
client2.wait_for_window(r"Certificate Management")
|
|
|
|
server.sleep(5) # wait because mumble is slow to register event handlers
|
|
|
|
client1.send_key("esc")
|
|
|
|
client2.send_key("esc")
|
2014-04-01 08:33:46 +04:00
|
|
|
|
|
|
|
# accept server certificate
|
2019-12-24 18:10:34 +03:00
|
|
|
client1.wait_for_window(r"^Mumble$")
|
|
|
|
client2.wait_for_window(r"^Mumble$")
|
|
|
|
server.sleep(5) # wait because mumble is slow to register event handlers
|
|
|
|
client1.send_chars("y")
|
|
|
|
client2.send_chars("y")
|
|
|
|
server.sleep(5) # wait because mumble is slow to register event handlers
|
2016-09-13 00:07:48 +03:00
|
|
|
|
|
|
|
# sometimes the wrong of the 2 windows is focused, we switch focus and try pressing "y" again
|
2019-12-24 18:10:34 +03:00
|
|
|
client1.send_key("alt-tab")
|
|
|
|
client2.send_key("alt-tab")
|
|
|
|
server.sleep(5) # wait because mumble is slow to register event handlers
|
|
|
|
client1.send_chars("y")
|
|
|
|
client2.send_chars("y")
|
2014-04-01 08:33:46 +04:00
|
|
|
|
|
|
|
# Find clients in logs
|
2020-10-07 12:27:05 +03:00
|
|
|
server.wait_until_succeeds(
|
|
|
|
"journalctl -eu murmur -o cat | grep -q 'client1.\+Authenticated'"
|
|
|
|
)
|
|
|
|
server.wait_until_succeeds(
|
|
|
|
"journalctl -eu murmur -o cat | grep -q 'client2.\+Authenticated'"
|
|
|
|
)
|
2014-04-01 08:33:46 +04:00
|
|
|
|
2019-12-24 18:10:34 +03:00
|
|
|
server.sleep(5) # wait to get screenshot
|
|
|
|
client1.screenshot("screen1")
|
|
|
|
client2.screenshot("screen2")
|
2014-04-01 08:33:46 +04:00
|
|
|
'';
|
2014-04-14 16:02:44 +04:00
|
|
|
})
|