linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Paolo Abeni <pabeni@redhat.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com,
	shuah@kernel.org, ap420073@gmail.com,
	linux-kselftest@vger.kernel.org
Subject: Re: [PATCH net] selftests: net: move amt to socat for better compatibility
Date: Thu, 9 May 2024 11:42:12 -0700	[thread overview]
Message-ID: <20240509114212.4c8062b5@kernel.org> (raw)
In-Reply-To: <0bf4989c10917b2351636a2f19794e47f3d336e9.camel@redhat.com>

On Thu, 09 May 2024 19:39:36 +0200 Paolo Abeni wrote:
> Acked-by: Paolo Abeni<pabeni@redhat.com>

Thanks!

> As a minor note, shell variable expansion should already trim all the
> trailing/leading spaces from the socat command output, so it should not
> be necessary replace the string comparison with the grep command:
> 
> 	RESULT6=$(ip netns exec "${LISTENER}" timeout 15 socat - UDP6-LISTEN:6000,readbytes=128 || true)
> 	if [ "$RESULT6" == "2001:db8:3::2" ]; then

99% sure I tried that exact thing, but it wasn't enough.

$ msg=$(socat - UDP4-LISTEN:1234,readbytes=128)
$ echo ">$msg<"
>127.0.0.1                                                                                                                       <
$ msg=$msg
$ echo ">$msg<"
>127.0.0.1                                                                                                                       <
$ msg=$(echo $msg)
$ echo ">$msg<"
>127.0.0.1<


IOW we'd need to feed it thru an echo or some such.
Possibly something like: [ $(echo $msg) == "127.0.0.1" ]
But I personally find that a touch too magical.
The grep works 🤷️

  reply	other threads:[~2024-05-09 18:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-09 16:19 [PATCH net] selftests: net: move amt to socat for better compatibility Jakub Kicinski
2024-05-09 17:39 ` Paolo Abeni
2024-05-09 18:42   ` Jakub Kicinski [this message]
2024-05-10  6:09 ` Taehee Yoo
2024-05-11  1:30 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240509114212.4c8062b5@kernel.org \
    --to=kuba@kernel.org \
    --cc=ap420073@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).