From bc54360b999bd059634d53a40db882bc969c2935 Mon Sep 17 00:00:00 2001 From: Soispha Date: Fri, 1 Mar 2024 21:27:18 +0100 Subject: [PATCH] nixos/tests: add redlib test using the libreddit module --- nixos/tests/redlib.nix | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 nixos/tests/redlib.nix diff --git a/nixos/tests/redlib.nix b/nixos/tests/redlib.nix new file mode 100644 index 000000000000..e4bde25e30a6 --- /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") + ''; +})