Unverified Commit 2e4d7b7a authored by ocfox's avatar ocfox
Browse files

nixosTests.transfer-sh: init

parent 01e674ba
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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
+20 −0
Original line number Diff line number Diff line
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/")
  '';
})
+13 −1
Original line number Diff line number Diff line
{ 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";