From: Petr Machata <petrm@nvidia.com>
To: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
<netdev@vger.kernel.org>
Cc: <linux-kselftest@vger.kernel.org>, Shuah Khan <shuah@kernel.org>,
"Benjamin Poirier" <bpoirier@nvidia.com>,
Hangbin Liu <liuhangbin@gmail.com>,
"Vladimir Oltean" <vladimir.oltean@nxp.com>,
Ido Schimmel <idosch@nvidia.com>,
"Przemek Kitszel" <przemyslaw.kitszel@intel.com>,
Petr Machata <petrm@nvidia.com>, <mlxsw@nvidia.com>
Subject: [PATCH net-next 03/10] selftests: forwarding: lib: Allow passing PID to stop_traffic()
Date: Wed, 9 Oct 2024 14:06:21 +0200 [thread overview]
Message-ID: <4d7cb2f1a05beef5076372b19da4b7d3f08b79d2.1728473602.git.petrm@nvidia.com> (raw)
In-Reply-To: <cover.1728473602.git.petrm@nvidia.com>
Now that it is possible to schedule a deferral of stop_traffic() right
after the traffic is started, we do not have to rely on the %% magic to
kill the background process that was started last. Instead we can just give
the PID explicitly. This makes it possible to start other background
processes after the traffic is started without confusing the cleanup.
Signed-off-by: Petr Machata <petrm@nvidia.com>
---
tools/testing/selftests/net/forwarding/lib.sh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh
index 76e6d7698caf..89c25f72b10c 100644
--- a/tools/testing/selftests/net/forwarding/lib.sh
+++ b/tools/testing/selftests/net/forwarding/lib.sh
@@ -1768,8 +1768,10 @@ start_tcp_traffic()
stop_traffic()
{
+ local pid=${1-%%}; shift
+
# Suppress noise from killing mausezahn.
- { kill %% && wait %%; } 2>/dev/null
+ { kill $pid && wait $pid; } 2>/dev/null
}
declare -A cappid
--
2.45.0
next prev parent reply other threads:[~2024-10-09 12:09 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-09 12:06 [PATCH net-next 00/10] selftests: net: Introduce deferred commands Petr Machata
2024-10-09 12:06 ` [PATCH net-next 01/10] selftests: net: lib: " Petr Machata
2024-10-15 8:22 ` Paolo Abeni
2024-10-15 9:06 ` Petr Machata
2024-10-09 12:06 ` [PATCH net-next 02/10] selftests: forwarding: Add a fallback cleanup() Petr Machata
2024-10-09 12:06 ` Petr Machata [this message]
2024-10-09 12:06 ` [PATCH net-next 04/10] selftests: RED: Use defer for test cleanup Petr Machata
2024-10-15 8:14 ` Paolo Abeni
2024-10-15 9:03 ` Petr Machata
2024-10-09 12:06 ` [PATCH net-next 05/10] selftests: TBF: " Petr Machata
2024-10-09 12:06 ` [PATCH net-next 06/10] selftests: ETS: " Petr Machata
2024-10-09 12:06 ` [PATCH net-next 07/10] selftests: mlxsw: qos_mc_aware: " Petr Machata
2024-10-09 12:06 ` [PATCH net-next 08/10] selftests: mlxsw: qos_ets_strict: " Petr Machata
2024-10-09 12:06 ` [PATCH net-next 09/10] selftests: mlxsw: qos_max_descriptors: " Petr Machata
2024-10-09 12:06 ` [PATCH net-next 10/10] selftests: mlxsw: devlink_trap_police: " Petr Machata
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=4d7cb2f1a05beef5076372b19da4b7d3f08b79d2.1728473602.git.petrm@nvidia.com \
--to=petrm@nvidia.com \
--cc=bpoirier@nvidia.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=liuhangbin@gmail.com \
--cc=mlxsw@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=shuah@kernel.org \
--cc=vladimir.oltean@nxp.com \
/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