lol

nixos/pingvin-share: add nixos test

RatCornu 712a04c6 924437f5

+34 -17
+1
nixos/tests/all-tests.nix
··· 763 763 php83 = handleTest ./php { php = pkgs.php83; }; 764 764 phylactery = handleTest ./web-apps/phylactery.nix {}; 765 765 pict-rs = handleTest ./pict-rs.nix {}; 766 + pingvin-share = handleTest ./pingvin-share.nix {} ; 766 767 pinnwand = handleTest ./pinnwand.nix {}; 767 768 plantuml-server = handleTest ./plantuml-server.nix {}; 768 769 plasma-bigscreen = handleTest ./plasma-bigscreen.nix {};
+23 -17
nixos/tests/pingvin-share.nix
··· 1 - import ./make-test-python.nix ({ lib, pkgs, ... }: { 2 - name = "pingvin-share"; 3 - meta.maintainers = with lib.maintainers; [ ratcornu ]; 1 + import ./make-test-python.nix ( 2 + { lib, ... }: 3 + { 4 + name = "pingvin-share"; 5 + meta.maintainers = with lib.maintainers; [ ratcornu ]; 4 6 5 - nodes.machine = { pkgs, ... }: { 6 - services.pingvin-share = { 7 - enable = true; 7 + nodes.machine = 8 + { ... }: 9 + { 10 + services.pingvin-share = { 11 + enable = true; 8 12 9 - backend.port = 9010; 10 - frontend.port = 9011; 11 - }; 12 - }; 13 + backend.port = 9010; 14 + frontend.port = 9011; 15 + }; 16 + }; 13 17 14 - testScript = '' 15 - machine.wait_for_unit("pingvin-share-frontend.service") 16 - machine.wait_for_open_port(9011) 17 - machine.succeed("curl --fail http://127.0.0.1:9010/") 18 - machine.succeed("curl --fail http://127.0.0.1:9011/") 19 - ''; 20 - }) 18 + testScript = '' 19 + machine.wait_for_unit("pingvin-share-frontend.service") 20 + machine.wait_for_open_port(9010) 21 + machine.wait_for_open_port(9011) 22 + machine.succeed("curl --fail http://127.0.0.1:9010/api/configs") 23 + machine.succeed("curl --fail http://127.0.0.1:9011/") 24 + ''; 25 + } 26 + )
+5
pkgs/servers/pingvin-share/backend.nix
··· 6 6 nodePackages, 7 7 src, 8 8 version, 9 + nixosTests, 9 10 }: 10 11 11 12 buildNpmPackage { ··· 33 34 npmDepsHash = "sha256-btjvX+2krSc0/bJqeLcVTqHBVWqiTFipp3MidO9wApY="; 34 35 makeCacheWritable = true; 35 36 npmFlags = [ "--legacy-peer-deps" ]; 37 + 38 + passthru.tests = { 39 + pingvin-share = nixosTests.pingvin-share; 40 + }; 36 41 37 42 meta = with lib; { 38 43 description = "Backend of pingvin-share, a self-hosted file sharing platform";
+5
pkgs/servers/pingvin-share/frontend.nix
··· 5 5 pkg-config, 6 6 src, 7 7 version, 8 + nixosTests, 8 9 }: 9 10 10 11 buildNpmPackage { ··· 25 26 npmDepsHash = "sha256-66CUVLbq2XdOQAr69DcvxTMvOgSR/RTKPaq80JG+8dg="; 26 27 makeCacheWritable = true; 27 28 npmFlags = [ "--legacy-peer-deps" ]; 29 + 30 + passthru.tests = { 31 + pingvin-share = nixosTests.pingvin-share; 32 + }; 28 33 29 34 meta = with lib; { 30 35 description = "Frontend of pingvin-share, a self-hosted file sharing platform";