nixos/tests/samba-wsdd: add check WSD Discovery
This commit is contained in:
parent
03760ab82e
commit
0aa34a03d0
|
@ -315,6 +315,7 @@ in
|
|||
runInMachine = handleTest ./run-in-machine.nix {};
|
||||
rxe = handleTest ./rxe.nix {};
|
||||
samba = handleTest ./samba.nix {};
|
||||
samba-wsdd = handleTest ./samba-wsdd.nix {};
|
||||
sanoid = handleTest ./sanoid.nix {};
|
||||
sbt = handleTest ./sbt.nix {};
|
||||
sbt-extras = handleTest ./sbt-extras.nix {};
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
import ./make-test-python.nix ({ pkgs, ... }:
|
||||
|
||||
{
|
||||
name = "samba-wsdd";
|
||||
meta.maintainers = with pkgs.stdenv.lib.maintainers; [ izorkin ];
|
||||
|
||||
nodes = {
|
||||
client_wsdd = { pkgs, ... }: {
|
||||
services.samba-wsdd = {
|
||||
enable = true;
|
||||
interface = "eth1";
|
||||
workgroup = "WORKGROUP";
|
||||
hostname = "CLIENT-WSDD";
|
||||
discovery = true;
|
||||
extraOptions = [ "--no-host" ];
|
||||
};
|
||||
networking.firewall.allowedTCPPorts = [ 5357 ];
|
||||
networking.firewall.allowedUDPPorts = [ 3702 ];
|
||||
};
|
||||
|
||||
server_wsdd = { ... }: {
|
||||
services.samba-wsdd = {
|
||||
enable = true;
|
||||
interface = "eth1";
|
||||
workgroup = "WORKGROUP";
|
||||
hostname = "SERVER-WSDD";
|
||||
};
|
||||
networking.firewall.allowedTCPPorts = [ 5357 ];
|
||||
networking.firewall.allowedUDPPorts = [ 3702 ];
|
||||
};
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
client_wsdd.start()
|
||||
client_wsdd.wait_for_unit("samba-wsdd")
|
||||
|
||||
server_wsdd.start()
|
||||
server_wsdd.wait_for_unit("samba-wsdd")
|
||||
|
||||
client_wsdd.wait_until_succeeds(
|
||||
"echo list | ${pkgs.libressl.nc}/bin/nc -U /run/wsdd/wsdd.sock | grep -i SERVER-WSDD"
|
||||
)
|
||||
'';
|
||||
})
|
|
@ -1,4 +1,4 @@
|
|||
{ stdenv, fetchFromGitHub, makeWrapper, python3 }:
|
||||
{ stdenv, fetchFromGitHub, makeWrapper, nixosTests, python3 }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "wsdd";
|
||||
|
@ -20,6 +20,10 @@ stdenv.mkDerivation rec {
|
|||
wrapProgram $out/bin/wsdd --prefix PYTHONPATH : "$PYTHONPATH"
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
tests.samba-wsdd = nixosTests.samba-wsdd;
|
||||
};
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
homepage = "https://github.com/christgau/wsdd";
|
||||
description = "A Web Service Discovery (WSD) host daemon for SMB/Samba";
|
||||
|
|
Loading…
Reference in New Issue