summaryrefslogtreecommitdiff
path: root/tests/autossh.nix
blob: 5279bf9d90cd7750dbdd5a0f8668ccaa29d3010e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{ config, pkgs, ... }:

{
  services.autossh.sessions = [
    {
      name = "foo";
      user = "jfelice";
      extraArguments = "-i /some/key -T -N bar.eraserhead.net";
    }
  ];

  test = ''
    plist=${config.out}/Library/LaunchDaemons/org.nixos.autossh-foo.plist
    test -f $plist
    grep '<string>/bin/wait4path /nix/store &amp;&amp; exec /nix/store/.*/bin/autossh ' $plist
    grep '<string>/bin/wait4path /nix/store &amp;&amp; exec.*-i /some/key ' $plist
    tr -d '\n\t ' <$plist |grep '<key>KeepAlive</key><true */>'
  '';
}