1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/nixos/tests/mumble.nix

74 lines
2.3 KiB
Nix
Raw Normal View History

import ./make-test.nix ({ pkgs, ...} :
let
client = { pkgs, ... }: {
imports = [ ./common/x11.nix ];
environment.systemPackages = [ pkgs.mumble ];
};
in
{
2014-06-28 15:04:49 +01:00
name = "mumble";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ thoughtpolice eelco ];
};
2014-06-28 15:04:49 +01:00
nodes = {
server = { config, ... }: {
services.murmur.enable = true;
services.murmur.registerName = "NixOS tests";
networking.firewall.allowedTCPPorts = [ config.services.murmur.port ];
};
client1 = client;
client2 = client;
};
testScript = ''
startAll;
$server->waitForUnit("murmur.service");
$client1->waitForX;
$client2->waitForX;
$client1->execute("mumble mumble://client1\@server/test &");
$client2->execute("mumble mumble://client2\@server/test &");
# cancel client audio configuration
$client1->waitForWindow(qr/Audio Tuning Wizard/);
$client2->waitForWindow(qr/Audio Tuning Wizard/);
$server->sleep(5); # wait because mumble is slow to register event handlers
$client1->sendKeys("esc");
$client2->sendKeys("esc");
# cancel client cert configuration
$client1->waitForWindow(qr/Certificate Management/);
$client2->waitForWindow(qr/Certificate Management/);
$server->sleep(5); # wait because mumble is slow to register event handlers
$client1->sendKeys("esc");
$client2->sendKeys("esc");
# accept server certificate
$client1->waitForWindow(qr/^Mumble$/);
$client2->waitForWindow(qr/^Mumble$/);
$server->sleep(5); # wait because mumble is slow to register event handlers
$client1->sendChars("y");
$client2->sendChars("y");
$server->sleep(5); # wait because mumble is slow to register event handlers
# sometimes the wrong of the 2 windows is focused, we switch focus and try pressing "y" again
$client1->sendKeys("alt-tab");
$client2->sendKeys("alt-tab");
$server->sleep(5); # wait because mumble is slow to register event handlers
$client1->sendChars("y");
$client2->sendChars("y");
# Find clients in logs
$server->waitUntilSucceeds("journalctl -eu murmur -o cat | grep -q client1");
$server->waitUntilSucceeds("journalctl -eu murmur -o cat | grep -q client2");
$server->sleep(5); # wait to get screenshot
$client1->screenshot("screen1");
$client2->screenshot("screen2");
'';
})