python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / nixos / tests / miniflux.nix
blobd905aea048a3ae37a33e13aab979082dd4743b13
1 import ./make-test-python.nix ({ pkgs, lib, ... }:
3 let
4   port = 3142;
5   username = "alice";
6   password = "correcthorsebatterystaple";
7   defaultPort = 8080;
8   defaultUsername = "admin";
9   defaultPassword = "password";
10   adminCredentialsFile = pkgs.writeText "admin-credentials" ''
11             ADMIN_USERNAME=${defaultUsername}
12             ADMIN_PASSWORD=${defaultPassword}
13           '';
14   customAdminCredentialsFile = pkgs.writeText "admin-credentials" ''
15             ADMIN_USERNAME=${username}
16             ADMIN_PASSWORD=${password}
17           '';
20 with lib;
22   name = "miniflux";
23   meta.maintainers = with pkgs.lib.maintainers; [ ];
25   nodes = {
26     default =
27       { ... }:
28       {
29         services.miniflux = {
30           enable = true;
31           inherit adminCredentialsFile;
32         };
33       };
35     withoutSudo =
36       { ... }:
37       {
38         services.miniflux = {
39           enable = true;
40           inherit adminCredentialsFile;
41         };
42         security.sudo.enable = false;
43       };
45     customized =
46       { ... }:
47       {
48         services.miniflux = {
49           enable = true;
50           config = {
51             CLEANUP_FREQUENCY = "48";
52             LISTEN_ADDR = "localhost:${toString port}";
53           };
54           adminCredentialsFile = customAdminCredentialsFile;
55         };
56       };
57   };
58   testScript = ''
59     start_all()
61     default.wait_for_unit("miniflux.service")
62     default.wait_for_open_port(${toString defaultPort})
63     default.succeed("curl --fail 'http://localhost:${toString defaultPort}/healthcheck' | grep OK")
64     default.succeed(
65         "curl 'http://localhost:${toString defaultPort}/v1/me' -u '${defaultUsername}:${defaultPassword}' -H Content-Type:application/json | grep '\"is_admin\":true'"
66     )
68     withoutSudo.wait_for_unit("miniflux.service")
69     withoutSudo.wait_for_open_port(${toString defaultPort})
70     withoutSudo.succeed("curl --fail 'http://localhost:${toString defaultPort}/healthcheck' | grep OK")
71     withoutSudo.succeed(
72         "curl 'http://localhost:${toString defaultPort}/v1/me' -u '${defaultUsername}:${defaultPassword}' -H Content-Type:application/json | grep '\"is_admin\":true'"
73     )
75     customized.wait_for_unit("miniflux.service")
76     customized.wait_for_open_port(${toString port})
77     customized.succeed("curl --fail 'http://localhost:${toString port}/healthcheck' | grep OK")
78     customized.succeed(
79         "curl 'http://localhost:${toString port}/v1/me' -u '${username}:${password}' -H Content-Type:application/json | grep '\"is_admin\":true'"
80     )
81   '';