From b1d55f037ed12a831cb9755f8d871320cbe7ea71 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 13 Mar 2025 23:50:51 +0100 Subject: [PATCH] nixosTests.autobrr: migrate to runTest Part Of #386873 --- nixos/tests/all-tests.nix | 2 +- nixos/tests/autobrr.nix | 40 +++++++++++++++++++-------------------- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 8612b97d66ff..1f865782bf9c 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -186,7 +186,7 @@ in { auth-mysql = runTest ./auth-mysql.nix; authelia = runTest ./authelia.nix; auto-cpufreq = runTest ./auto-cpufreq.nix; - autobrr = handleTest ./autobrr.nix {}; + autobrr = runTest ./autobrr.nix; avahi = handleTest ./avahi.nix {}; avahi-with-resolved = handleTest ./avahi.nix { networkd = true; }; ayatana-indicators = runTest ./ayatana-indicators.nix; diff --git a/nixos/tests/autobrr.nix b/nixos/tests/autobrr.nix index f73f7fbb0d4a..c6b820057272 100644 --- a/nixos/tests/autobrr.nix +++ b/nixos/tests/autobrr.nix @@ -1,25 +1,23 @@ -import ./make-test-python.nix ( - { lib, ... }: +{ lib, ... }: - { - name = "autobrr"; - meta.maintainers = with lib.maintainers; [ av-gal ]; +{ + name = "autobrr"; + meta.maintainers = with lib.maintainers; [ av-gal ]; - nodes.machine = - { pkgs, ... }: - { - services.autobrr = { - enable = true; - # We create this secret in the Nix store (making it readable by everyone). - # DO NOT DO THIS OUTSIDE OF TESTS!! - secretFile = pkgs.writeText "session_secret" "not-secret"; - }; + nodes.machine = + { pkgs, ... }: + { + services.autobrr = { + enable = true; + # We create this secret in the Nix store (making it readable by everyone). + # DO NOT DO THIS OUTSIDE OF TESTS!! + secretFile = pkgs.writeText "session_secret" "not-secret"; }; + }; - testScript = '' - machine.wait_for_unit("autobrr.service") - machine.wait_for_open_port(7474) - machine.succeed("curl --fail http://localhost:7474/") - ''; - } -) + testScript = '' + machine.wait_for_unit("autobrr.service") + machine.wait_for_open_port(7474) + machine.succeed("curl --fail http://localhost:7474/") + ''; +}