lol

nixos/photoprism: add test

+24
+1
nixos/tests/all-tests.nix
··· 513 513 pgjwt = handleTest ./pgjwt.nix {}; 514 514 pgmanage = handleTest ./pgmanage.nix {}; 515 515 phosh = handleTest ./phosh.nix {}; 516 + photoprism = handleTest ./photoprism.nix {}; 516 517 php = handleTest ./php {}; 517 518 php80 = handleTest ./php { php = pkgs.php80; }; 518 519 php81 = handleTest ./php { php = pkgs.php81; };
+23
nixos/tests/photoprism.nix
··· 1 + import ./make-test-python.nix ({ lib, pkgs, ... }: { 2 + name = "photoprism"; 3 + meta.maintainers = with lib.maintainers; [ stunkymonkey ]; 4 + 5 + nodes.machine = { pkgs, ... }: { 6 + services.photoprism = { 7 + enable = true; 8 + port = 8080; 9 + originalsPath = "/media/photos/"; 10 + passwordFile = pkgs.writeText "password" "secret"; 11 + }; 12 + environment.extraInit = '' 13 + mkdir -p /media/photos 14 + ''; 15 + }; 16 + 17 + testScript = '' 18 + machine.wait_for_unit("multi-user.target") 19 + machine.wait_for_open_port(8080) 20 + response = machine.succeed("curl -vvv -s -H 'Host: photoprism' http://127.0.0.1:8080/library/login") 21 + assert '<title>PhotoPrism</title>' in response, "Login page didn't load successfully" 22 + ''; 23 + })