From 788354cc348d976eeb84e5e8041ea5563d931504 Mon Sep 17 00:00:00 2001 From: Austin Seipp Date: Mon, 31 Mar 2014 23:33:46 -0500 Subject: [PATCH] nixos: add mumble test This tests that both the client and server work. With screenshots! Signed-off-by: Austin Seipp --- nixos/tests/default.nix | 1 + nixos/tests/mumble.nix | 54 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 nixos/tests/mumble.nix diff --git a/nixos/tests/default.nix b/nixos/tests/default.nix index 4aeb7f55ac39..955c87b2714e 100644 --- a/nixos/tests/default.nix +++ b/nixos/tests/default.nix @@ -25,6 +25,7 @@ with import ../lib/testing.nix { inherit system minimal; }; mysql = makeTest (import ./mysql.nix); mysql_replication = makeTest (import ./mysql-replication.nix); munin = makeTest (import ./munin.nix); + mumble = makeTest (import ./mumble.nix); nat = makeTest (import ./nat.nix); nfs3 = makeTest (import ./nfs.nix { version = 3; }); #nfs4 = makeTest (import ./nfs.nix { version = 4; }); diff --git a/nixos/tests/mumble.nix b/nixos/tests/mumble.nix new file mode 100644 index 000000000000..509742f2899b --- /dev/null +++ b/nixos/tests/mumble.nix @@ -0,0 +1,54 @@ +{ pkgs, ... }: + +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"; + }; + + 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"); + ''; +}