nixosTests.autobrr: migrate to runTest

Part Of #386873
This commit is contained in:
Martin Weinelt 2025-03-13 23:50:51 +01:00
parent 48dda151d3
commit b1d55f037e
No known key found for this signature in database
GPG key ID: 87C1E9888F856759
2 changed files with 20 additions and 22 deletions

View file

@ -186,7 +186,7 @@ in {
auth-mysql = runTest ./auth-mysql.nix; auth-mysql = runTest ./auth-mysql.nix;
authelia = runTest ./authelia.nix; authelia = runTest ./authelia.nix;
auto-cpufreq = runTest ./auto-cpufreq.nix; auto-cpufreq = runTest ./auto-cpufreq.nix;
autobrr = handleTest ./autobrr.nix {}; autobrr = runTest ./autobrr.nix;
avahi = handleTest ./avahi.nix {}; avahi = handleTest ./avahi.nix {};
avahi-with-resolved = handleTest ./avahi.nix { networkd = true; }; avahi-with-resolved = handleTest ./avahi.nix { networkd = true; };
ayatana-indicators = runTest ./ayatana-indicators.nix; ayatana-indicators = runTest ./ayatana-indicators.nix;

View file

@ -1,25 +1,23 @@
import ./make-test-python.nix ( { lib, ... }:
{ lib, ... }:
{ {
name = "autobrr"; name = "autobrr";
meta.maintainers = with lib.maintainers; [ av-gal ]; meta.maintainers = with lib.maintainers; [ av-gal ];
nodes.machine = nodes.machine =
{ pkgs, ... }: { pkgs, ... }:
{ {
services.autobrr = { services.autobrr = {
enable = true; enable = true;
# We create this secret in the Nix store (making it readable by everyone). # We create this secret in the Nix store (making it readable by everyone).
# DO NOT DO THIS OUTSIDE OF TESTS!! # DO NOT DO THIS OUTSIDE OF TESTS!!
secretFile = pkgs.writeText "session_secret" "not-secret"; secretFile = pkgs.writeText "session_secret" "not-secret";
};
}; };
};
testScript = '' testScript = ''
machine.wait_for_unit("autobrr.service") machine.wait_for_unit("autobrr.service")
machine.wait_for_open_port(7474) machine.wait_for_open_port(7474)
machine.succeed("curl --fail http://localhost:7474/") machine.succeed("curl --fail http://localhost:7474/")
''; '';
} }
)