about summary refs log tree commit diff
path: root/nixos/tests/moodle.nix
blob: 565a6b6369494f92ea142dd9a0933dde15485baf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import ./make-test.nix ({ pkgs, lib, ... }: {
  name = "moodle";
  meta.maintainers = [ lib.maintainers.aanderse ];

  machine =
    { ... }:
    { services.moodle.enable = true;
      services.moodle.virtualHost.hostName = "localhost";
      services.moodle.virtualHost.adminAddr = "root@example.com";
      services.moodle.initialPassword = "correcthorsebatterystaple";

      # Ensure the virtual machine has enough memory to avoid errors like:
      # Fatal error: Out of memory (allocated 152047616) (tried to allocate 33554440 bytes)
      virtualisation.memorySize = 2000;
    };

  testScript = ''
    startAll;
    $machine->waitForUnit('phpfpm-moodle.service');
    $machine->succeed('curl http://localhost/') =~ /You are not logged in/ or die;
  '';
})