1 import ./make-test-python.nix ({ pkgs, ...} :
4 client = { pkgs, ... }: {
5 imports = [ ./common/x11.nix ];
6 environment.systemPackages = [ pkgs.mumble ];
9 # outside of tests, this file should obviously not come from the nix store
10 envFile = pkgs.writeText "nixos-test-mumble-murmurd.env" ''
11 MURMURD_PASSWORD=testpassword
17 meta = with pkgs.lib.maintainers; {
18 maintainers = [ thoughtpolice eelco ];
22 server = { config, ... }: {
23 services.murmur.enable = true;
24 services.murmur.registerName = "NixOS tests";
25 services.murmur.password = "$MURMURD_PASSWORD";
26 services.murmur.environmentFile = envFile;
27 networking.firewall.allowedTCPPorts = [ config.services.murmur.port ];
37 server.wait_for_unit("murmur.service")
41 client1.execute("mumble mumble://client1:testpassword\@server/test >&2 &")
42 client2.execute("mumble mumble://client2:testpassword\@server/test >&2 &")
44 # cancel client audio configuration
45 client1.wait_for_window(r"Audio Tuning Wizard")
46 client2.wait_for_window(r"Audio Tuning Wizard")
47 server.sleep(5) # wait because mumble is slow to register event handlers
48 client1.send_key("esc")
49 client2.send_key("esc")
51 # cancel client cert configuration
52 client1.wait_for_window(r"Certificate Management")
53 client2.wait_for_window(r"Certificate Management")
54 server.sleep(5) # wait because mumble is slow to register event handlers
55 client1.send_key("esc")
56 client2.send_key("esc")
58 # accept server certificate
59 client1.wait_for_window(r"^Mumble$")
60 client2.wait_for_window(r"^Mumble$")
61 server.sleep(5) # wait because mumble is slow to register event handlers
62 client1.send_chars("y")
63 client2.send_chars("y")
64 server.sleep(5) # wait because mumble is slow to register event handlers
66 # sometimes the wrong of the 2 windows is focused, we switch focus and try pressing "y" again
67 client1.send_key("alt-tab")
68 client2.send_key("alt-tab")
69 server.sleep(5) # wait because mumble is slow to register event handlers
70 client1.send_chars("y")
71 client2.send_chars("y")
73 # Find clients in logs
74 server.wait_until_succeeds(
75 "journalctl -eu murmur -o cat | grep -q 'client1.\+Authenticated'"
77 server.wait_until_succeeds(
78 "journalctl -eu murmur -o cat | grep -q 'client2.\+Authenticated'"
81 server.sleep(5) # wait to get screenshot
82 client1.screenshot("screen1")
83 client2.screenshot("screen2")