1import ./make-test-python.nix ({ pkgs, ... }:
2
3{
4 name = "samba";
5
6 meta.maintainers = [ pkgs.lib.maintainers.eelco ];
7
8 nodes =
9 { client =
10 { pkgs, ... }:
11 { virtualisation.fileSystems =
12 { "/public" = {
13 fsType = "cifs";
14 device = "//server/public";
15 options = [ "guest" ];
16 };
17 };
18 };
19
20 server =
21 { ... }:
22 { services.samba.enable = true;
23 services.samba.openFirewall = true;
24 services.samba.shares.public =
25 { path = "/public";
26 "read only" = true;
27 browseable = "yes";
28 "guest ok" = "yes";
29 comment = "Public samba share.";
30 };
31 };
32 };
33
34 # client# [ 4.542997] mount[777]: sh: systemd-ask-password: command not found
35
36 testScript =
37 ''
38 server.start()
39 server.wait_for_unit("samba.target")
40 server.succeed("mkdir -p /public; echo bar > /public/foo")
41
42 client.start()
43 client.wait_for_unit("remote-fs.target")
44 client.succeed("[[ $(cat /public/foo) = bar ]]")
45 '';
46})