nixos/tests/pairdrop: init
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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"
|
||||
'';
|
||||
}
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user