mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 15:33:13 +00:00
3fd324f823
Eelco has made several early contributions to NixOS including writing the samba module among other things, but is more or less inactive these days. By my brief inspection, he has not committed to the nixos/ tree since releasing Nix 2.13 in early 2023 and merging a PR to networking tests slightly before that. A lot of these tests/modules are actually unmaintained in practice, so we should update the code to reflect the practical reality so someone can consider picking them up.
47 lines
1.1 KiB
Nix
47 lines
1.1 KiB
Nix
import ./make-test-python.nix ({ pkgs, ... }:
|
|
|
|
{
|
|
name = "samba";
|
|
|
|
meta.maintainers = [ ];
|
|
|
|
nodes =
|
|
{ client =
|
|
{ pkgs, ... }:
|
|
{ virtualisation.fileSystems =
|
|
{ "/public" = {
|
|
fsType = "cifs";
|
|
device = "//server/public";
|
|
options = [ "guest" ];
|
|
};
|
|
};
|
|
};
|
|
|
|
server =
|
|
{ ... }:
|
|
{ services.samba.enable = true;
|
|
services.samba.openFirewall = true;
|
|
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 ]]")
|
|
'';
|
|
})
|