From 8be2345baf4ae0ba6681061ec0766e83dcac6282 Mon Sep 17 00:00:00 2001 From: Elis Hirwing Date: Thu, 24 Jan 2019 23:08:16 +0100 Subject: [PATCH] nixos/sonarr: Add test for sonarr to ensure startup --- nixos/tests/all-tests.nix | 1 + nixos/tests/sonarr.nix | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 nixos/tests/sonarr.nix diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 8c2df2435a79..7555fabf858e 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -194,6 +194,7 @@ in smokeping = handleTest ./smokeping.nix {}; snapper = handleTest ./snapper.nix {}; solr = handleTest ./solr.nix {}; + sonarr = handleTest ./sonarr.nix {}; strongswan-swanctl = handleTest ./strongswan-swanctl.nix {}; sudo = handleTest ./sudo.nix {}; switchTest = handleTest ./switch-test.nix {}; diff --git a/nixos/tests/sonarr.nix b/nixos/tests/sonarr.nix new file mode 100644 index 000000000000..3d5c3b19b6ea --- /dev/null +++ b/nixos/tests/sonarr.nix @@ -0,0 +1,18 @@ +import ./make-test.nix ({ lib, ... }: + +with lib; + +rec { + name = "sonarr"; + meta.maintainers = with maintainers; [ etu ]; + + nodes.machine = + { pkgs, ... }: + { services.sonarr.enable = true; }; + + testScript = '' + $machine->waitForUnit('sonarr.service'); + $machine->waitForOpenPort('8989'); + $machine->succeed("curl --fail http://localhost:8989/"); + ''; +})