about summary refs log tree commit diff
path: root/nixos/tests
diff options
context:
space:
mode:
authorAaron Andersen <aaron@fosslib.net>2019-08-26 21:12:44 -0400
committerGitHub <noreply@github.com>2019-08-26 21:12:44 -0400
commit87fdc06a9750c0d54e61788ceb7ad83a23e2e84d (patch)
tree4f60ac899df207f20b4841ef551043e706a299e2 /nixos/tests
parent71095460b94b6c382afe188d1caa0b7048030b8a (diff)
parent3bd03d2c0aa46036019d257f710b54c3e628ab7e (diff)
Merge pull request #63634 from aanderse/moodle
moodle: init at 3.7.1
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/all-tests.nix1
-rw-r--r--nixos/tests/moodle.nix22
2 files changed, 23 insertions, 0 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index 36a053e8e6bdc..e3e4ddab72c62 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -161,6 +161,7 @@ in
   minio = handleTest ./minio.nix {};
   misc = handleTest ./misc.nix {};
   mongodb = handleTest ./mongodb.nix {};
+  moodle = handleTest ./moodle.nix {};
   morty = handleTest ./morty.nix {};
   mosquitto = handleTest ./mosquitto.nix {};
   mpd = handleTest ./mpd.nix {};
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;
+  '';
+})