2010-01-05 11:57:17 +00:00
|
|
|
{ pkgs, ... }:
|
2009-09-04 12:37:07 +01:00
|
|
|
|
2010-01-05 11:57:17 +00:00
|
|
|
{
|
2009-09-04 12:37:07 +01:00
|
|
|
nodes = {
|
|
|
|
storage =
|
|
|
|
{pkgs, config, ...}:
|
|
|
|
{
|
2009-09-05 00:04:29 +01:00
|
|
|
services.portmap.enable = true;
|
|
|
|
services.nfsKernel.enable = true;
|
|
|
|
services.nfsKernel.exports = ''
|
|
|
|
/repos 192.168.1.0/255.255.255.0(rw,no_root_squash)
|
|
|
|
'';
|
2009-11-05 18:21:09 +00:00
|
|
|
services.nfsKernel.createMountPoints = true;
|
2009-09-04 12:37:07 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
postgresql =
|
|
|
|
{config, pkgs, ...}:
|
|
|
|
{
|
2009-09-05 00:04:29 +01:00
|
|
|
services.sshd.enable = true;
|
|
|
|
services.postgresql.enable = true;
|
2009-11-05 18:21:09 +00:00
|
|
|
services.postgresql.enableTCPIP = true;
|
2009-09-05 00:04:29 +01: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 18:21:09 +00:00
|
|
|
host all all ::1/128 trust
|
|
|
|
host all all 192.168.1.0/24 trust
|
2009-09-05 00:04:29 +01:00
|
|
|
'';
|
2009-09-04 12:37:07 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
webserver =
|
|
|
|
{config, pkgs, ...}:
|
|
|
|
{
|
2009-09-04 23:06:54 +01:00
|
|
|
fileSystems = pkgs.lib.mkOverride 50 {}
|
2009-11-05 18:21:09 +00:00
|
|
|
[
|
|
|
|
{ mountPoint = "/repos";
|
|
|
|
device = "storage:/repos"; }
|
|
|
|
];
|
2009-09-04 23:06:54 +01:00
|
|
|
|
2009-09-05 00:04:29 +01:00
|
|
|
services.portmap.enable = true;
|
|
|
|
services.httpd.enable = true;
|
|
|
|
services.httpd.adminAddr = "root@localhost";
|
|
|
|
services.httpd.extraSubservices = [ { serviceType = "trac"; } ];
|
2009-11-05 18:21:09 +00:00
|
|
|
environment.systemPackages = [ pkgs.pythonPackages.trac pkgs.subversion ];
|
2009-09-04 12:37:07 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
client =
|
|
|
|
{config, pkgs, ...}:
|
|
|
|
{
|
2009-09-05 00:04:29 +01:00
|
|
|
services.xserver.enable = true;
|
|
|
|
services.xserver.displayManager.slim.enable = false;
|
|
|
|
services.xserver.displayManager.kdm.enable = true;
|
2009-11-05 18:21:09 +00:00
|
|
|
services.xserver.displayManager.kdm.extraConfig =
|
2009-09-05 00:04:29 +01:00
|
|
|
''
|
|
|
|
[X-:0-Core]
|
|
|
|
AutoLoginEnable=true
|
|
|
|
AutoLoginUser=alice
|
|
|
|
AutoLoginPass=foobar
|
|
|
|
'';
|
2009-11-05 18:21:09 +00:00
|
|
|
services.xserver.desktopManager.default = "kde4";
|
|
|
|
services.xserver.desktopManager.kde4.enable = true;
|
|
|
|
users.extraUsers = pkgs.lib.singleton {
|
|
|
|
name = "alice";
|
2009-09-05 00:04:29 +01:00
|
|
|
description = "Alice Foobar";
|
|
|
|
home = "/home/alice";
|
|
|
|
createHome = true;
|
|
|
|
useDefaultShell = true;
|
|
|
|
password = "foobar";
|
2009-09-04 15:45:30 +01:00
|
|
|
};
|
2009-09-04 12:37:07 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2010-01-05 11:57:17 +00:00
|
|
|
testScript =
|
2009-09-04 12:37:07 +01:00
|
|
|
''
|
|
|
|
startAll;
|
|
|
|
|
2010-01-05 11:57:17 +00:00
|
|
|
$postgresql->waitForJob("postgresql");
|
2009-09-04 15:45:30 +01:00
|
|
|
$postgresql->mustSucceed("createdb trac");
|
2009-09-04 23:06:54 +01:00
|
|
|
|
2009-09-04 15:45:30 +01:00
|
|
|
$webserver->mustSucceed("mkdir -p /repos/trac");
|
2009-09-04 23:06:54 +01:00
|
|
|
$webserver->mustSucceed("svnadmin create /repos/trac");
|
2009-09-04 12:37:07 +01:00
|
|
|
|
2009-09-04 23:06:54 +01:00
|
|
|
$webserver->waitForFile("/var/trac");
|
2009-09-04 15:45:30 +01:00
|
|
|
$webserver->mustSucceed("mkdir -p /var/trac/projects/test");
|
|
|
|
$webserver->mustSucceed("PYTHONPATH=${pkgs.pythonPackages.psycopg2}/lib/python2.5/site-packages trac-admin /var/trac/projects/test initenv Test postgres://root\@postgresql/trac svn /repos/trac");
|
2009-09-04 12:37:07 +01:00
|
|
|
|
|
|
|
$client->waitForFile("/tmp/.X11-unix/X0");
|
2009-09-04 15:45:30 +01:00
|
|
|
sleep 60;
|
2009-09-04 12:37:07 +01:00
|
|
|
|
2010-01-05 11:57:17 +00:00
|
|
|
$client->execute("su - alice -c 'DISPLAY=:0.0 konqueror http://webserver/projects/test &'");
|
2009-09-04 23:06:54 +01:00
|
|
|
sleep 120;
|
2009-09-04 12:37:07 +01:00
|
|
|
|
2010-01-05 11:57:17 +00:00
|
|
|
$client->screenshot("screen");
|
2009-09-04 12:37:07 +01:00
|
|
|
'';
|
|
|
|
}
|