Re: [DTrace-devel] [PATCH] test/utils: add more reliable "get remote address" approach

Kris Van Hees
2025-07-03T18:26:28Z

On Thu, Jul 03, 2025 at 07:02:57PM +0100, Alan Maguire wrote:
> On 03/07/2025 18:06, Eugene Loh wrote:
> > On 7/3/25 12:59, Alan Maguire wrote:
> >
> >> On 03/07/2025 17:43, Eugene Loh wrote:
> >>
> >>> I tested and it looks good (modulo the OL8 UEK6 issue mentioned in the
> >>> patch 3/4 feedback).
> >>>
> >> Sorry I couldn't find that issue; is this the 5.15 problem with the ip
> >> send probes?
> >
> >     dtrace: failed to compile script /dev/stdin:
> >     ".../build/dlibs/5.2/tcp.d", line 177: failed to resolve type of
> > inet_ntoa arg#1 (ipaddr_t *):
> >     Unknown type name
> >
>
> Ah, sorry yep I have a fix for that one in the next round. Basically we
> need to add it to the core set of typedefs and add a type for a pointer
> to ipaddr_t; we can't rely on the #pragma to include net.d unfortunately.

Why can't we rely on the pragma? That is how e.g. the ip provider manages
this I believe?

I'd really rather not add a type like this to the core set of typedefs we
can avoid it, because it really isn't a core type.

> >>> On 7/3/25 07:33, Alan Maguire via DTrace-devel wrote:
> >>>
> >>>> The current approach of looking for remote addresses
> >>>> is brittle and fails in many environments; it checks the
> >>>> default route gateway and looks for open ports in the TCP
> >>>> case.
> >>>>
> >>>> We can however achieve the same goal reliably by creating
> >>>> a network namespace on the system and configuring either
> >>>> IPv4 or IPv6 addresses on the namespaced and local veth
> >>>> interfaces that support communication between namespaces.
> >>>> If a tcp port is required start sshd to listen on that port.
> >>> Maybe a comma after "required"?
> >>>
> >> yep, will fix.
> >>
> >>>> Teardown is managed in runtest.sh as signal handling for
> >>>> timeouts within the test scripts is not working; a trap
> >>>> function does not trigger for TERM.
> >>> I'm having trouble parsing the text before the semicolon.  I think I
> >>> understand it, but cannot seem to figure out the grammar.
> >> I'll try and rephrase; basically I tried adding a
> >>
> >> trap cleanup TERM
> >>
> >> to the test script to catch a SIGTERM when the test timed out;
> >> unfortunately this didn't trigger when tests timed out so we were left
> >> with network namespaces hanging around.
> >>
> >> How about
> >>
> >> Teardown of network namespaces is managed in the toplevel runtest.sh to
> >> ensure that network namespaces are removed after test completion for all
> >> cases; success, failure and timeout.
> >
> > Great.  Or how about a colon instead of semicolon?
>
> Sure!