about summary refs log tree commit diff
path: root/nixos/tests/nexus.nix
diff options
context:
space:
mode:
authorMichele Catalano <michele.catalano@mayflower.de>2017-09-01 18:24:20 +0200
committerRobin Gloster <mail@glob.in>2017-09-04 22:32:02 +0200
commit4ea1d49643679761aaa2e809ade34a5812ace8e3 (patch)
treee642ec7b0594327ddc4475b220b426c1bda822ee /nixos/tests/nexus.nix
parente783c2b39cfcfa5d3994e774357404f87097aa82 (diff)
nexus: Add module for nexus.
Add also myself as maintainer
Add simple test of the nexus service
Diffstat (limited to 'nixos/tests/nexus.nix')
-rw-r--r--nixos/tests/nexus.nix34
1 files changed, 34 insertions, 0 deletions
diff --git a/nixos/tests/nexus.nix b/nixos/tests/nexus.nix
new file mode 100644
index 0000000000000..1f19fc0867a49
--- /dev/null
+++ b/nixos/tests/nexus.nix
@@ -0,0 +1,34 @@
+# verifies:
+#   1. nexus service starts on server
+#   2. nexus user can be extended on server
+#   3. nexus service not can startup on server (creating database and all other initial stuff)
+
+import ./make-test.nix ({ pkgs, ...} : {
+  name = "nexus";
+  meta = with pkgs.stdenv.lib.maintainers; {
+    maintainers = [ ironpinguin ];
+  };
+
+  nodes = {
+
+    server =
+      { config, pkgs, ... }:
+      { virtualisation.memorySize = 2048;
+
+        services.nexus.enable = true;
+
+        users.extraUsers.nexus.extraGroups = [ "users" ];
+      };
+  };
+
+  testScript = ''
+    startAll;
+
+    $server->waitForUnit("nexus");
+
+    print $server->execute("sudo -u nexus groups");
+    $server->mustSucceed("sudo -u nexus groups | grep nexus | grep users");
+
+    $server->waitForOpenPort(8081);
+  '';
+})