2014-04-14 13:02:44 +01:00
|
|
|
import ./make-test.nix ({ pkgs, ... }: {
|
2014-06-28 15:04:49 +01:00
|
|
|
name = "trac";
|
2015-07-12 11:09:40 +01:00
|
|
|
meta = with pkgs.stdenv.lib.maintainers; {
|
2019-02-22 15:14:13 +00:00
|
|
|
maintainers = [ eelco ];
|
2015-07-12 11:09:40 +01:00
|
|
|
};
|
2009-09-04 12:37:07 +01:00
|
|
|
|
|
|
|
nodes = {
|
2011-09-14 19:20:50 +01:00
|
|
|
storage =
|
2018-07-20 21:56:59 +01:00
|
|
|
{ ... }:
|
2013-09-04 12:05:09 +01:00
|
|
|
{ services.nfs.server.enable = true;
|
2012-03-16 20:41:49 +00:00
|
|
|
services.nfs.server.exports = ''
|
2009-09-05 00:04:29 +01:00
|
|
|
/repos 192.168.1.0/255.255.255.0(rw,no_root_squash)
|
|
|
|
'';
|
2012-03-16 20:41:49 +00:00
|
|
|
services.nfs.server.createMountPoints = true;
|
2009-09-04 12:37:07 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
postgresql =
|
2018-07-20 21:56:59 +01:00
|
|
|
{ pkgs, ... }:
|
2013-09-04 12:05:09 +01:00
|
|
|
{ services.postgresql.enable = true;
|
2017-09-05 17:17:22 +01:00
|
|
|
services.postgresql.package = pkgs.postgresql;
|
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
|
|
|
};
|
|
|
|
|
2011-09-14 19:20:50 +01:00
|
|
|
webserver =
|
2018-07-20 21:56:59 +01:00
|
|
|
{ pkgs, ... }:
|
2013-10-29 12:04:52 +00:00
|
|
|
{ fileSystems = pkgs.lib.mkVMOverride
|
2010-01-05 17:42:36 +00:00
|
|
|
[ { mountPoint = "/repos";
|
2011-02-04 13:33:52 +00:00
|
|
|
device = "storage:/repos";
|
2012-10-24 17:10:58 +01:00
|
|
|
fsType = "nfs";
|
2012-03-16 20:41:49 +00:00
|
|
|
}
|
2010-01-05 17:42:36 +00:00
|
|
|
];
|
2009-09-05 00:04:29 +01:00
|
|
|
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
|
|
|
};
|
2011-09-14 19:20:50 +01:00
|
|
|
|
|
|
|
client =
|
2018-07-20 21:56:59 +01:00
|
|
|
{ ... }:
|
2013-09-04 12:05:09 +01:00
|
|
|
{ imports = [ ./common/x11.nix ];
|
2017-03-03 13:26:51 +00:00
|
|
|
services.xserver.desktopManager.plasma5.enable = true;
|
2009-09-04 12:37:07 +01:00
|
|
|
};
|
|
|
|
};
|
2011-09-14 19:20:50 +01:00
|
|
|
|
2010-01-05 11:57:17 +00:00
|
|
|
testScript =
|
2009-09-04 12:37:07 +01:00
|
|
|
''
|
|
|
|
startAll;
|
2011-09-14 19:20:50 +01:00
|
|
|
|
2012-10-24 17:22:53 +01:00
|
|
|
$postgresql->waitForUnit("postgresql");
|
|
|
|
$postgresql->succeed("createdb trac");
|
2011-09-14 19:20:50 +01:00
|
|
|
|
2012-10-24 17:22:53 +01:00
|
|
|
$webserver->succeed("mkdir -p /repos/trac");
|
|
|
|
$webserver->succeed("svnadmin create /repos/trac");
|
2011-09-14 19:20:50 +01:00
|
|
|
|
2013-07-17 14:28:36 +01:00
|
|
|
$webserver->waitForUnit("httpd");
|
2011-09-14 19:20:50 +01:00
|
|
|
$webserver->waitForFile("/var/trac");
|
2012-10-24 17:22:53 +01: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 19:20:50 +01:00
|
|
|
|
2010-01-05 23:59:29 +00:00
|
|
|
$client->waitForX;
|
|
|
|
$client->execute("konqueror http://webserver/projects/test &");
|
|
|
|
$client->waitForWindow(qr/Test.*Konqueror/);
|
2011-01-10 14:41:16 +00:00
|
|
|
$client->sleep(30); # loading takes a long time
|
2011-09-14 19:20:50 +01:00
|
|
|
|
2010-01-05 11:57:17 +00:00
|
|
|
$client->screenshot("screen");
|
2009-09-04 12:37:07 +01:00
|
|
|
'';
|
2014-04-14 13:02:44 +01:00
|
|
|
})
|