From 322ba968e168cd5aa2429672a7ceb200cbae4e8e Mon Sep 17 00:00:00 2001 From: Sebastian Kowalak Date: Mon, 30 Jun 2025 17:18:05 +0200 Subject: [PATCH] paisa: add nixos-tests --- nixos/tests/all-tests.nix | 1 + nixos/tests/paisa.nix | 23 +++++++++++++++++++++++ pkgs/by-name/pa/paisa/package.nix | 5 +++++ 3 files changed, 29 insertions(+) create mode 100644 nixos/tests/paisa.nix diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 95b0e1fab956..eda7bf60b7a6 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -1049,6 +1049,7 @@ in overlayfs = runTest ./overlayfs.nix; pacemaker = runTest ./pacemaker.nix; packagekit = runTest ./packagekit.nix; + paisa = runTest ./paisa.nix; pam-file-contents = runTest ./pam/pam-file-contents.nix; pam-oath-login = runTest ./pam/pam-oath-login.nix; pam-u2f = runTest ./pam/pam-u2f.nix; diff --git a/nixos/tests/paisa.nix b/nixos/tests/paisa.nix new file mode 100644 index 000000000000..a1ffb02a1d5f --- /dev/null +++ b/nixos/tests/paisa.nix @@ -0,0 +1,23 @@ +{ ... }: +{ + name = "paisa"; + nodes.machine = + { pkgs, ... }: + { + systemd.services.paisa = { + description = "Paisa"; + wantedBy = [ "multi-user.target" ]; + serviceConfig.ExecStart = "${pkgs.paisa}/bin/paisa serve"; + }; + }; + testScript = '' + start_all() + + machine.systemctl("start network-online.target") + machine.wait_for_unit("network-online.target") + machine.wait_for_unit("paisa.service") + machine.wait_for_open_port(7500) + + machine.succeed("curl --location --fail http://localhost:7500") + ''; +} diff --git a/pkgs/by-name/pa/paisa/package.nix b/pkgs/by-name/pa/paisa/package.nix index a05727c833e6..cfb7c438c935 100644 --- a/pkgs/by-name/pa/paisa/package.nix +++ b/pkgs/by-name/pa/paisa/package.nix @@ -16,6 +16,7 @@ librsvg, pango, pixman, + nixosTests, }: let @@ -83,6 +84,10 @@ buildGoModule (finalAttrs: { ]; versionCheckProgramArg = "version"; + passthru.tests = { + inherit (nixosTests) paisa; + }; + preBuild = '' cp -r ${finalAttrs.frontend}/web/static ./web '';