Hung up on writing Unit tests for dynamic DNS update from different source addresses

Matt Grant matt at mattgrant.net.nz
Tue Aug 2 21:15:15 UTC 2022


Hi!

Figured it out, after a bit of digging.

Can't use the test process itself as need to
set SOCKET_WRAPPER_DEFAULT_IFACE to say 251 which sets the source IP
numbers to 10.53.57.251 and fd00::5357:5fxx.  Or maybe I could try the
loopback source address of ::1 for example?

Will call nsupdate (needed for testing samba_dnsupdate) via Python
subprocess module to do the work.  Bit messy, but there is NO way to add
extra IP numbers to the current socket_wrapper interface context that I can
see from its man page.

Thanks guys!  Will get this done.

Best Regards,

Matt Grant

On Tue, 2 Aug 2022 at 21:12, Matt Grant <matt at mattgrant.net.nz> wrote:

> Hi!
>
> Code as it is up in merge request:
> https://gitlab.com/samba-team/samba/-/merge_requests/2271
>
> It's come a long way.  Been cleaned up a lot, and just completing the test
> suite.  Need to test
> denying DNS update by IP source address, and updates authed by IP source
> address.
>
> Have managed to update dns_base.py to optionally bind to a source IP
> address for a query, but can't figure how to
> set SOCKET_WRAPPER_DEFAULT_IFACE for the test/special test suite process
> socket wrapper stuff.  Tis getting quite seeing double inside
> selftest/target/Samba4.pm and source4/selftest/tests.py....
>
> Could some one please lay out a map for me how to proceed with this, or
> just help me to give it this extra push with this to get this over the hump
> and accepted for merging?
>
> Thank you!
>
> Matt Grant
>


More information about the samba-technical mailing list