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

Alan Maguire
2025-07-03T16:59:54Z

On 03/07/2025 17:43, Eugene Loh wrote:
> Reviewed-by: Eugene Loh <eugene.loh@oracle.com>
>

Thanks for the review!

> I confess I don't understand all the details, but it seems like a nice
> improvement.  Thanks.
>

Creating a network namespace essentially gives you an independent TCP/IP
stack on the system; you then connect to it from the main (global
network namespace) via a veth pair; one lives on the network namespace
side in that TCP/IP stack and the other lives on the local system
(global namespace) side; kind of like using a back-to-back cable between
two ethernet cards on different systems, but virtually. The upshot is
that the networking stack sends to the namespaced interface just like it
does for "real" network traffic; that is the benefit it gives us.

> 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?

> I think you need to update Copyright years in the modified files. And...
>

Will do, thanks!

> 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.