netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] Improve missing mods error message and make shell script executable
@ 2024-08-20 20:21 David Hunter
  2024-08-22  1:02 ` Jakub Kicinski
  0 siblings, 1 reply; 8+ messages in thread
From: David Hunter @ 2024-08-20 20:21 UTC (permalink / raw)
  To: davem, edumazet, kuba, pabeni, shuah
  Cc: netdev, linux-kselftest, linux-kernel, javier.carrasco.cruz,
	david.hunter.linux

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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/1] Improve missing mods error message and make shell script executable
  2024-08-20 20:21 [PATCH 1/1] Improve missing mods error message and make shell script executable David Hunter
@ 2024-08-22  1:02 ` Jakub Kicinski
  2024-08-23 19:08   ` David Hunter
  0 siblings, 1 reply; 8+ messages in thread
From: Jakub Kicinski @ 2024-08-22  1:02 UTC (permalink / raw)
  To: David Hunter
  Cc: davem, edumazet, pabeni, shuah, netdev, linux-kselftest,
	linux-kernel, javier.carrasco.cruz

On Tue, 20 Aug 2024 16:21:16 -0400 David Hunter wrote:
> Subject: [PATCH 1/1] Improve missing mods error message and make shell script executable

Would be good to add a prefix to the subject:

selftests: net:

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

Could you clarify how it gets skipped? We use make [...] run_tests
in our CI and it does seem to run.

> Also, 

If you say "also" there's a good chance the commit should be split into
two..

> 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

Do you have to loop again? Maybe just check if mods_missing is empty?

> -	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
-- 
pw-bot: cr

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Re: [PATCH 1/1] Improve missing mods error message and make shell script executable
  2024-08-22  1:02 ` 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
  0 siblings, 1 reply; 8+ messages in thread
From: David Hunter @ 2024-08-23 19:08 UTC (permalink / raw)
  To: kuba
  Cc: davem, david.hunter.linux, edumazet, javier.carrasco.cruz,
	linux-kernel, linux-kselftest, netdev, pabeni, shuah

> If you say "also" there's a good chance the commit should be split into two..

I am splitting original patch into 2 separate patches. I forgot to do the reply all command on kernel lore.  Here is the link to version 2 for the improving the missing modules error message:

https://lore.kernel.org/all/20240823054833.144612-1-david.hunter.linux@gmail.com/
Subject: [PATCH 1/1 V2] Selftests: net: Improve missing modules error message

> Could you clarify how it gets skipped? We use make [...] run_tests in our CI and it does seem to run.

Here is my set up:

$ uname -a 

- Linux dshunter-HP-Laptop-15-dy5xxx 6.11.0-rc2+ #2 SMP PREEMPT_DYNAMIC Tue Aug 20 14:31:34 EDT 2024 x86_64 x86_64 x86_64 GNU/Linux

Steps I took to produce the error:
	- use git clone to get the mainline source
	- run make -C tools/testing/selftests
	- make summary=1 -C tools/testing/selftests TARGETS=net run_tests

Output: 
# selftests: net: test_ingress_egress_chaining.sh
# Warning: file test_ingress_egress_chaining.sh is not executable

After running chmod +x on the shell script. The tests were able to be run.

Thanks, 
David 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/1 V2] Selftests: net: Set executable bit for shell script
  2024-08-23 19:08   ` David Hunter
@ 2024-08-24 14:38     ` David Hunter
  2024-08-26 16:10       ` patchwork-bot+netdevbpf
  2024-08-26 21:40       ` Jakub Kicinski
  0 siblings, 2 replies; 8+ messages in thread
From: David Hunter @ 2024-08-24 14:38 UTC (permalink / raw)
  To: david.hunter.linux
  Cc: davem, edumazet, javier.carrasco.cruz, kuba, linux-kernel,
	linux-kselftest, netdev, pabeni, shuah

Turn on the execution bit for the shell script file. The test is skipped
when downloaded from the linux_mainline source files.

Signed-off-by: David Hunter <david.hunter.linux@gmail.com>
---
V1 --> V2 
	- Split the patch into two separate patches (one for each issue)
	- Included subject prefixes
---
 tools/testing/selftests/net/test_ingress_egress_chaining.sh | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 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
-- 
2.43.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/1 V2] Selftests: net: Set executable bit for shell script
  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
  1 sibling, 0 replies; 8+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-08-26 16:10 UTC (permalink / raw)
  To: David Hunter
  Cc: davem, edumazet, javier.carrasco.cruz, kuba, linux-kernel,
	linux-kselftest, netdev, pabeni, shuah

Hello:

This patch was applied to netdev/net-next.git (main)
by Martin KaFai Lau <martin.lau@kernel.org>:

On Sat, 24 Aug 2024 10:38:37 -0400 you wrote:
> Turn on the execution bit for the shell script file. The test is skipped
> when downloaded from the linux_mainline source files.
> 
> Signed-off-by: David Hunter <david.hunter.linux@gmail.com>
> ---
> V1 --> V2
> 	- Split the patch into two separate patches (one for each issue)
> 	- Included subject prefixes
> 
> [...]

Here is the summary with links:
  - [1/1,V2] Selftests: net: Set executable bit for shell script
    https://git.kernel.org/netdev/net-next/c/39e8111ce5ce

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/1 V2] Selftests: net: Set executable bit for shell script
  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
  1 sibling, 1 reply; 8+ messages in thread
From: Jakub Kicinski @ 2024-08-26 21:40 UTC (permalink / raw)
  To: David Hunter
  Cc: davem, edumazet, javier.carrasco.cruz, linux-kernel,
	linux-kselftest, netdev, pabeni, shuah

On Sat, 24 Aug 2024 10:38:37 -0400 David Hunter wrote:
> Subject: [PATCH 1/1 V2] Selftests: net: Set executable bit for shell script

no need to capitalize Selftests

> Turn on the execution bit for the shell script file. The test is skipped
> when downloaded from the linux_mainline source files.

Change makes sense but I don't understand the commit message.
What is linux_mainline and how does one download from it?
I see an Arch package with similar name is that what you mean?

BTW ignore the pw-bot it gets confused by mode changes
-- 
pw-bot: cr

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/1 V2] Selftests: net: Set executable bit for shell script
  2024-08-26 21:40       ` Jakub Kicinski
@ 2024-08-27 21:37         ` David Hunter
  2024-08-27 21:44           ` Jakub Kicinski
  0 siblings, 1 reply; 8+ messages in thread
From: David Hunter @ 2024-08-27 21:37 UTC (permalink / raw)
  To: kuba
  Cc: davem, david.hunter.linux, edumazet, javier.carrasco.cruz,
	linux-kernel, linux-kselftest, netdev, pabeni, shuah

From: david.hunter.linux@gmail.com

On  Mon, 26 Aug 2024 14:40:22 -0700 Jakub Kicinski wrote:
> What is linux_mainline and how does one download from it?

The Linux Mainline source files can be downloaded using the following command:

git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git linux_mainline

I meant to say "Linux Mainline". In my computer, I put the title for the directory as "linux_mainline", so I have a habit of putting the underscore when I should not. 


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/1 V2] Selftests: net: Set executable bit for shell script
  2024-08-27 21:37         ` David Hunter
@ 2024-08-27 21:44           ` Jakub Kicinski
  0 siblings, 0 replies; 8+ messages in thread
From: Jakub Kicinski @ 2024-08-27 21:44 UTC (permalink / raw)
  To: David Hunter
  Cc: davem, edumazet, javier.carrasco.cruz, linux-kernel,
	linux-kselftest, netdev, pabeni, shuah

On Tue, 27 Aug 2024 17:37:21 -0400 David Hunter wrote:
> On  Mon, 26 Aug 2024 14:40:22 -0700 Jakub Kicinski wrote:
> > What is linux_mainline and how does one download from it?  
> 
> The Linux Mainline source files can be downloaded using the following command:
> 
> git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git linux_mainline
> 
> I meant to say "Linux Mainline". In my computer, I put the title for
> the directory as "linux_mainline", so I have a habit of putting the
> underscore when I should not. 

I see. But going back to the commit message - why would the files be
skipped? At some point you shared a warning which gets printed:

 # Warning: file test_ingress_egress_chaining.sh is not executable

that's a better thing to put in the commit message, than talking 
about downloading.

Keep in mind you need to put a space or two before the # otherwise
git will think it's a comment.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-08-27 21:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-20 20:21 [PATCH 1/1] Improve missing mods error message and make shell script executable David Hunter
2024-08-22  1:02 ` 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

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).