about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorBruno BELANYI <bruno@belanyi.fr>2021-04-14 17:15:41 +0000
committerBruno BELANYI <bruno@belanyi.fr>2021-04-15 20:57:22 +0000
commit1144486f3a330c1e3a005022246db4eac194225d (patch)
tree6c863b3d0a2769ecf46b609dfe9becef2a5c4aa0 /nixos
parentf1b36d19fda8678c796f0627e2bd2723171ea0f4 (diff)
downloadnixlib-1144486f3a330c1e3a005022246db4eac194225d.tar
nixlib-1144486f3a330c1e3a005022246db4eac194225d.tar.gz
nixlib-1144486f3a330c1e3a005022246db4eac194225d.tar.bz2
nixlib-1144486f3a330c1e3a005022246db4eac194225d.tar.lz
nixlib-1144486f3a330c1e3a005022246db4eac194225d.tar.xz
nixlib-1144486f3a330c1e3a005022246db4eac194225d.tar.zst
nixlib-1144486f3a330c1e3a005022246db4eac194225d.zip
nixos/tests/podgrab: init
Diffstat (limited to 'nixos')
-rw-r--r--nixos/tests/all-tests.nix1
-rw-r--r--nixos/tests/podgrab.nix34
2 files changed, 35 insertions, 0 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index 47384cf5a8a2..1a6df8a181c7 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -321,6 +321,7 @@ in
   pleroma = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./pleroma.nix {};
   plikd = handleTest ./plikd.nix {};
   plotinus = handleTest ./plotinus.nix {};
+  podgrab = handleTest ./podgrab.nix {};
   podman = handleTestOn ["x86_64-linux"] ./podman.nix {};
   pomerium = handleTestOn ["x86_64-linux"] ./pomerium.nix {};
   postfix = handleTest ./postfix.nix {};
diff --git a/nixos/tests/podgrab.nix b/nixos/tests/podgrab.nix
new file mode 100644
index 000000000000..e927e25fea56
--- /dev/null
+++ b/nixos/tests/podgrab.nix
@@ -0,0 +1,34 @@
+let
+  defaultPort = 8080;
+  customPort = 4242;
+in
+import ./make-test-python.nix ({ pkgs, ... }: {
+  name = "podgrab";
+
+  nodes = {
+    default = { ... }: {
+      services.podgrab.enable = true;
+    };
+
+    customized = { ... }: {
+      services.podgrab = {
+        enable = true;
+        port = customPort;
+      };
+    };
+  };
+
+  testScript = ''
+    start_all()
+
+    default.wait_for_unit("podgrab")
+    default.wait_for_open_port("${toString defaultPort}")
+    default.succeed("curl --fail http://localhost:${toString defaultPort}")
+
+    customized.wait_for_unit("podgrab")
+    customized.wait_for_open_port("${toString customPort}")
+    customized.succeed("curl --fail http://localhost:${toString customPort}")
+  '';
+
+  meta.maintainers = with pkgs.lib.maintainers; [ ambroisie ];
+})