nixos/pingvin-share: add nixos test

RatCornu 712a04c6 924437f5

Changed files
+34 -17
nixos
pkgs
servers
pingvin-share
+1
nixos/tests/all-tests.nix
···
php83 = handleTest ./php { php = pkgs.php83; };
phylactery = handleTest ./web-apps/phylactery.nix {};
pict-rs = handleTest ./pict-rs.nix {};
+
pingvin-share = handleTest ./pingvin-share.nix {} ;
pinnwand = handleTest ./pinnwand.nix {};
plantuml-server = handleTest ./plantuml-server.nix {};
plasma-bigscreen = handleTest ./plasma-bigscreen.nix {};
+23 -17
nixos/tests/pingvin-share.nix
···
-
import ./make-test-python.nix ({ lib, pkgs, ... }: {
-
name = "pingvin-share";
-
meta.maintainers = with lib.maintainers; [ ratcornu ];
+
import ./make-test-python.nix (
+
{ lib, ... }:
+
{
+
name = "pingvin-share";
+
meta.maintainers = with lib.maintainers; [ ratcornu ];
-
nodes.machine = { pkgs, ... }: {
-
services.pingvin-share = {
-
enable = true;
+
nodes.machine =
+
{ ... }:
+
{
+
services.pingvin-share = {
+
enable = true;
-
backend.port = 9010;
-
frontend.port = 9011;
-
};
-
};
+
backend.port = 9010;
+
frontend.port = 9011;
+
};
+
};
-
testScript = ''
-
machine.wait_for_unit("pingvin-share-frontend.service")
-
machine.wait_for_open_port(9011)
-
machine.succeed("curl --fail http://127.0.0.1:9010/")
-
machine.succeed("curl --fail http://127.0.0.1:9011/")
-
'';
-
})
+
testScript = ''
+
machine.wait_for_unit("pingvin-share-frontend.service")
+
machine.wait_for_open_port(9010)
+
machine.wait_for_open_port(9011)
+
machine.succeed("curl --fail http://127.0.0.1:9010/api/configs")
+
machine.succeed("curl --fail http://127.0.0.1:9011/")
+
'';
+
}
+
)
+5
pkgs/servers/pingvin-share/backend.nix
···
nodePackages,
src,
version,
+
nixosTests,
}:
buildNpmPackage {
···
npmDepsHash = "sha256-btjvX+2krSc0/bJqeLcVTqHBVWqiTFipp3MidO9wApY=";
makeCacheWritable = true;
npmFlags = [ "--legacy-peer-deps" ];
+
+
passthru.tests = {
+
pingvin-share = nixosTests.pingvin-share;
+
};
meta = with lib; {
description = "Backend of pingvin-share, a self-hosted file sharing platform";
+5
pkgs/servers/pingvin-share/frontend.nix
···
pkg-config,
src,
version,
+
nixosTests,
}:
buildNpmPackage {
···
npmDepsHash = "sha256-66CUVLbq2XdOQAr69DcvxTMvOgSR/RTKPaq80JG+8dg=";
makeCacheWritable = true;
npmFlags = [ "--legacy-peer-deps" ];
+
+
passthru.tests = {
+
pingvin-share = nixosTests.pingvin-share;
+
};
meta = with lib; {
description = "Frontend of pingvin-share, a self-hosted file sharing platform";