nixos/tests/podgrab: init
commit1144486f3a330c1e3a005022246db4eac194225d
authorBruno BELANYI <bruno@belanyi.fr>
dateWed 14 Apr 2021, 17:15 (6 years ago)
parentf1b36d1
nixos/tests/all-tests.nix+1
@@ -321,6 +321,7 @@ in
321321 pleroma = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./pleroma.nix {};
322322 plikd = handleTest ./plikd.nix {};
323323 plotinus = handleTest ./plotinus.nix {};
324+ podgrab = handleTest ./podgrab.nix {};
324325 podman = handleTestOn ["x86_64-linux"] ./podman.nix {};
325326 pomerium = handleTestOn ["x86_64-linux"] ./pomerium.nix {};
326327 postfix = handleTest ./postfix.nix {};
nixos/tests/podgrab.nixnew file+34
@@ -0,0 +1,34 @@
1+let
2+ defaultPort = 8080;
3+ customPort = 4242;
4+in
5+import ./make-test-python.nix ({ pkgs, ... }: {
6+ name = "podgrab";
7+
8+ nodes = {
9+ default = { ... }: {
10+ services.podgrab.enable = true;
11+ };
12+
13+ customized = { ... }: {
14+ services.podgrab = {
15+ enable = true;
16+ port = customPort;
17+ };
18+ };
19+ };
20+
21+ testScript = ''
22+ start_all()
23+
24+ default.wait_for_unit("podgrab")
25+ default.wait_for_open_port("${toString defaultPort}")
26+ default.succeed("curl --fail http://localhost:${toString defaultPort}")
27+
28+ customized.wait_for_unit("podgrab")
29+ customized.wait_for_open_port("${toString customPort}")
30+ customized.succeed("curl --fail http://localhost:${toString customPort}")
31+ '';
32+
33+ meta.maintainers = with pkgs.lib.maintainers; [ ambroisie ];
34+})
pkgs/servers/misc/podgrab/default.nix+3−1
@@ -1,4 +1,4 @@
1−{ lib, fetchFromGitHub, buildGoModule }:
1+{ lib, fetchFromGitHub, buildGoModule, nixosTests }:
22
33buildGoModule rec {
44 pname = "podgrab";
@@ -19,6 +19,8 @@ buildGoModule rec {
1919 cp -r $src/webassets $out/share/
2020 '';
2121
22+ passthru.tests = { inherit (nixosTests) podgrab; };
23+
2224 meta = with lib; {
2325 description = "A self-hosted podcast manager to download episodes as soon as they become live";
2426 homepage = "https://github.com/akhilrex/podgrab";