mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-21 22:43:01 +00:00
nixos/suwayomi-server: add nixos tests
This commit is contained in:
parent
4133bb1bb0
commit
279057b779
@ -808,6 +808,7 @@ in {
|
||||
stunnel = handleTest ./stunnel.nix {};
|
||||
sudo = handleTest ./sudo.nix {};
|
||||
sudo-rs = handleTest ./sudo-rs.nix {};
|
||||
suwayomi-server = handleTest ./suwayomi-server.nix {};
|
||||
swap-file-btrfs = handleTest ./swap-file-btrfs.nix {};
|
||||
swap-partition = handleTest ./swap-partition.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
|
||||
, makeWrapper
|
||||
, jdk17_headless
|
||||
, nixosTests
|
||||
}:
|
||||
|
||||
let
|
||||
@ -34,6 +35,11 @@ stdenvNoCC.mkDerivation (finalAttrs: {
|
||||
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; {
|
||||
description = "A free and open source manga reader server that runs extensions built for Tachiyomi.";
|
||||
longDescription = ''
|
||||
|
Loading…
Reference in New Issue
Block a user