From 7c8f7bc948a2a2dd1a14ac99c8b20923b500d675 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Mon, 1 Jul 2024 20:46:05 +0200 Subject: [PATCH] nixos/tests/freshrss: test extensions --- nixos/tests/all-tests.nix | 1 + nixos/tests/freshrss-extensions.nix | 19 +++++++++++++++++++ pkgs/servers/web-apps/freshrss/default.nix | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 nixos/tests/freshrss-extensions.nix diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index d16b747bfa95..3989ab5956fa 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -337,6 +337,7 @@ in { freenet = handleTest ./freenet.nix {}; freeswitch = handleTest ./freeswitch.nix {}; freetube = discoverTests (import ./freetube.nix); + freshrss-extensions = handleTest ./freshrss-extensions.nix {}; freshrss-sqlite = handleTest ./freshrss-sqlite.nix {}; freshrss-pgsql = handleTest ./freshrss-pgsql.nix {}; freshrss-http-auth = handleTest ./freshrss-http-auth.nix {}; diff --git a/nixos/tests/freshrss-extensions.nix b/nixos/tests/freshrss-extensions.nix new file mode 100644 index 000000000000..f3e893b3b5a8 --- /dev/null +++ b/nixos/tests/freshrss-extensions.nix @@ -0,0 +1,19 @@ +import ./make-test-python.nix ({ lib, pkgs, ... }: { + name = "freshrss"; + + nodes.machine = { pkgs, ... }: { + services.freshrss = { + enable = true; + baseUrl = "http://localhost"; + authType = "none"; + extensions = [ pkgs.freshrss-extensions.youtube ]; + }; + }; + + testScript = '' + machine.wait_for_unit("multi-user.target") + machine.wait_for_open_port(80) + response = machine.succeed("curl -vvv -s http://127.0.0.1:80/i/?c=extension") + assert 'YouTube Video Feed' in response, "Extension not present in extensions page." + ''; +}) diff --git a/pkgs/servers/web-apps/freshrss/default.nix b/pkgs/servers/web-apps/freshrss/default.nix index d9f9726e034f..78c73719b481 100644 --- a/pkgs/servers/web-apps/freshrss/default.nix +++ b/pkgs/servers/web-apps/freshrss/default.nix @@ -41,7 +41,7 @@ stdenvNoCC.mkDerivation rec { ''; passthru.tests = { - inherit (nixosTests) freshrss-sqlite freshrss-pgsql freshrss-http-auth freshrss-none-auth; + inherit (nixosTests) freshrss-sqlite freshrss-pgsql freshrss-http-auth freshrss-none-auth freshrss-extensions; }; meta = with lib; {