sabnzbd: add simple test

This commit is contained in:
Johannes Schleifenbaum 2021-09-21 13:38:22 +02:00 committed by Bjørn Forsman
parent 12efd19b16
commit 9f45c18515
3 changed files with 28 additions and 0 deletions

View File

@ -408,6 +408,7 @@ in
rss2email = handleTest ./rss2email.nix {};
rsyslogd = handleTest ./rsyslogd.nix {};
rxe = handleTest ./rxe.nix {};
sabnzbd = handleTest ./sabnzbd.nix {};
samba = handleTest ./samba.nix {};
samba-wsdd = handleTest ./samba-wsdd.nix {};
sanoid = handleTest ./sanoid.nix {};

22
nixos/tests/sabnzbd.nix Normal file
View File

@ -0,0 +1,22 @@
import ./make-test-python.nix ({ pkgs, lib, ... }: {
name = "sabnzbd";
meta = with pkgs.lib; {
maintainers = with maintainers; [ jojosch ];
};
machine = { pkgs, ... }: {
services.sabnzbd = {
enable = true;
};
# unrar is unfree
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "unrar" ];
};
testScript = ''
machine.wait_for_unit("sabnzbd.service")
machine.wait_until_succeeds(
"curl --fail -L http://localhost:8080/"
)
'';
})

View File

@ -6,6 +6,7 @@
, unrar
, p7zip
, makeWrapper
, nixosTests
}:
let
@ -48,6 +49,10 @@ in stdenv.mkDerivation rec {
runHook postInstall
'';
passthru.tests = {
smoke-test = nixosTests.sabnzbd;
};
meta = with lib; {
description = "Usenet NZB downloader, par2 repairer and auto extracting server";
homepage = "https://sabnzbd.org";