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