1import ./make-test.nix ({ pkgs, ... }: {
2 name = "phabricator";
3 meta = with pkgs.stdenv.lib.maintainers; {
4 maintainers = [ chaoflow ];
5 };
6
7 nodes = {
8 storage =
9 { config, pkgs, ... }:
10 { services.nfs.server.enable = true;
11 services.nfs.server.exports = ''
12 /repos 192.168.1.0/255.255.255.0(rw,no_root_squash)
13 '';
14 services.nfs.server.createMountPoints = true;
15 };
16
17 webserver =
18 { config, pkgs, ... }:
19 { fileSystems = pkgs.lib.mkVMOverride
20 [ { mountPoint = "/repos";
21 device = "storage:/repos";
22 fsType = "nfs";
23 }
24 ];
25 networking.firewall.enable = false;
26 networking.useDHCP = false;
27
28 services = {
29 httpd = {
30 enable = true;
31 adminAddr = "root@localhost";
32 virtualHosts = [{
33 hostName = "phabricator.local";
34 extraSubservices = [{serviceType = "phabricator";}];
35 }];
36 };
37
38 phd = {
39 enable = true;
40 };
41
42 mysql = {
43 enable = true;
44 package = pkgs.mysql;
45 extraOptions = ''
46 sql_mode=STRICT_ALL_TABLES
47 '';
48 };
49 };
50
51 environment.systemPackages = [ pkgs.php ];
52 };
53
54 client =
55 { config, pkgs, ... }:
56 { imports = [ ./common/x11.nix ];
57 services.xserver.desktopManager.kde4.enable = true;
58 };
59 };
60
61 testScript =
62 ''
63 startAll;
64
65 $client->waitForX;
66
67 $webserver->waitForUnit("mysql");
68 $webserver->waitForUnit("httpd");
69 $webserver->execute("cd /nix/store; less >/repos/log1");
70
71 $client->sleep(30); # loading takes a long time
72 $client->execute("konqueror http://webserver/ &");
73 $client->sleep(90); # loading takes a long time
74
75 $client->screenshot("screen");
76 '';
77})