Added openssh testcase
svn path=/nixos/trunk/; revision=20732
This commit is contained in:
parent
6788d457dc
commit
97c20c8f4d
@ -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;
|
||||
|
@ -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);
|
||||
|
35
tests/openssh.nix
Normal file
35
tests/openssh.nix
Normal file
@ -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'");
|
||||
'';
|
||||
}
|
Loading…
Reference in New Issue
Block a user