1{ system ? builtins.currentSystem
2, pkgs
3, lib ? pkgs.lib
4}:
5let
6 inherit (import ../lib/testing-python.nix { inherit system pkgs; }) makeTest;
7 inherit (lib) recursiveUpdate;
8
9 baseTestConfig = {
10 meta.maintainers = with lib.maintainers; [ ratcornu ];
11 nodes.machine = { pkgs, ... }: {
12 services.suwayomi-server = {
13 enable = true;
14 settings.server.port = 1234;
15 };
16 };
17 testScript = ''
18 machine.wait_for_unit("suwayomi-server.service")
19 machine.wait_for_open_port(1234)
20 machine.succeed("curl --fail http://localhost:1234/")
21 '';
22 };
23in
24
25{
26 without-auth = makeTest (recursiveUpdate baseTestConfig {
27 name = "suwayomi-server-without-auth";
28 });
29
30 with-auth = makeTest (recursiveUpdate baseTestConfig {
31 name = "suwayomi-server-with-auth";
32
33 nodes.machine = { pkgs, ... }: {
34 services.suwayomi-server = {
35 enable = true;
36
37 settings.server = {
38 port = 1234;
39 basicAuthEnabled = true;
40 basicAuthUsername = "alice";
41 basicAuthPasswordFile = pkgs.writeText "snakeoil-pass.txt" "pass";
42 };
43 };
44 };
45 });
46}