netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Hunter <david.hunter.linux@gmail.com>
To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, shuah@kernel.org
Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org, javier.carrasco.cruz@gmail.com,
	david.hunter.linux@gmail.com
Subject: [PATCH 1/1] Improve missing mods error message and make shell script executable
Date: Tue, 20 Aug 2024 16:21:16 -0400	[thread overview]
Message-ID: <20240820202116.6124-1-david.hunter.linux@gmail.com> (raw)

Make the test executable. Currently, tests in this shell script are not
executable, so the scipt file is skipped entirely.

Also, the error message descirbing the required modules is inaccurate.
Currently, only  "SKIP: Need act_mirred module" is shown. As a result,
users might only that module; however, three modules are actually
required and if any of them are missing, the build will fail with the
same message.

Fix the error message to show any/all modules needed for the script file
upon failure.

Signed-off-by: David Hunter <david.hunter.linux@gmail.com>
---
 .../testing/selftests/net/test_ingress_egress_chaining.sh | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
 mode change 100644 => 100755 tools/testing/selftests/net/test_ingress_egress_chaining.sh

diff --git a/tools/testing/selftests/net/test_ingress_egress_chaining.sh b/tools/testing/selftests/net/test_ingress_egress_chaining.sh
old mode 100644
new mode 100755
index 08adff6bb3b6..b1a3d68e0ec2
--- a/tools/testing/selftests/net/test_ingress_egress_chaining.sh
+++ b/tools/testing/selftests/net/test_ingress_egress_chaining.sh
@@ -13,8 +13,14 @@ if [ "$(id -u)" -ne 0 ];then
 fi
 
 needed_mods="act_mirred cls_flower sch_ingress"
+mods_missing=""
+
+for mod in $needed_mods; do 
+	modinfo $mod &>/dev/null || mods_missing="$mods_missing$mod "
+done
+
 for mod in $needed_mods; do
-	modinfo $mod &>/dev/null || { echo "SKIP: Need act_mirred module"; exit $ksft_skip; }
+	modinfo $mod &>/dev/null || { echo "SKIP: modules needed: $mods_missing"; exit $ksft_skip; }
 done
 
 ns="ns$((RANDOM%899+100))"
-- 
2.43.0


             reply	other threads:[~2024-08-20 20:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-20 20:21 David Hunter [this message]
2024-08-22  1:02 ` [PATCH 1/1] Improve missing mods error message and make shell script executable Jakub Kicinski
2024-08-23 19:08   ` David Hunter
2024-08-24 14:38     ` [PATCH 1/1 V2] Selftests: net: Set executable bit for shell script David Hunter
2024-08-26 16:10       ` patchwork-bot+netdevbpf
2024-08-26 21:40       ` Jakub Kicinski
2024-08-27 21:37         ` David Hunter
2024-08-27 21:44           ` Jakub Kicinski

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=20240820202116.6124-1-david.hunter.linux@gmail.com \
    --to=david.hunter.linux@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=javier.carrasco.cruz@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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).