2010-01-05 11:18:43 +00:00
|
|
|
{ pkgs, ... }:
|
2009-09-02 23:16:33 +00:00
|
|
|
|
|
|
|
rec {
|
|
|
|
|
2009-09-03 00:04:43 +00:00
|
|
|
client =
|
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
2010-01-05 17:08:57 +00:00
|
|
|
{ require = [ ./common/x11.nix ];
|
2009-09-03 00:04:43 +00:00
|
|
|
services.xserver.driSupport = true;
|
2010-01-03 23:34:44 +00:00
|
|
|
services.xserver.defaultDepth = pkgs.lib.mkOverride 0 {} 16;
|
2010-01-05 11:35:59 +00:00
|
|
|
environment.systemPackages = [ pkgs.icewm pkgs.quake3demo ];
|
2009-09-03 00:04:43 +00:00
|
|
|
};
|
|
|
|
|
2009-09-02 23:16:33 +00:00
|
|
|
nodes =
|
2009-09-03 00:04:43 +00:00
|
|
|
{ server =
|
2009-09-02 23:16:33 +00:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
2009-11-05 18:21:09 +00:00
|
|
|
{ jobs.quake3Server =
|
2009-09-03 00:04:43 +00: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-02 23:16:33 +00:00
|
|
|
};
|
2009-09-03 00:04:43 +00:00
|
|
|
|
|
|
|
client1 = client;
|
|
|
|
client2 = client;
|
2009-09-02 23:16:33 +00:00
|
|
|
};
|
|
|
|
|
2010-01-05 11:18:43 +00:00
|
|
|
testScript =
|
2009-09-02 23:16:33 +00:00
|
|
|
''
|
|
|
|
startAll;
|
|
|
|
|
2009-09-03 00:04:43 +00:00
|
|
|
$server->waitForJob("quake3-server");
|
2010-01-05 23:59:29 +00:00
|
|
|
$client1->waitForX;
|
|
|
|
$client2->waitForX;
|
2009-09-02 23:16:33 +00:00
|
|
|
|
2010-01-05 23:59:29 +00:00
|
|
|
$client1->execute("quake3 '+set r_fullscreen 0' '+set name Foo' '+connect server' &");
|
|
|
|
$client2->execute("quake3 '+set r_fullscreen 0' '+set name Bar' '+connect server' &");
|
2009-09-03 00:04:43 +00:00
|
|
|
|
2010-02-04 13:59:31 +00:00
|
|
|
$server->waitUntilSucceeds("grep -q 'Foo.*entered the game' /tmp/log");
|
|
|
|
$server->waitUntilSucceeds("grep -q 'Bar.*entered the game' /tmp/log");
|
2009-09-03 00:04:43 +00:00
|
|
|
|
2010-02-04 13:59:31 +00:00
|
|
|
sleep 30; # wait for a while to get a nice screenshot
|
2010-01-05 11:35:59 +00:00
|
|
|
|
|
|
|
$client1->screenshot("screen1");
|
|
|
|
$client2->screenshot("screen2");
|
2009-09-02 23:16:33 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
}
|