mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-12 04:35:41 +03:00
parent
d3f5b059bb
commit
bd49230ea4
2 changed files with 42 additions and 44 deletions
|
@ -1175,7 +1175,7 @@ in
|
||||||
rustls-libssl = handleTest ./rustls-libssl.nix { };
|
rustls-libssl = handleTest ./rustls-libssl.nix { };
|
||||||
rxe = handleTest ./rxe.nix { };
|
rxe = handleTest ./rxe.nix { };
|
||||||
sabnzbd = handleTest ./sabnzbd.nix { };
|
sabnzbd = handleTest ./sabnzbd.nix { };
|
||||||
samba = handleTest ./samba.nix { };
|
samba = runTest ./samba.nix;
|
||||||
samba-wsdd = handleTest ./samba-wsdd.nix { };
|
samba-wsdd = handleTest ./samba-wsdd.nix { };
|
||||||
sane = handleTest ./sane.nix { };
|
sane = handleTest ./sane.nix { };
|
||||||
sanoid = handleTest ./sanoid.nix { };
|
sanoid = handleTest ./sanoid.nix { };
|
||||||
|
|
|
@ -1,50 +1,48 @@
|
||||||
import ./make-test-python.nix (
|
{ lib, ... }:
|
||||||
{ pkgs, lib, ... }:
|
{
|
||||||
{
|
name = "samba";
|
||||||
name = "samba";
|
|
||||||
|
|
||||||
meta.maintainers = [ lib.maintainers.anthonyroussel ];
|
meta.maintainers = [ lib.maintainers.anthonyroussel ];
|
||||||
|
|
||||||
nodes = {
|
nodes = {
|
||||||
client =
|
client =
|
||||||
{ ... }:
|
{ ... }:
|
||||||
{
|
{
|
||||||
virtualisation.fileSystems = {
|
virtualisation.fileSystems = {
|
||||||
"/public" = {
|
"/public" = {
|
||||||
fsType = "cifs";
|
fsType = "cifs";
|
||||||
device = "//server/public";
|
device = "//server/public";
|
||||||
options = [ "guest" ];
|
options = [ "guest" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
server =
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
services.samba = {
|
||||||
|
enable = true;
|
||||||
|
openFirewall = true;
|
||||||
|
settings = {
|
||||||
|
"public" = {
|
||||||
|
"path" = "/public";
|
||||||
|
"read only" = true;
|
||||||
|
"browseable" = "yes";
|
||||||
|
"guest ok" = "yes";
|
||||||
|
"comment" = "Public samba share.";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
server =
|
testScript = ''
|
||||||
{ ... }:
|
server.start()
|
||||||
{
|
server.wait_for_unit("samba.target")
|
||||||
services.samba = {
|
server.succeed("mkdir -p /public; echo bar > /public/foo")
|
||||||
enable = true;
|
|
||||||
openFirewall = true;
|
|
||||||
settings = {
|
|
||||||
"public" = {
|
|
||||||
"path" = "/public";
|
|
||||||
"read only" = true;
|
|
||||||
"browseable" = "yes";
|
|
||||||
"guest ok" = "yes";
|
|
||||||
"comment" = "Public samba share.";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
testScript = ''
|
client.start()
|
||||||
server.start()
|
client.wait_for_unit("remote-fs.target")
|
||||||
server.wait_for_unit("samba.target")
|
client.succeed("[[ $(cat /public/foo) = bar ]]")
|
||||||
server.succeed("mkdir -p /public; echo bar > /public/foo")
|
'';
|
||||||
|
}
|
||||||
client.start()
|
|
||||||
client.wait_for_unit("remote-fs.target")
|
|
||||||
client.succeed("[[ $(cat /public/foo) = bar ]]")
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue