diff --git a/release.nix b/release.nix index 2441ff2952ae..eb9fb3731f7b 100644 --- a/release.nix +++ b/release.nix @@ -154,6 +154,7 @@ let installer.simple = t.installer.simple.test; kde4 = t.kde4.test; login = t.login.test; + openssh = t.openssh.test; proxy = t.proxy.test; quake3 = t.quake3.test; subversion = t.subversion.report; diff --git a/tests/default.nix b/tests/default.nix index a6a7b27fe2ab..90d629f7978b 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -10,6 +10,7 @@ with import ../lib/testing.nix { inherit nixpkgs services system; }; installer = pkgs.lib.mapAttrs (name: complete) (call (import ./installer.nix)); kde4 = apply (import ./kde4.nix); login = apply (import ./login.nix); + openssh = apply (import ./openssh.nix); portmap = apply (import ./portmap.nix); proxy = apply (import ./proxy.nix); quake3 = apply (import ./quake3.nix); diff --git a/tests/openssh.nix b/tests/openssh.nix new file mode 100644 index 000000000000..c6875bcc73ca --- /dev/null +++ b/tests/openssh.nix @@ -0,0 +1,35 @@ +{pkgs, ...}: + +{ + nodes = { + server = + {pkgs, config, ...}: + + { + services.openssh.enable = true; + } + ; + client = + {pkgs, config, ...}: + + { + } + ; + }; + + testScript = + '' + my $key=`${pkgs.openssh}/bin/ssh-keygen -t dsa -f key -N ""`; + + $server->mustSucceed("mkdir /root/.ssh"); + $server->mustSucceed("chmod 700 /root/.ssh"); + $server->copyFileFromHost("key.pub", "/root/.ssh/authorized_keys"); + + $client->mustSucceed("mkdir /root/.ssh"); + $client->mustSucceed("chmod 700 /root/.ssh"); + $client->copyFileFromHost("key", "/root/.ssh/id_dsa"); + $client->mustSucceed("chmod 600 /root/.ssh/id_dsa"); + + $client->mustSucceed("ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no server 'echo hello world'"); + ''; +}