From 1cbd2f94cb8493fd4ee0d70639425ff4068a1be0 Mon Sep 17 00:00:00 2001 From: Luis David Licea Torres Date: Sun, 12 May 2024 17:07:22 -0500 Subject: [PATCH] nixos/tests/localsend: init --- nixos/tests/all-tests.nix | 1 + nixos/tests/localsend.nix | 21 +++++++++++++++++++ .../networking/localsend/default.nix | 6 +++++- 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 nixos/tests/localsend.nix diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index b9a6311eaf35..eab4c40c0b74 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -516,6 +516,7 @@ in { listmonk = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./listmonk.nix {}; litestream = handleTest ./litestream.nix {}; lldap = handleTest ./lldap.nix {}; + localsend = handleTest ./localsend.nix {}; locate = handleTest ./locate.nix {}; login = handleTest ./login.nix {}; logrotate = handleTest ./logrotate.nix {}; diff --git a/nixos/tests/localsend.nix b/nixos/tests/localsend.nix new file mode 100644 index 000000000000..8c0a6ac68190 --- /dev/null +++ b/nixos/tests/localsend.nix @@ -0,0 +1,21 @@ +import ./make-test-python.nix ( + { ... }: + { + name = "localsend"; + + nodes.machine = + { ... }: + { + imports = [ ./common/x11.nix ]; + programs.localsend.enable = true; + }; + + testScript = '' + machine.wait_for_x() + machine.succeed("localsend_app >&2 &") + machine.wait_for_open_port(53317) + machine.wait_for_window("LocalSend", 10) + machine.succeed("netstat --listening --program --tcp | grep -P 'tcp.*53317.*localsend'") + ''; + } +) diff --git a/pkgs/applications/networking/localsend/default.nix b/pkgs/applications/networking/localsend/default.nix index bd681b74eebb..be540d58da81 100644 --- a/pkgs/applications/networking/localsend/default.nix +++ b/pkgs/applications/networking/localsend/default.nix @@ -4,6 +4,7 @@ , fetchFromGitHub , flutter313 , makeDesktopItem +, nixosTests , pkg-config , libayatana-appindicator , undmg @@ -58,7 +59,10 @@ let categories = [ "Network" ]; }; - passthru.updateScript = ./update.sh; + passthru = { + updateScript = ./update.sh; + tests.localsend = nixosTests.localsend; + }; meta = metaCommon // { mainProgram = "localsend_app";