All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Mirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr>
Cc: Florian Westphal <fw@strlen.de>,
	linux-kselftest@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	Shuah Khan <shuah@kernel.org>, Jakub Kicinski <kuba@kernel.org>
Subject: Re: PROBLEM: Hang in selftests/netfilter/nft_trans_stress.sh
Date: Tue, 3 Jan 2023 17:11:01 +0100	[thread overview]
Message-ID: <20230103161101.GB19686@breakpoint.cc> (raw)
In-Reply-To: <11cc1fca-01b3-f83b-eb9e-3ceffd68b6d4@alu.unizg.hr>

Mirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr> wrote:
> > Can you send me the output of 'bash -x nft_trans_stress.sh'?
> > It should tell which command/program isn't making progress.
> 
> Hi, Florian!
> 
> Well, when ran alone, the script ended successfully:
> 
> root@marvin-IdeaPad-3-15ITL6:/home/marvin/linux/kernel/linux_torvalds/tools/testing/selftests/netfilter# bash nft_trans_stress.sh
> PASS: nft add/delete test returned 0
> PASS: nft reload test returned 0
> PASS: nft add/delete with nftrace enabled test returned 0
> PASS: nft add/delete with nftrace enabled test returned 0
> root@marvin-IdeaPad-3-15ITL6:/home/marvin/linux/kernel/linux_torvalds/tools/testing/selftests/netfilter#
> 
> There was no stall after "nft reload test" in a standalone superuser run.

Hmm.  Does this patch make it work when running via 'make kselftest'?

diff --git a/tools/testing/selftests/netfilter/nft_trans_stress.sh b/tools/testing/selftests/netfilter/nft_trans_stress.sh
--- a/tools/testing/selftests/netfilter/nft_trans_stress.sh
+++ b/tools/testing/selftests/netfilter/nft_trans_stress.sh
@@ -10,12 +10,20 @@
 ksft_skip=4
 
 testns=testns-$(mktemp -u "XXXXXXXX")
+tmp=""
 
 tables="foo bar baz quux"
 global_ret=0
 eret=0
 lret=0
 
+cleanup() {
+	ip netns pids "$testns" | xargs kill 2>/dev/null
+	ip netns del "$testns"
+
+	rm -f "$tmp"
+}
+
 check_result()
 {
 	local r=$1
@@ -43,6 +51,7 @@ if [ $? -ne 0 ];then
 	exit $ksft_skip
 fi
 
+trap cleanup EXIT
 tmp=$(mktemp)
 
 for table in $tables; do
@@ -139,11 +148,4 @@ done
 
 check_result $lret "add/delete with nftrace enabled"
 
-pkill -9 ping
-
-wait
-
-rm -f "$tmp"
-ip netns del "$testns"
-
 exit $global_ret

  reply	other threads:[~2023-01-03 16:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-03 14:03 PROBLEM: Hang in selftests/netfilter/nft_trans_stress.sh Mirsad Goran Todorovac
2023-01-03 14:28 ` Florian Westphal
2023-01-03 15:35   ` Mirsad Goran Todorovac
2023-01-03 16:11     ` Florian Westphal [this message]
2023-01-03 21:17       ` Mirsad Goran Todorovac

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=20230103161101.GB19686@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=mirsad.todorovac@alu.unizg.hr \
    --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 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.