mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 03:23:29 +03:00
parent
ceb8b4a5f9
commit
0aa6ecb083
2 changed files with 37 additions and 39 deletions
|
@ -274,7 +274,7 @@ in
|
||||||
cadvisor = handleTestOn [ "x86_64-linux" ] ./cadvisor.nix { };
|
cadvisor = handleTestOn [ "x86_64-linux" ] ./cadvisor.nix { };
|
||||||
cage = handleTest ./cage.nix { };
|
cage = handleTest ./cage.nix { };
|
||||||
cagebreak = handleTest ./cagebreak.nix { };
|
cagebreak = handleTest ./cagebreak.nix { };
|
||||||
calibre-web = handleTest ./calibre-web.nix { };
|
calibre-web = runTest ./calibre-web.nix;
|
||||||
calibre-server = handleTest ./calibre-server.nix { };
|
calibre-server = handleTest ./calibre-server.nix { };
|
||||||
canaille = handleTest ./canaille.nix { };
|
canaille = handleTest ./canaille.nix { };
|
||||||
castopod = handleTest ./castopod.nix { };
|
castopod = handleTest ./castopod.nix { };
|
||||||
|
|
|
@ -1,44 +1,42 @@
|
||||||
import ./make-test-python.nix (
|
{ lib, ... }:
|
||||||
{ pkgs, lib, ... }:
|
|
||||||
|
|
||||||
let
|
let
|
||||||
port = 3142;
|
port = 3142;
|
||||||
defaultPort = 8083;
|
defaultPort = 8083;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
name = "calibre-web";
|
name = "calibre-web";
|
||||||
meta.maintainers = with lib.maintainers; [ pborzenkov ];
|
meta.maintainers = with lib.maintainers; [ pborzenkov ];
|
||||||
|
|
||||||
nodes = {
|
nodes = {
|
||||||
customized =
|
customized =
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
services.calibre-web = {
|
services.calibre-web = {
|
||||||
enable = true;
|
enable = true;
|
||||||
listen.port = port;
|
listen.port = port;
|
||||||
options = {
|
options = {
|
||||||
calibreLibrary = "/tmp/books";
|
calibreLibrary = "/tmp/books";
|
||||||
reverseProxyAuth = {
|
reverseProxyAuth = {
|
||||||
enable = true;
|
enable = true;
|
||||||
header = "X-User";
|
header = "X-User";
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
environment.systemPackages = [ pkgs.calibre ];
|
|
||||||
};
|
};
|
||||||
};
|
environment.systemPackages = [ pkgs.calibre ];
|
||||||
testScript = ''
|
};
|
||||||
start_all()
|
};
|
||||||
|
testScript = ''
|
||||||
|
start_all()
|
||||||
|
|
||||||
customized.succeed(
|
customized.succeed(
|
||||||
"mkdir /tmp/books && calibredb --library-path /tmp/books add -e --title test-book"
|
"mkdir /tmp/books && calibredb --library-path /tmp/books add -e --title test-book"
|
||||||
)
|
)
|
||||||
customized.succeed("systemctl restart calibre-web")
|
customized.succeed("systemctl restart calibre-web")
|
||||||
customized.wait_for_unit("calibre-web.service")
|
customized.wait_for_unit("calibre-web.service")
|
||||||
customized.wait_for_open_port(${toString port})
|
customized.wait_for_open_port(${toString port})
|
||||||
customized.succeed(
|
customized.succeed(
|
||||||
"curl --fail -H X-User:admin 'http://localhost:${toString port}' | grep test-book"
|
"curl --fail -H X-User:admin 'http://localhost:${toString port}' | grep test-book"
|
||||||
)
|
)
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
)
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue