1import ./make-test-python.nix ({ pkgs, lib, ... }: {
2 name = "lanraragi";
3 meta.maintainers = with lib.maintainers; [ tomasajt ];
4
5 nodes = {
6 machine1 = { pkgs, ... }: {
7 services.lanraragi.enable = true;
8 };
9 machine2 = { pkgs, ... }: {
10 services.lanraragi = {
11 enable = true;
12 passwordFile = pkgs.writeText "lrr-test-pass" ''
13 Ultra-secure-p@ssword-"with-spec1al\chars
14 '';
15 port = 4000;
16 redis = {
17 port = 4001;
18 passwordFile = pkgs.writeText "redis-lrr-test-pass" ''
19 123-redis-PASS
20 '';
21 };
22 };
23 };
24 };
25
26 testScript = ''
27 start_all()
28
29 machine1.wait_for_unit("lanraragi.service")
30 machine1.wait_until_succeeds("curl -f localhost:3000")
31 machine1.succeed("[ $(curl -o /dev/null -X post 'http://localhost:3000/login' --data-raw 'password=kamimamita' -w '%{http_code}') -eq 302 ]")
32
33 machine2.wait_for_unit("lanraragi.service")
34 machine2.wait_until_succeeds("curl -f localhost:4000")
35 machine2.succeed("[ $(curl -o /dev/null -X post 'http://localhost:4000/login' --data-raw 'password=Ultra-secure-p@ssword-\"with-spec1al\\chars' -w '%{http_code}') -eq 302 ]")
36 '';
37})
38