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 ];
22 server = { config, ... }: {
23 security.apparmor.enable = true;
24 services.murmur.enable = true;
25 services.murmur.registerName = "NixOS tests";
26 services.murmur.password = "$MURMURD_PASSWORD";
27 services.murmur.environmentFile = envFile;
28 networking.firewall.allowedTCPPorts = [ config.services.murmur.port ];
38 server.wait_for_unit("murmur.service")
42 client1.execute("mumble mumble://client1:testpassword\@server/test >&2 &")
43 client2.execute("mumble mumble://client2:testpassword\@server/test >&2 &")
45 # cancel client audio configuration
46 client1.wait_for_window(r"Audio Tuning Wizard")
47 client2.wait_for_window(r"Audio Tuning Wizard")
48 server.sleep(5) # wait because mumble is slow to register event handlers
49 client1.send_key("esc")
50 client2.send_key("esc")
52 # cancel client cert configuration
53 client1.wait_for_window(r"Certificate Management")
54 client2.wait_for_window(r"Certificate Management")
55 server.sleep(5) # wait because mumble is slow to register event handlers
56 client1.send_key("esc")
57 client2.send_key("esc")
59 # accept server certificate
60 client1.wait_for_window(r"^Mumble$")
61 client2.wait_for_window(r"^Mumble$")
62 server.sleep(5) # wait because mumble is slow to register event handlers
63 client1.send_chars("y")
64 client2.send_chars("y")
65 server.sleep(5) # wait because mumble is slow to register event handlers
67 # sometimes the wrong of the 2 windows is focused, we switch focus and try pressing "y" again
68 client1.send_key("alt-tab")
69 client2.send_key("alt-tab")
70 server.sleep(5) # wait because mumble is slow to register event handlers
71 client1.send_chars("y")
72 client2.send_chars("y")
74 # Find clients in logs
75 server.wait_until_succeeds(
76 "journalctl -eu murmur -o cat | grep -q 'client1.\+Authenticated'"
78 server.wait_until_succeeds(
79 "journalctl -eu murmur -o cat | grep -q 'client2.\+Authenticated'"
82 server.sleep(5) # wait to get screenshot
83 client1.screenshot("screen1")
84 client2.screenshot("screen2")
86 # check if apparmor denied anything
87 server.fail('journalctl -b --no-pager --grep "^audit: .*apparmor=\\"DENIED\\""')