about summary refs log tree commit diff
path: root/nixos/tests/moodle.nix
diff options
context:
space:
mode:
authorAaron Andersen <aaron@fosslib.net>2019-06-21 10:09:15 -0400
committerAaron Andersen <aaron@fosslib.net>2019-08-25 08:12:28 -0400
commit3bd03d2c0aa46036019d257f710b54c3e628ab7e (patch)
treedef95fde48b657c77c7e3adcf5f8da8b35c2f5f5 /nixos/tests/moodle.nix
parent95b3b635553d48032a45092714c9acbc401a56ab (diff)
nixos/moodle: init service
Diffstat (limited to 'nixos/tests/moodle.nix')
-rw-r--r--nixos/tests/moodle.nix22
1 files changed, 22 insertions, 0 deletions
diff --git a/nixos/tests/moodle.nix b/nixos/tests/moodle.nix
new file mode 100644
index 0000000000000..565a6b6369494
--- /dev/null
+++ b/nixos/tests/moodle.nix
@@ -0,0 +1,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;
+  '';
+})