public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] selftests: net: check jq command is supported
@ 2025-10-10  3:30 Wang Liang
  2025-10-10 10:02 ` Hangbin Liu
  2025-10-10 14:56 ` Paolo Abeni
  0 siblings, 2 replies; 4+ messages in thread
From: Wang Liang @ 2025-10-10  3:30 UTC (permalink / raw)
  To: davem, edumazet, kuba, pabeni, horms, shuah
  Cc: netdev, linux-kselftest, linux-kernel, yuehaibing,
	zhangchangzhong, wangliang74

The jq command is used in vlan_bridge_binding.sh, if it is not supported,
the test will spam the following log.

  # ./vlan_bridge_binding.sh: line 51: jq: command not found
  # ./vlan_bridge_binding.sh: line 51: jq: command not found
  # ./vlan_bridge_binding.sh: line 51: jq: command not found
  # ./vlan_bridge_binding.sh: line 51: jq: command not found
  # ./vlan_bridge_binding.sh: line 51: jq: command not found
  # TEST: Test bridge_binding on->off when lower down                   [FAIL]
  #       Got operstate of , expected 0

The rtnetlink.sh has the same problem. It makes sense to check if jq is
installed before running these tests. After this patch, the
vlan_bridge_binding.sh skipped if jq is not supported:

  # timeout set to 3600
  # selftests: net: vlan_bridge_binding.sh
  # TEST: jq not installed                                              [SKIP]

Signed-off-by: Wang Liang <wangliang74@huawei.com>
---
 tools/testing/selftests/net/rtnetlink.sh           | 2 ++
 tools/testing/selftests/net/vlan_bridge_binding.sh | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/tools/testing/selftests/net/rtnetlink.sh b/tools/testing/selftests/net/rtnetlink.sh
index dbf77513f617..163a084d525d 100755
--- a/tools/testing/selftests/net/rtnetlink.sh
+++ b/tools/testing/selftests/net/rtnetlink.sh
@@ -1466,6 +1466,8 @@ usage: ${0##*/} OPTS
 EOF
 }
 
+require_command jq
+
 #check for needed privileges
 if [ "$(id -u)" -ne 0 ];then
 	end_test "SKIP: Need root privileges"
diff --git a/tools/testing/selftests/net/vlan_bridge_binding.sh b/tools/testing/selftests/net/vlan_bridge_binding.sh
index db481af9b6b3..e8c02c64e03a 100755
--- a/tools/testing/selftests/net/vlan_bridge_binding.sh
+++ b/tools/testing/selftests/net/vlan_bridge_binding.sh
@@ -249,6 +249,8 @@ test_binding_toggle_off_when_upper_down()
 	do_test_binding_off : "on->off when upper down"
 }
 
+require_command jq
+
 trap defer_scopes_cleanup EXIT
 setup_prepare
 tests_run
-- 
2.34.1


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

* Re: [PATCH net-next] selftests: net: check jq command is supported
  2025-10-10  3:30 [PATCH net-next] selftests: net: check jq command is supported Wang Liang
@ 2025-10-10 10:02 ` Hangbin Liu
  2025-10-10 14:56 ` Paolo Abeni
  1 sibling, 0 replies; 4+ messages in thread
From: Hangbin Liu @ 2025-10-10 10:02 UTC (permalink / raw)
  To: Wang Liang
  Cc: davem, edumazet, kuba, pabeni, horms, shuah, netdev,
	linux-kselftest, linux-kernel, yuehaibing, zhangchangzhong

On Fri, Oct 10, 2025 at 11:30:43AM +0800, Wang Liang wrote:
> The jq command is used in vlan_bridge_binding.sh, if it is not supported,
> the test will spam the following log.
> 
>   # ./vlan_bridge_binding.sh: line 51: jq: command not found
>   # ./vlan_bridge_binding.sh: line 51: jq: command not found
>   # ./vlan_bridge_binding.sh: line 51: jq: command not found
>   # ./vlan_bridge_binding.sh: line 51: jq: command not found
>   # ./vlan_bridge_binding.sh: line 51: jq: command not found
>   # TEST: Test bridge_binding on->off when lower down                   [FAIL]
>   #       Got operstate of , expected 0
> 
> The rtnetlink.sh has the same problem. It makes sense to check if jq is
> installed before running these tests. After this patch, the
> vlan_bridge_binding.sh skipped if jq is not supported:
> 
>   # timeout set to 3600
>   # selftests: net: vlan_bridge_binding.sh
>   # TEST: jq not installed                                              [SKIP]
> 
> Signed-off-by: Wang Liang <wangliang74@huawei.com>
> ---
>  tools/testing/selftests/net/rtnetlink.sh           | 2 ++
>  tools/testing/selftests/net/vlan_bridge_binding.sh | 2 ++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/tools/testing/selftests/net/rtnetlink.sh b/tools/testing/selftests/net/rtnetlink.sh
> index dbf77513f617..163a084d525d 100755
> --- a/tools/testing/selftests/net/rtnetlink.sh
> +++ b/tools/testing/selftests/net/rtnetlink.sh
> @@ -1466,6 +1466,8 @@ usage: ${0##*/} OPTS
>  EOF
>  }
>  
> +require_command jq
> +
>  #check for needed privileges
>  if [ "$(id -u)" -ne 0 ];then
>  	end_test "SKIP: Need root privileges"
> diff --git a/tools/testing/selftests/net/vlan_bridge_binding.sh b/tools/testing/selftests/net/vlan_bridge_binding.sh
> index db481af9b6b3..e8c02c64e03a 100755
> --- a/tools/testing/selftests/net/vlan_bridge_binding.sh
> +++ b/tools/testing/selftests/net/vlan_bridge_binding.sh
> @@ -249,6 +249,8 @@ test_binding_toggle_off_when_upper_down()
>  	do_test_binding_off : "on->off when upper down"
>  }
>  
> +require_command jq
> +
>  trap defer_scopes_cleanup EXIT
>  setup_prepare
>  tests_run
> -- 
> 2.34.1
> 

Reviewed-by: Hangbin Liu <liuhangbin@gmail.com>

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

* Re: [PATCH net-next] selftests: net: check jq command is supported
  2025-10-10  3:30 [PATCH net-next] selftests: net: check jq command is supported Wang Liang
  2025-10-10 10:02 ` Hangbin Liu
@ 2025-10-10 14:56 ` Paolo Abeni
  2025-10-11  3:26   ` Wang Liang
  1 sibling, 1 reply; 4+ messages in thread
From: Paolo Abeni @ 2025-10-10 14:56 UTC (permalink / raw)
  To: Wang Liang, davem, edumazet, kuba, horms, shuah
  Cc: netdev, linux-kselftest, linux-kernel, yuehaibing,
	zhangchangzhong

On 10/10/25 5:30 AM, Wang Liang wrote:
> The jq command is used in vlan_bridge_binding.sh, if it is not supported,
> the test will spam the following log.
> 
>   # ./vlan_bridge_binding.sh: line 51: jq: command not found
>   # ./vlan_bridge_binding.sh: line 51: jq: command not found
>   # ./vlan_bridge_binding.sh: line 51: jq: command not found
>   # ./vlan_bridge_binding.sh: line 51: jq: command not found
>   # ./vlan_bridge_binding.sh: line 51: jq: command not found
>   # TEST: Test bridge_binding on->off when lower down                   [FAIL]
>   #       Got operstate of , expected 0
> 
> The rtnetlink.sh has the same problem. It makes sense to check if jq is
> installed before running these tests. After this patch, the
> vlan_bridge_binding.sh skipped if jq is not supported:
> 
>   # timeout set to 3600
>   # selftests: net: vlan_bridge_binding.sh
>   # TEST: jq not installed                                              [SKIP]
> 
> Signed-off-by: Wang Liang <wangliang74@huawei.com>

This looks more a fix than net-next material (and net-next is currently
closed for the merge window).

Please re-post for net including suitable fixes tag(s). You can retain
Hangbin's ack.

Thanks,

Paolo


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

* Re: [PATCH net-next] selftests: net: check jq command is supported
  2025-10-10 14:56 ` Paolo Abeni
@ 2025-10-11  3:26   ` Wang Liang
  0 siblings, 0 replies; 4+ messages in thread
From: Wang Liang @ 2025-10-11  3:26 UTC (permalink / raw)
  To: Paolo Abeni
  Cc: netdev, linux-kselftest, linux-kernel, yuehaibing,
	zhangchangzhong


在 2025/10/10 22:56, Paolo Abeni 写道:
> On 10/10/25 5:30 AM, Wang Liang wrote:
>> The jq command is used in vlan_bridge_binding.sh, if it is not supported,
>> the test will spam the following log.
>>
>>    # ./vlan_bridge_binding.sh: line 51: jq: command not found
>>    # ./vlan_bridge_binding.sh: line 51: jq: command not found
>>    # ./vlan_bridge_binding.sh: line 51: jq: command not found
>>    # ./vlan_bridge_binding.sh: line 51: jq: command not found
>>    # ./vlan_bridge_binding.sh: line 51: jq: command not found
>>    # TEST: Test bridge_binding on->off when lower down                   [FAIL]
>>    #       Got operstate of , expected 0
>>
>> The rtnetlink.sh has the same problem. It makes sense to check if jq is
>> installed before running these tests. After this patch, the
>> vlan_bridge_binding.sh skipped if jq is not supported:
>>
>>    # timeout set to 3600
>>    # selftests: net: vlan_bridge_binding.sh
>>    # TEST: jq not installed                                              [SKIP]
>>
>> Signed-off-by: Wang Liang <wangliang74@huawei.com>
> This looks more a fix than net-next material (and net-next is currently
> closed for the merge window).
>
> Please re-post for net including suitable fixes tag(s). You can retain
> Hangbin's ack.
>
> Thanks,
>
> Paolo


Thanks for your reminder!

I missed the ANN e-mail when I was in Chinese National Day vacation. I will
repost this patch for net later.

------
Best regards
Wang Liang

>

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

end of thread, other threads:[~2025-10-11  3:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-10  3:30 [PATCH net-next] selftests: net: check jq command is supported Wang Liang
2025-10-10 10:02 ` Hangbin Liu
2025-10-10 14:56 ` Paolo Abeni
2025-10-11  3:26   ` Wang Liang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox