2020-04-24 23:36:52 +00:00
|
|
|
import ./make-test-python.nix ({ pkgs, ... }:
|
|
|
|
|
|
|
|
{
|
|
|
|
name = "samba";
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
meta.maintainers = [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
nodes =
|
|
|
|
{ client =
|
|
|
|
{ pkgs, ... }:
|
2021-02-16 17:04:54 +00:00
|
|
|
{ virtualisation.fileSystems =
|
2020-04-24 23:36:52 +00:00
|
|
|
{ "/public" = {
|
|
|
|
fsType = "cifs";
|
|
|
|
device = "//server/public";
|
|
|
|
options = [ "guest" ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
server =
|
|
|
|
{ ... }:
|
|
|
|
{ services.samba.enable = true;
|
2021-10-17 09:34:42 +00:00
|
|
|
services.samba.openFirewall = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
services.samba.shares.public =
|
|
|
|
{ path = "/public";
|
|
|
|
"read only" = true;
|
|
|
|
browseable = "yes";
|
|
|
|
"guest ok" = "yes";
|
|
|
|
comment = "Public samba share.";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# client# [ 4.542997] mount[777]: sh: systemd-ask-password: command not found
|
|
|
|
|
|
|
|
testScript =
|
|
|
|
''
|
|
|
|
server.start()
|
|
|
|
server.wait_for_unit("samba.target")
|
|
|
|
server.succeed("mkdir -p /public; echo bar > /public/foo")
|
|
|
|
|
|
|
|
client.start()
|
|
|
|
client.wait_for_unit("remote-fs.target")
|
|
|
|
client.succeed("[[ $(cat /public/foo) = bar ]]")
|
|
|
|
'';
|
|
|
|
})
|