summary refs log tree commit diff
diff options
context:
space:
mode:
authorThomas <thomas@mcth.fr>2023-05-05 21:02:11 +0200
committerThomas <thomas@mcth.fr>2023-05-11 09:52:43 +0200
commitae31454d41ae6d706f80a9deb3cf5c4d5c89c334 (patch)
treea82a9fb84c17e32764b335c195e88891d4b5e7cc
parent1ed6468c276a295f5a336f126ef695ab25f58acb (diff)
downloadnixpkgs-ae31454d41ae6d706f80a9deb3cf5c4d5c89c334.tar
nixpkgs-ae31454d41ae6d706f80a9deb3cf5c4d5c89c334.tar.gz
nixpkgs-ae31454d41ae6d706f80a9deb3cf5c4d5c89c334.tar.bz2
nixpkgs-ae31454d41ae6d706f80a9deb3cf5c4d5c89c334.tar.lz
nixpkgs-ae31454d41ae6d706f80a9deb3cf5c4d5c89c334.tar.xz
nixpkgs-ae31454d41ae6d706f80a9deb3cf5c4d5c89c334.tar.zst
nixpkgs-ae31454d41ae6d706f80a9deb3cf5c4d5c89c334.zip
nixosTests.tinyproxy: init
-rw-r--r--nixos/tests/all-tests.nix1
-rw-r--r--nixos/tests/tinyproxy.nix20
-rw-r--r--pkgs/tools/networking/tinyproxy/default.nix2
3 files changed, 23 insertions, 0 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index 5ceb39d0be5..17fa3ac1373 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -734,6 +734,7 @@ in {
   timezone = handleTest ./timezone.nix {};
   tinc = handleTest ./tinc {};
   tinydns = handleTest ./tinydns.nix {};
+  tinyproxy = handleTest ./tinyproxy.nix {};
   tinywl = handleTest ./tinywl.nix {};
   tmate-ssh-server = handleTest ./tmate-ssh-server.nix { };
   tomcat = handleTest ./tomcat.nix {};
diff --git a/nixos/tests/tinyproxy.nix b/nixos/tests/tinyproxy.nix
new file mode 100644
index 00000000000..b8448d4c23b
--- /dev/null
+++ b/nixos/tests/tinyproxy.nix
@@ -0,0 +1,20 @@
+import ./make-test-python.nix ({ pkgs, ... }: {
+  name = "tinyproxy";
+
+  nodes.machine = { config, pkgs, ... }: {
+    services.tinyproxy = {
+      enable = true;
+      settings = {
+        Listen = "127.0.0.1";
+        Port = 8080;
+      };
+    };
+  };
+
+  testScript = ''
+    machine.wait_for_unit("tinyproxy.service")
+    machine.wait_for_open_port(8080)
+
+    machine.succeed('curl -s http://localhost:8080 |grep -i tinyproxy')
+  '';
+})
diff --git a/pkgs/tools/networking/tinyproxy/default.nix b/pkgs/tools/networking/tinyproxy/default.nix
index 12c8a0d0447..8778b90b2b0 100644
--- a/pkgs/tools/networking/tinyproxy/default.nix
+++ b/pkgs/tools/networking/tinyproxy/default.nix
@@ -4,6 +4,7 @@
 , fetchpatch
 , autoreconfHook
 , perl
+, nixosTests
 , withDebug ? false
 }:
 
@@ -30,6 +31,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ autoreconfHook perl ];
 
   configureFlags = lib.optionals withDebug [ "--enable-debug" ]; # Enable debugging support code and methods.
+  passthru.tests = { inherit (nixosTests) tinyproxy; };
 
   meta = with lib; {
     homepage = "https://tinyproxy.github.io/";