From 93d9ca0d838e1d48dee7faab7fb6241cc91f2828 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 13 Mar 2025 22:50:36 +0100 Subject: [PATCH] nixosTests.airsonic: migrate to runTest Part Of #386873 --- nixos/tests/airsonic.nix | 52 +++++++++++++++++++-------------------- nixos/tests/all-tests.nix | 2 +- 2 files changed, 26 insertions(+), 28 deletions(-) diff --git a/nixos/tests/airsonic.nix b/nixos/tests/airsonic.nix index d214d5d1e1f7..26e6aa7bfc44 100644 --- a/nixos/tests/airsonic.nix +++ b/nixos/tests/airsonic.nix @@ -1,32 +1,30 @@ -import ./make-test-python.nix ( - { pkgs, ... }: - { - name = "airsonic"; - meta = with pkgs.lib.maintainers; { - maintainers = [ sumnerevans ]; +{ pkgs, ... }: +{ + name = "airsonic"; + meta = with pkgs.lib.maintainers; { + maintainers = [ sumnerevans ]; + }; + + nodes.machine = + { pkgs, ... }: + { + services.airsonic = { + enable = true; + maxMemory = 800; + }; }; - nodes.machine = - { pkgs, ... }: - { - services.airsonic = { - enable = true; - maxMemory = 800; - }; - }; - - testScript = '' - def airsonic_is_up(_) -> bool: - status, _ = machine.execute("curl --fail http://localhost:4040/login") - return status == 0 + testScript = '' + def airsonic_is_up(_) -> bool: + status, _ = machine.execute("curl --fail http://localhost:4040/login") + return status == 0 - machine.start() - machine.wait_for_unit("airsonic.service") - machine.wait_for_open_port(4040) + machine.start() + machine.wait_for_unit("airsonic.service") + machine.wait_for_open_port(4040) - with machine.nested("Waiting for UI to work"): - retry(airsonic_is_up) - ''; - } -) + with machine.nested("Waiting for UI to work"): + retry(airsonic_is_up) + ''; +} diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index d2a1bd8d29d1..97feba7470a8 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -155,7 +155,7 @@ in { agda = runTest ./agda.nix; age-plugin-tpm-decrypt = runTest ./age-plugin-tpm-decrypt.nix; agorakit = runTest ./web-apps/agorakit.nix; - airsonic = handleTest ./airsonic.nix {}; + airsonic = runTest ./airsonic.nix; akkoma = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./akkoma.nix {}; akkoma-confined = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./akkoma.nix { confined = true; }; alice-lg = handleTest ./alice-lg.nix {};