From 97c20c8f4d9ad03343e435cc5531ef6f4dc0ca7b Mon Sep 17 00:00:00 2001 From: Sander van der Burg Date: Thu, 18 Mar 2010 13:07:56 +0000 Subject: [PATCH] Added openssh testcase svn path=/nixos/trunk/; revision=20732 --- release.nix | 1 + tests/default.nix | 1 + tests/openssh.nix | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 tests/openssh.nix 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'"); + ''; +}