nixos/tests/samba-wsdd: add check WSD Discovery

wip/yesman
Izorkin 4 years ago
parent 03760ab82e
commit 0aa34a03d0
No known key found for this signature in database
GPG Key ID: 1436C1B3F3679F09
  1. 1
      nixos/tests/all-tests.nix
  2. 44
      nixos/tests/samba-wsdd.nix
  3. 6
      pkgs/servers/wsdd/default.nix

@ -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…
Cancel
Save