nixos/tests/pairdrop: init

This commit is contained in:
Diogo Correia
2025-10-16 10:23:25 +01:00
parent 4cc3d732ca
commit 9569752c0a
3 changed files with 40 additions and 0 deletions
+1
View File
@@ -1149,6 +1149,7 @@ in
oxidized = handleTest ./oxidized.nix { };
pacemaker = runTest ./pacemaker.nix;
packagekit = runTest ./packagekit.nix;
pairdrop = runTest ./web-apps/pairdrop.nix;
paisa = runTest ./paisa.nix;
pam-file-contents = runTest ./pam/pam-file-contents.nix;
pam-lastlog = runTest ./pam/pam-lastlog.nix;
+32
View File
@@ -0,0 +1,32 @@
{ ... }:
{
name = "pairdrop-nixos";
nodes.machine =
{ pkgs, ... }:
{
services.pairdrop = {
enable = true;
port = 1337;
environment = {
SIGNALING_SERVER = "pairdrop.net";
CUSTOM_BUTTON_ACTIVE = false;
};
};
};
testScript = ''
import json
machine.wait_for_unit("pairdrop.service")
machine.wait_for_open_port(1337)
machine.succeed("curl --fail http://localhost:1337/")
res = machine.succeed("curl --fail http://localhost:1337/config")
print(res)
cfg = json.loads(res)
assert cfg["signalingServer"] == "pairdrop.net/"
assert cfg["buttons"]["custom_button"]["active"] == "false"
'';
}
+7
View File
@@ -2,6 +2,7 @@
lib,
buildNpmPackage,
fetchFromGitHub,
nixosTests,
nodejs,
}:
@@ -36,6 +37,12 @@ buildNpmPackage rec {
runHook postInstall
'';
passthru = {
tests = {
inherit (nixosTests) pairdrop;
};
};
meta = with lib; {
description = "Local file sharing in your browser";
mainProgram = "pairdrop";