From f068ec77eef04375f1af28a81dd8535c38c0c735 Mon Sep 17 00:00:00 2001 From: Diogo Correia Date: Sat, 18 Jul 2026 14:48:59 +0100 Subject: [PATCH] nixos/tests/flaresolverr: fetch local webpage This ensures that the browser is started and working. (cherry picked from commit bd3f7f442916a6d61fe13cea0fb85946f60e1a2d) --- nixos/tests/flaresolverr.nix | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/nixos/tests/flaresolverr.nix b/nixos/tests/flaresolverr.nix index 19b95565bcb8..2b24951d5ed3 100644 --- a/nixos/tests/flaresolverr.nix +++ b/nixos/tests/flaresolverr.nix @@ -10,11 +10,30 @@ enable = true; port = 8888; }; + + services.nginx = { + enable = true; + virtualHosts.localhost = { + locations."/" = { + return = "200 'hello world'"; + extraConfig = '' + default_type text/plain; + ''; + }; + }; + }; }; - testScript = '' + testScript = /* python */ '' + import json + machine.wait_for_unit("flaresolverr.service") machine.wait_for_open_port(8888) machine.succeed("curl --fail http://localhost:8888/") + + res = machine.succeed("""curl --fail http://localhost:8888/v1 -X POST --json '{ "cmd": "request.get", "url": "http://localhost/", "maxTimeout": 10000 }'""") + res = json.loads(res) + response = res["solution"]["response"] + assert "hello world" in response, f"Could not find 'hello world' in response: {response}" ''; }