2010-01-05 12:57:17 +01:00
|
|
|
{ pkgs, ... }:
|
2009-09-04 13:37:07 +02:00
|
|
|
|
2010-01-05 12:57:17 +01:00
|
|
|
{
|
2009-09-04 13:37:07 +02:00
|
|
|
nodes = {
|
2011-09-14 20:20:50 +02:00
|
|
|
storage =
|
2009-09-04 13:37:07 +02:00
|
|
|
{pkgs, config, ...}:
|
|
|
|
{
|
2012-03-16 21:41:49 +01:00
|
|
|
services.nfs.server.enable = true;
|
|
|
|
services.nfs.server.exports = ''
|
2009-09-05 01:04:29 +02:00
|
|
|
/repos 192.168.1.0/255.255.255.0(rw,no_root_squash)
|
|
|
|
'';
|
2012-03-16 21:41:49 +01:00
|
|
|
services.nfs.server.createMountPoints = true;
|
2009-09-04 13:37:07 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
postgresql =
|
|
|
|
{config, pkgs, ...}:
|
|
|
|
{
|
2010-03-11 18:02:53 +01:00
|
|
|
services.openssh.enable = true;
|
2009-09-05 01:04:29 +02:00
|
|
|
services.postgresql.enable = true;
|
2013-06-29 20:25:38 +02:00
|
|
|
services.postgresql.package = pkgs.postgresql92;
|
2009-11-05 19:21:09 +01:00
|
|
|
services.postgresql.enableTCPIP = true;
|
2009-09-05 01:04:29 +02:00
|
|
|
services.postgresql.authentication = ''
|
|
|
|
# Generated file; do not edit!
|
|
|
|
local all all trust
|
|
|
|
host all all 127.0.0.1/32 trust
|
2009-11-05 19:21:09 +01:00
|
|
|
host all all ::1/128 trust
|
|
|
|
host all all 192.168.1.0/24 trust
|
2009-09-05 01:04:29 +02:00
|
|
|
'';
|
2009-09-04 13:37:07 +02:00
|
|
|
};
|
|
|
|
|
2011-09-14 20:20:50 +02:00
|
|
|
webserver =
|
2009-09-04 13:37:07 +02:00
|
|
|
{config, pkgs, ...}:
|
|
|
|
{
|
2011-09-14 20:20:50 +02:00
|
|
|
fileSystems = pkgs.lib.mkOverride 50
|
2010-01-05 18:42:36 +01:00
|
|
|
[ { mountPoint = "/repos";
|
2011-02-04 14:33:52 +01:00
|
|
|
device = "storage:/repos";
|
2012-10-24 18:10:58 +02:00
|
|
|
fsType = "nfs";
|
2012-03-16 21:41:49 +01:00
|
|
|
}
|
2010-01-05 18:42:36 +01:00
|
|
|
];
|
2011-09-14 20:20:50 +02:00
|
|
|
|
2009-09-05 01:04:29 +02:00
|
|
|
services.httpd.enable = true;
|
|
|
|
services.httpd.adminAddr = "root@localhost";
|
|
|
|
services.httpd.extraSubservices = [ { serviceType = "trac"; } ];
|
2009-11-05 19:21:09 +01:00
|
|
|
environment.systemPackages = [ pkgs.pythonPackages.trac pkgs.subversion ];
|
2009-09-04 13:37:07 +02:00
|
|
|
};
|
2011-09-14 20:20:50 +02:00
|
|
|
|
|
|
|
client =
|
2009-09-04 13:37:07 +02:00
|
|
|
{config, pkgs, ...}:
|
|
|
|
{
|
2010-01-05 18:42:36 +01:00
|
|
|
require = [ ./common/x11.nix ];
|
2009-11-05 19:21:09 +01:00
|
|
|
services.xserver.desktopManager.kde4.enable = true;
|
2009-09-04 13:37:07 +02:00
|
|
|
};
|
|
|
|
};
|
2011-09-14 20:20:50 +02:00
|
|
|
|
2010-01-05 12:57:17 +01:00
|
|
|
testScript =
|
2009-09-04 13:37:07 +02:00
|
|
|
''
|
|
|
|
startAll;
|
2011-09-14 20:20:50 +02:00
|
|
|
|
2012-10-24 18:22:53 +02:00
|
|
|
$postgresql->waitForUnit("postgresql");
|
|
|
|
$postgresql->succeed("createdb trac");
|
2011-09-14 20:20:50 +02:00
|
|
|
|
2012-10-24 18:22:53 +02:00
|
|
|
$webserver->succeed("mkdir -p /repos/trac");
|
|
|
|
$webserver->succeed("svnadmin create /repos/trac");
|
2011-09-14 20:20:50 +02:00
|
|
|
|
|
|
|
$webserver->waitForFile("/var/trac");
|
2012-10-24 18:22:53 +02:00
|
|
|
$webserver->succeed("mkdir -p /var/trac/projects/test");
|
|
|
|
$webserver->succeed("PYTHONPATH=${pkgs.pythonPackages.psycopg2}/lib/${pkgs.python.libPrefix}/site-packages trac-admin /var/trac/projects/test initenv Test postgres://root\@postgresql/trac svn /repos/trac");
|
2011-09-14 20:20:50 +02:00
|
|
|
|
2010-01-06 00:59:29 +01:00
|
|
|
$client->waitForX;
|
|
|
|
$client->execute("konqueror http://webserver/projects/test &");
|
|
|
|
$client->waitForWindow(qr/Test.*Konqueror/);
|
2011-01-10 15:41:16 +01:00
|
|
|
$client->sleep(30); # loading takes a long time
|
2011-09-14 20:20:50 +02:00
|
|
|
|
2010-01-05 12:57:17 +01:00
|
|
|
$client->screenshot("screen");
|
2009-09-04 13:37:07 +02:00
|
|
|
'';
|
|
|
|
}
|