1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-18 11:40:45 +00:00
nixpkgs/nixos/tests/samba.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

48 lines
1 KiB
Nix
Raw Normal View History

import ./make-test-python.nix ({ pkgs, lib, ... }: {
2016-09-30 20:24:18 +01:00
name = "samba";
meta.maintainers = [ lib.maintainers.anthonyroussel ];
2016-09-30 20:24:18 +01:00
nodes = {
client =
{ ... }:
{
virtualisation.fileSystems = {
"/public" = {
fsType = "cifs";
device = "//server/public";
options = [ "guest" ];
};
2016-09-30 20:24:18 +01:00
};
};
2016-09-30 20:24:18 +01:00
server =
{ ... }:
{
services.samba = {
enable = true;
openFirewall = true;
settings = {
"public" = {
"path" = "/public";
2016-09-30 20:24:18 +01:00
"read only" = true;
"browseable" = "yes";
2016-09-30 20:24:18 +01:00
"guest ok" = "yes";
"comment" = "Public samba share.";
2016-09-30 20:24:18 +01:00
};
};
2016-09-30 20:24:18 +01:00
};
};
};
2016-09-30 20:24:18 +01:00
testScript = ''
server.start()
server.wait_for_unit("samba.target")
server.succeed("mkdir -p /public; echo bar > /public/foo")
2016-09-30 20:24:18 +01:00
client.start()
client.wait_for_unit("remote-fs.target")
client.succeed("[[ $(cat /public/foo) = bar ]]")
'';
2016-09-30 20:24:18 +01:00
})