python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / nixos / tests / calibre-web.nix
blob9832d54697872222c499c23e4590b022018d3726
1 import ./make-test-python.nix (
2   { pkgs, lib, ... }:
4     let
5       port = 3142;
6       defaultPort = 8083;
7     in
8       with lib;
9       {
10         name = "calibre-web";
11         meta.maintainers = with pkgs.lib.maintainers; [ pborzenkov ];
13         nodes = {
14           customized = { pkgs, ... }: {
15             services.calibre-web = {
16               enable = true;
17               listen.port = port;
18               options = {
19                 calibreLibrary = "/tmp/books";
20                 reverseProxyAuth = {
21                   enable = true;
22                   header = "X-User";
23                 };
24               };
25             };
26             environment.systemPackages = [ pkgs.calibre ];
27           };
28         };
29         testScript = ''
30           start_all()
32           customized.succeed(
33               "mkdir /tmp/books && calibredb --library-path /tmp/books add -e --title test-book"
34           )
35           customized.succeed("systemctl restart calibre-web")
36           customized.wait_for_unit("calibre-web.service")
37           customized.wait_for_open_port(${toString port})
38           customized.succeed(
39               "curl --fail -H X-User:admin 'http://localhost:${toString port}' | grep test-book"
40           )
41         '';
42       }