All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jamie Iles <jamie@nuviainc.com>
To: kvm@vger.kernel.org
Subject: [kvm-unit-tests PATCH] scripts/arch-run: use ncat rather than nc.
Date: Mon, 21 Sep 2020 11:36:44 +0100	[thread overview]
Message-ID: <20200921103644.1718058-1-jamie@nuviainc.com> (raw)

On Red Hat 7+ and derived distributions, 'nc' is nmap-ncat, but on
Debian based distributions this is often netcat-openbsd.  Both are
mostly compatible with the important distinction that netcat-openbsd
does not shutdown the socket on stdin EOF without also passing '-N' as
an argument which is not supported on nmap-ncat.  This has the
unfortunate consequence of hanging qmp calls so tests like aarch64
its-migration never complete.

We're depending on ncat behaviour and nmap-ncat is available in all
major distributions.

Signed-off-by: Jamie Iles <jamie@nuviainc.com>
---
 scripts/arch-run.bash | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash
index 660f1b7acb93..5997e384019b 100644
--- a/scripts/arch-run.bash
+++ b/scripts/arch-run.bash
@@ -101,13 +101,13 @@ timeout_cmd ()
 
 qmp ()
 {
-	echo '{ "execute": "qmp_capabilities" }{ "execute":' "$2" '}' | nc -U $1
+	echo '{ "execute": "qmp_capabilities" }{ "execute":' "$2" '}' | ncat -U $1
 }
 
 run_migration ()
 {
-	if ! command -v nc >/dev/null 2>&1; then
-		echo "${FUNCNAME[0]} needs nc (netcat)" >&2
+	if ! command -v ncat >/dev/null 2>&1; then
+		echo "${FUNCNAME[0]} needs ncat (netcat)" >&2
 		return 2
 	fi
 
-- 
2.25.1


             reply	other threads:[~2020-09-21 10:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-21 10:36 Jamie Iles [this message]
2020-09-28 13:03 ` [kvm-unit-tests PATCH] scripts/arch-run: use ncat rather than nc Thomas Huth

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=20200921103644.1718058-1-jamie@nuviainc.com \
    --to=jamie@nuviainc.com \
    --cc=kvm@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.