* Add a test for the NFS server/client.
svn path=/nixos/branches/boot-order/; revision=22188
This commit is contained in:
parent
a9e8bf6491
commit
2678f947fb
|
@ -12,6 +12,7 @@ with import ../lib/testing.nix { inherit nixpkgs services system; };
|
|||
kde4 = makeTest (import ./kde4.nix);
|
||||
login = makeTest (import ./login.nix);
|
||||
nat = makeTest (import ./nat.nix);
|
||||
nfs = makeTest (import ./nfs.nix);
|
||||
openssh = makeTest (import ./openssh.nix);
|
||||
portmap = makeTest (import ./portmap.nix);
|
||||
proxy = makeTest (import ./proxy.nix);
|
||||
|
|
47
tests/nfs.nix
Normal file
47
tests/nfs.nix
Normal file
|
@ -0,0 +1,47 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
|
||||
nodes =
|
||||
{ client =
|
||||
{ config, pkgs, ... }:
|
||||
{ services.nfsKernel.client.enable = true;
|
||||
fileSystems = pkgs.lib.mkOverride 50 {}
|
||||
[ { mountPoint = "/data";
|
||||
device = "server:/data";
|
||||
fsType = "nfs";
|
||||
options = "bootwait";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
server =
|
||||
{ config, pkgs, ... }:
|
||||
{ services.nfsKernel.server.enable = true;
|
||||
services.nfsKernel.server.exports =
|
||||
''
|
||||
/data 192.168.1.0/255.255.255.0(rw,no_root_squash)
|
||||
'';
|
||||
services.nfsKernel.server.createMountPoints = true;
|
||||
};
|
||||
};
|
||||
|
||||
testScript =
|
||||
''
|
||||
startAll;
|
||||
|
||||
$server->waitForJob("nfs-kernel-nfsd");
|
||||
$server->waitForJob("nfs-kernel-mountd");
|
||||
$server->waitForJob("nfs-kernel-statd");
|
||||
|
||||
$client->waitForJob("nfs-kernel-statd");
|
||||
|
||||
$client->waitForJob("tty1"); # depends on filesystems
|
||||
|
||||
$client->succeed("echo bar > /data/foo");
|
||||
$server->succeed("test -e /data/foo");
|
||||
|
||||
$client->shutdown;
|
||||
'';
|
||||
|
||||
}
|
Loading…
Reference in a new issue