Unverified Commit 0bf0d184 authored by Ramses's avatar Ramses Committed by GitHub
Browse files

nixos/transmission: convert test to runTest and replace activationScript by...

nixos/transmission: convert test to runTest and replace activationScript by systemd service (#484412)
parents 93e91056 314c9128
Loading
Loading
Loading
Loading
+23 −13
Original line number Diff line number Diff line
@@ -357,7 +357,16 @@ in
    # when /home/foo is not owned by cfg.user.
    # Note also that using an ExecStartPre= wouldn't work either
    # because BindPaths= needs these directories before.
    system.activationScripts.transmission-daemon = ''
    systemd.services.transmission-setup = {
      before = [ "transmission.service" ];
      partOf = [ "transmission.service" ];

      serviceConfig = {
        Type = "oneshot";
        RemainAfterExit = true;
      };

      script = ''
        install -d -m 700 -o '${cfg.user}' -g '${cfg.group}' '${cfg.home}/${settingsDir}'
      ''
      + optionalString (cfg.downloadDirPermissions != null) ''
@@ -370,6 +379,7 @@ in
          install -d -m '${cfg.downloadDirPermissions}' -o '${cfg.user}' -g '${cfg.group}' '${cfg.settings.watch-dir}'
        ''}
      '';
    };

    systemd.services.transmission = {
      description = "Transmission BitTorrent Service";
+1 −1
Original line number Diff line number Diff line
@@ -1630,7 +1630,7 @@ in
  traefik = runTestOn [ "aarch64-linux" "x86_64-linux" ] ./traefik.nix;
  trafficserver = runTest ./trafficserver.nix;
  transfer-sh = runTest ./transfer-sh.nix;
  transmission_4 = handleTest ./transmission.nix { };
  transmission_4 = runTest ./transmission.nix;
  trezord = runTest ./trezord.nix;
  trickster = runTest ./trickster.nix;
  trilium-server = runTestOn [ "x86_64-linux" ] ./trilium-server.nix;
+19 −18
Original line number Diff line number Diff line
import ./make-test-python.nix (
{ pkgs, ... }:
{
  name = "transmission";
@@ -18,10 +17,12 @@ import ./make-test-python.nix (
      services.transmission.enable = true;
    };

    testScript = ''
  testScript =
    { nodes, ... }:
    #python
    ''
      start_all()
      machine.wait_for_unit("transmission")
      machine.shutdown()
    '';
}
)