2019-12-24 16:10:34 +01:00
|
|
|
import ./make-test-python.nix ({ pkgs, ...} :
|
2014-04-01 06:33:46 +02:00
|
|
|
|
|
|
|
let
|
2018-07-20 22:56:59 +02:00
|
|
|
client = { pkgs, ... }: {
|
2014-04-01 06:33:46 +02:00
|
|
|
imports = [ ./common/x11.nix ];
|
|
|
|
environment.systemPackages = [ pkgs.mumble ];
|
|
|
|
};
|
2020-10-07 11:27:05 +02: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 06:33:46 +02:00
|
|
|
in
|
|
|
|
{
|
2014-06-28 16:04:49 +02:00
|
|
|
name = "mumble";
|
2021-01-10 20:08:30 +01:00
|
|
|
meta = with pkgs.lib.maintainers; {
|
2019-02-22 16:14:13 +01:00
|
|
|
maintainers = [ thoughtpolice eelco ];
|
2015-07-12 12:09:40 +02:00
|
|
|
};
|
2014-06-28 16:04:49 +02:00
|
|
|
|
2014-04-01 06:33:46 +02:00
|
|
|
nodes = {
|
2018-07-20 22:56:59 +02:00
|
|
|
server = { config, ... }: {
|
2020-10-07 11:27:05 +02:00
|
|
|
services.murmur.enable = true;
|
2014-04-01 06:33:46 +02:00
|
|
|
services.murmur.registerName = "NixOS tests";
|
2020-10-07 11:27:05 +02:00
|
|
|
services.murmur.password = "$MURMURD_PASSWORD";
|
|
|
|
services.murmur.environmentFile = envFile;
|
2014-04-11 17:15:56 +02:00
|
|
|
networking.firewall.allowedTCPPorts = [ config.services.murmur.port ];
|
2014-04-01 06:33:46 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
client1 = client;
|
|
|
|
client2 = client;
|
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
2019-12-24 16:10:34 +01:00
|
|
|
start_all()
|
2014-04-01 06:33:46 +02:00
|
|
|
|
2019-12-24 16:10:34 +01:00
|
|
|
server.wait_for_unit("murmur.service")
|
|
|
|
client1.wait_for_x()
|
|
|
|
client2.wait_for_x()
|
2014-04-01 06:33:46 +02:00
|
|
|
|
2020-10-07 11:27:05 +02:00
|
|
|
client1.execute("mumble mumble://client1:testpassword\@server/test &")
|
|
|
|
client2.execute("mumble mumble://client2:testpassword\@server/test &")
|
2014-04-01 06:33:46 +02:00
|
|
|
|
|
|
|
# cancel client audio configuration
|
2019-12-24 16:10:34 +01: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 06:33:46 +02:00
|
|
|
|
|
|
|
# cancel client cert configuration
|
2019-12-24 16:10:34 +01: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 06:33:46 +02:00
|
|
|
|
|
|
|
# accept server certificate
|
2019-12-24 16:10:34 +01: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-12 23:07:48 +02:00
|
|
|
|
|
|
|
# sometimes the wrong of the 2 windows is focused, we switch focus and try pressing "y" again
|
2019-12-24 16:10:34 +01: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 06:33:46 +02:00
|
|
|
|
|
|
|
# Find clients in logs
|
2020-10-07 11:27:05 +02: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 06:33:46 +02:00
|
|
|
|
2019-12-24 16:10:34 +01:00
|
|
|
server.sleep(5) # wait to get screenshot
|
|
|
|
client1.screenshot("screen1")
|
|
|
|
client2.screenshot("screen2")
|
2014-04-01 06:33:46 +02:00
|
|
|
'';
|
2014-04-14 14:02:44 +02:00
|
|
|
})
|