nixpkgs/nixos/tests/mumble.nix
Eelco Dolstra abe218950c Make it easier to run the tests
You can now run a test in the nixos/tests directory directly using
nix-build, e.g.

  $ nix-build '<nixos/tests/login.nix>' -A test

This gets rid of having to add the test to nixos/tests/default.nix.
(Of course, you still need to add it to nixos/release.nix if you want
Hydra to run the test.)
2014-04-14 14:02:44 +02:00

55 lines
1.4 KiB
Nix

import ./make-test.nix (
let
client = { config, pkgs, ... }: {
imports = [ ./common/x11.nix ];
environment.systemPackages = [ pkgs.mumble ];
};
in
{
nodes = {
server = { config, pkgs, ... }: {
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 &");
$server->sleep(10); # Wait for Mumble UI to pop up
# cancel client audio configuration
$client1->sendKeys("esc");
$client2->sendKeys("esc");
$server->sleep(1);
# cancel client cert configuration
$client1->sendKeys("esc");
$client2->sendKeys("esc");
$server->sleep(1);
# accept server certificate
$client1->sendChars("y");
$client2->sendChars("y");
# Find clients in logs
$server->waitUntilSucceeds("grep -q 'client1' /var/log/murmur/murmurd.log");
$server->waitUntilSucceeds("grep -q 'client2' /var/log/murmur/murmurd.log");
$server->sleep(5); # wait to get screenshot
$client1->screenshot("screen1");
$client2->screenshot("screen2");
'';
})