public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: Stefano Brivio <sbrivio@redhat.com>
To: passt-dev@passt.top
Subject: [PATCH] test/distro: Avoid race between display of ns_msg and netcat exiting
Date: Mon, 31 Jan 2022 16:00:12 +0100	[thread overview]
Message-ID: <20220131150012.3228-1-sbrivio@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1648 bytes --]

The shell might report 'nc -6 -l -p 9999 > /tmp/ns_msg' as done
even after the subsequent 'echo' is done: wait one second before
reading out /tmp/ns_msg, to ensure we read that instead of the
"Done" message.

Signed-off-by: Stefano Brivio <sbrivio(a)redhat.com>
---
 test/distro/debian   | 1 +
 test/distro/fedora   | 1 +
 test/distro/opensuse | 1 +
 test/distro/ubuntu   | 1 +
 4 files changed, 4 insertions(+)

diff --git a/test/distro/debian b/test/distro/debian
index 6ba0b10..c506bf7 100644
--- a/test/distro/debian
+++ b/test/distro/debian
@@ -26,6 +26,7 @@ sleep	2
 host	echo "from_ns" | nc -q0 ::1 10000
 sleep	2
 host	echo
+sleep	1
 hout	NS_MSG cat /tmp/ns_msg
 check	[ __NS_MSG__ = "from_init" ]
 hostb	exit
diff --git a/test/distro/fedora b/test/distro/fedora
index 0a80555..f2f8f27 100644
--- a/test/distro/fedora
+++ b/test/distro/fedora
@@ -25,6 +25,7 @@ sleep	2
 host	echo "from_ns" | nc ::1 10000
 sleep	2
 host	echo
+sleep	1
 hout	NS_MSG cat /tmp/ns_msg
 check	[ __NS_MSG__ = "from_init" ]
 hostb	exit
diff --git a/test/distro/opensuse b/test/distro/opensuse
index 740108a..6e29b45 100644
--- a/test/distro/opensuse
+++ b/test/distro/opensuse
@@ -25,6 +25,7 @@ sleep	2
 host	echo "from_ns" | nc -N ::1 10000
 sleep	2
 host	echo
+sleep	1
 hout	NS_MSG cat /tmp/ns_msg
 check	[ __NS_MSG__ = "from_init" ]
 hostb	exit
diff --git a/test/distro/ubuntu b/test/distro/ubuntu
index fcd3861..6013122 100644
--- a/test/distro/ubuntu
+++ b/test/distro/ubuntu
@@ -25,6 +25,7 @@ sleep	2
 host	echo "from_ns" | nc -q0 ::1 10000
 sleep	2
 host	echo
+sleep	1
 hout	NS_MSG cat /tmp/ns_msg
 check	[ __NS_MSG__ = "from_init" ]
 hostb	exit
-- 
@@ -25,6 +25,7 @@ sleep	2
 host	echo "from_ns" | nc -q0 ::1 10000
 sleep	2
 host	echo
+sleep	1
 hout	NS_MSG cat /tmp/ns_msg
 check	[ __NS_MSG__ = "from_init" ]
 hostb	exit
-- 
2.34.1


                 reply	other threads:[~2022-01-31 15:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220131150012.3228-1-sbrivio@redhat.com \
    --to=sbrivio@redhat.com \
    --cc=passt-dev@passt.top \
    /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.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

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 IMAP folder(s).