python3Packages.xknx: 1.1.0 -> 1.2.0
[NixPkgs.git] / nixos / tests / samba.nix
blob252c3dd9c76e947855c0dfb315ecd745f522939f
1 import ./make-test-python.nix ({ pkgs, ... }:
4   name = "samba";
6   meta.maintainers = [ pkgs.lib.maintainers.eelco ];
8   nodes =
9     { client =
10         { pkgs, ... }:
11         { virtualisation.fileSystems =
12             { "/public" = {
13                 fsType = "cifs";
14                 device = "//server/public";
15                 options = [ "guest" ];
16               };
17             };
18         };
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     };
34   # client# [    4.542997] mount[777]: sh: systemd-ask-password: command not found
36   testScript =
37     ''
38       server.start()
39       server.wait_for_unit("samba.target")
40       server.succeed("mkdir -p /public; echo bar > /public/foo")
42       client.start()
43       client.wait_for_unit("remote-fs.target")
44       client.succeed("[[ $(cat /public/foo) = bar ]]")
45     '';