about summary refs log tree commit diff
path: root/nixpkgs/nixos/tests/redlib.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/nixos/tests/redlib.nix')
-rw-r--r--nixpkgs/nixos/tests/redlib.nix20
1 files changed, 20 insertions, 0 deletions
diff --git a/nixpkgs/nixos/tests/redlib.nix b/nixpkgs/nixos/tests/redlib.nix
new file mode 100644
index 000000000000..e4bde25e30a6
--- /dev/null
+++ b/nixpkgs/nixos/tests/redlib.nix
@@ -0,0 +1,20 @@
+import ./make-test-python.nix ({ lib, pkgs, ... }: {
+  name = "redlib";
+  meta.maintainers = with lib.maintainers; [ soispha ];
+
+  nodes.machine = {
+    services.libreddit = {
+      package = pkgs.redlib;
+      enable = true;
+      # Test CAP_NET_BIND_SERVICE
+      port = 80;
+    };
+  };
+
+  testScript = ''
+    machine.wait_for_unit("libreddit.service")
+    machine.wait_for_open_port(80)
+    # Query a page that does not require Internet access
+    machine.succeed("curl --fail http://localhost:80/settings")
+  '';
+})