about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2024-03-01 21:27:18 +0100
committerSoispha <soispha@vhack.eu>2024-03-23 17:03:34 +0100
commitbc54360b999bd059634d53a40db882bc969c2935 (patch)
treee5ca2e70a6609ed8208ca520327181ba38539dfe /nixos
parent161bec7296158d38e9192938b1cdf6c99a0ac720 (diff)
nixos/tests: add redlib test using the libreddit module
Diffstat (limited to 'nixos')
-rw-r--r--nixos/tests/redlib.nix20
1 files changed, 20 insertions, 0 deletions
diff --git a/nixos/tests/redlib.nix b/nixos/tests/redlib.nix
new file mode 100644
index 0000000000000..e4bde25e30a63
--- /dev/null
+++ b/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")
+  '';
+})