python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / nixos / tests / mumble.nix
blob2b5cc20163bcb06eb723c6255a11f3fabf7d4bbb
1 import ./make-test-python.nix ({ pkgs, ...} :
3 let
4   client = { pkgs, ... }: {
5     imports = [ ./common/x11.nix ];
6     environment.systemPackages = [ pkgs.mumble ];
7   };
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
12   '';
16   name = "mumble";
17   meta = with pkgs.lib.maintainers; {
18     maintainers = [ thoughtpolice eelco ];
19   };
21   nodes = {
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 ];
28     };
30     client1 = client;
31     client2 = client;
32   };
34   testScript = ''
35     start_all()
37     server.wait_for_unit("murmur.service")
38     client1.wait_for_x()
39     client2.wait_for_x()
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'"
76     )
77     server.wait_until_succeeds(
78         "journalctl -eu murmur -o cat | grep -q 'client2.\+Authenticated'"
79     )
81     server.sleep(5)  # wait to get screenshot
82     client1.screenshot("screen1")
83     client2.screenshot("screen2")
84   '';