nixosTests.transfer-sh: init

This commit is contained in:
ocfox 2024-01-25 12:23:53 +08:00
parent 01e674ba90
commit 2e4d7b7ad2
No known key found for this signature in database
3 changed files with 34 additions and 1 deletions

View File

@ -901,6 +901,7 @@ in {
tor = handleTest ./tor.nix {};
traefik = handleTestOn ["aarch64-linux" "x86_64-linux"] ./traefik.nix {};
trafficserver = handleTest ./trafficserver.nix {};
transfer-sh = handleTest ./transfer-sh.nix {};
transmission = handleTest ./transmission.nix { transmission = pkgs.transmission; };
transmission_4 = handleTest ./transmission.nix { transmission = pkgs.transmission_4; };
# tracee requires bpf

View File

@ -0,0 +1,20 @@
import ./make-test-python.nix ({ pkgs, lib, ... }: {
name = "transfer-sh";
meta = {
maintainers = with lib.maintainers; [ ocfox ];
};
nodes.machine = { pkgs, ... }: {
services.transfer-sh = {
enable = true;
settings.LISTENER = ":1234";
};
};
testScript = ''
machine.wait_for_unit("transfer-sh.service")
machine.wait_for_open_port(1234)
machine.succeed("curl --fail http://localhost:1234/")
'';
})

View File

@ -1,4 +1,9 @@
{ lib, fetchFromGitHub, buildGoModule }:
{ lib
, fetchFromGitHub
, buildGoModule
, nix-update-script
, nixosTests
}:
buildGoModule rec {
pname = "transfer-sh";
@ -13,6 +18,13 @@ buildGoModule rec {
vendorHash = "sha256-C8ZfUIGT9HiQQiJ2hk18uwGaQzNCIKp/Jiz6ePZkgDQ=";
passthru = {
tests = {
inherit (nixosTests) transfer-sh;
};
updateScript = nix-update-script { };
};
meta = with lib; {
description = "Easy and fast file sharing and pastebin server with access from the command-line";
homepage = "https://github.com/dutchcoders/transfer.sh";