nixos/suwayomi-server: add nixos tests
This commit is contained in:
parent
4133bb1bb0
commit
279057b779
|
@ -808,6 +808,7 @@ in {
|
||||||
stunnel = handleTest ./stunnel.nix {};
|
stunnel = handleTest ./stunnel.nix {};
|
||||||
sudo = handleTest ./sudo.nix {};
|
sudo = handleTest ./sudo.nix {};
|
||||||
sudo-rs = handleTest ./sudo-rs.nix {};
|
sudo-rs = handleTest ./sudo-rs.nix {};
|
||||||
|
suwayomi-server = handleTest ./suwayomi-server.nix {};
|
||||||
swap-file-btrfs = handleTest ./swap-file-btrfs.nix {};
|
swap-file-btrfs = handleTest ./swap-file-btrfs.nix {};
|
||||||
swap-partition = handleTest ./swap-partition.nix {};
|
swap-partition = handleTest ./swap-partition.nix {};
|
||||||
swap-random-encryption = handleTest ./swap-random-encryption.nix {};
|
swap-random-encryption = handleTest ./swap-random-encryption.nix {};
|
||||||
|
|
46
nixos/tests/suwayomi-server.nix
Normal file
46
nixos/tests/suwayomi-server.nix
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
{ system ? builtins.currentSystem
|
||||||
|
, pkgs
|
||||||
|
, lib ? pkgs.lib
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
inherit (import ../lib/testing-python.nix { inherit system pkgs; }) makeTest;
|
||||||
|
inherit (lib) recursiveUpdate;
|
||||||
|
|
||||||
|
baseTestConfig = {
|
||||||
|
meta.maintainers = with lib.maintainers; [ ratcornu ];
|
||||||
|
nodes.machine = { pkgs, ... }: {
|
||||||
|
services.suwayomi-server = {
|
||||||
|
enable = true;
|
||||||
|
settings.server.port = 1234;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
testScript = ''
|
||||||
|
machine.wait_for_unit("suwayomi-server.service")
|
||||||
|
machine.wait_for_open_port(1234)
|
||||||
|
machine.succeed("curl --fail http://localhost:1234/")
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
without-auth = makeTest (recursiveUpdate baseTestConfig {
|
||||||
|
name = "suwayomi-server-without-auth";
|
||||||
|
});
|
||||||
|
|
||||||
|
with-auth = makeTest (recursiveUpdate baseTestConfig {
|
||||||
|
name = "suwayomi-server-with-auth";
|
||||||
|
|
||||||
|
nodes.machine = { pkgs, ... }: {
|
||||||
|
services.suwayomi-server = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
settings.server = {
|
||||||
|
port = 1234;
|
||||||
|
basicAuthEnabled = true;
|
||||||
|
basicAuthUsername = "alice";
|
||||||
|
basicAuthPasswordFile = pkgs.writeText "snakeoil-pass.txt" "pass";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
|
@ -3,6 +3,7 @@
|
||||||
, fetchurl
|
, fetchurl
|
||||||
, makeWrapper
|
, makeWrapper
|
||||||
, jdk17_headless
|
, jdk17_headless
|
||||||
|
, nixosTests
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
@ -34,6 +35,11 @@ stdenvNoCC.mkDerivation (finalAttrs: {
|
||||||
runHook postBuild
|
runHook postBuild
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
passthru.tests = {
|
||||||
|
suwayomi-server-with-auth = nixosTests.suwayomi-server.with-auth;
|
||||||
|
suwayomi-server-without-auth = nixosTests.suwayomi-server.without-auth;
|
||||||
|
};
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "A free and open source manga reader server that runs extensions built for Tachiyomi.";
|
description = "A free and open source manga reader server that runs extensions built for Tachiyomi.";
|
||||||
longDescription = ''
|
longDescription = ''
|
||||||
|
|
Loading…
Reference in New Issue
Block a user