2010-01-05 12:18:43 +01:00
|
|
|
{ pkgs, ... }:
|
2009-09-03 01:16:33 +02:00
|
|
|
|
|
|
|
rec {
|
|
|
|
|
2009-09-03 02:04:43 +02:00
|
|
|
client =
|
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
|
|
|
{ services.xserver.enable = true;
|
|
|
|
services.xserver.driSupport = true;
|
2010-01-04 00:34:44 +01:00
|
|
|
services.xserver.defaultDepth = pkgs.lib.mkOverride 0 {} 16;
|
2010-01-05 12:35:59 +01:00
|
|
|
environment.systemPackages = [ pkgs.icewm pkgs.quake3demo ];
|
2009-09-03 02:04:43 +02:00
|
|
|
};
|
|
|
|
|
2009-09-03 01:16:33 +02:00
|
|
|
nodes =
|
2009-09-03 02:04:43 +02:00
|
|
|
{ server =
|
2009-09-03 01:16:33 +02:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
2009-11-05 19:21:09 +01:00
|
|
|
{ jobs.quake3Server =
|
2009-09-03 02:04:43 +02:00
|
|
|
{ name = "quake3-server";
|
|
|
|
startOn = "startup";
|
|
|
|
exec =
|
|
|
|
"${pkgs.quake3demo}/bin/quake3 '+set dedicated 1' '+set g_gametype 0' " +
|
|
|
|
"'+map q3dm7' '+addbot grunt' '+addbot daemia' 2> /tmp/log";
|
|
|
|
};
|
2009-09-03 01:16:33 +02:00
|
|
|
};
|
2009-09-03 02:04:43 +02:00
|
|
|
|
|
|
|
client1 = client;
|
|
|
|
client2 = client;
|
2009-09-03 01:16:33 +02:00
|
|
|
};
|
|
|
|
|
2010-01-05 12:18:43 +01:00
|
|
|
testScript =
|
2009-09-03 01:16:33 +02:00
|
|
|
''
|
|
|
|
startAll;
|
|
|
|
|
2009-09-03 02:04:43 +02:00
|
|
|
$server->waitForJob("quake3-server");
|
|
|
|
$client1->waitForFile("/tmp/.X11-unix/X0");
|
|
|
|
$client2->waitForFile("/tmp/.X11-unix/X0");
|
2009-09-03 01:16:33 +02:00
|
|
|
|
|
|
|
sleep 20;
|
|
|
|
|
2010-01-05 12:57:17 +01:00
|
|
|
$client1->execute("DISPLAY=:0.0 icewm &");
|
|
|
|
$client1->execute("DISPLAY=:0.0 quake3 '+set r_fullscreen 0' '+set name Foo' '+connect server' &");
|
2009-09-03 02:04:43 +02:00
|
|
|
|
2010-01-05 12:57:17 +01:00
|
|
|
$client2->execute("DISPLAY=:0.0 icewm &");
|
|
|
|
$client2->execute("DISPLAY=:0.0 quake3 '+set r_fullscreen 0' '+set name Bar' '+connect server' &");
|
2009-09-03 02:04:43 +02:00
|
|
|
|
|
|
|
sleep 40;
|
|
|
|
|
|
|
|
$server->mustSucceed("grep -q 'Foo.*entered the game' /tmp/log");
|
|
|
|
$server->mustSucceed("grep -q 'Bar.*entered the game' /tmp/log");
|
2010-01-05 12:35:59 +01:00
|
|
|
|
|
|
|
$client1->screenshot("screen1");
|
|
|
|
$client2->screenshot("screen2");
|
2009-09-03 01:16:33 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
}
|