diff mbox series

[net-next,03/10] selftests: forwarding: bail_on_lldpad() should SKIP

Message ID 686eeb760a35f228bde1392ffa3f59462223db26.1712940759.git.petrm@nvidia.com (mailing list archive)
State Accepted
Commit 492976136bb9fac0ebda28a163561eea8c2896d5
Delegated to: Netdev Maintainers
Headers show
Series selftests: Assortment of fixes | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/build_tools success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/build_clang success Errors and warnings before: 8 this patch: 8
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success net selftest script(s) already in Makefile
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 17 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-04-15--15-00 (tests: 961)

Commit Message

Petr Machata April 12, 2024, 5:03 p.m. UTC
$ksft_skip is used to mark selftests that have tooling issues. The fact
that LLDPad is running, but shouldn't, is one such issue. Therefore have
bail_on_lldpad() bail with $ksft_skip.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Benjamin Poirier <bpoirier@nvidia.com>
---
 tools/testing/selftests/net/forwarding/lib.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Hangbin Liu April 15, 2024, 7:46 a.m. UTC | #1
On Fri, Apr 12, 2024 at 07:03:06PM +0200, Petr Machata wrote:
> $ksft_skip is used to mark selftests that have tooling issues. The fact
> that LLDPad is running, but shouldn't, is one such issue. Therefore have
> bail_on_lldpad() bail with $ksft_skip.
> 
> Signed-off-by: Petr Machata <petrm@nvidia.com>
> Reviewed-by: Benjamin Poirier <bpoirier@nvidia.com>
> ---
>  tools/testing/selftests/net/forwarding/lib.sh | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh
> index 3cbbc2fd4d7d..7913c6ee418d 100644
> --- a/tools/testing/selftests/net/forwarding/lib.sh
> +++ b/tools/testing/selftests/net/forwarding/lib.sh
> @@ -2138,6 +2138,8 @@ bail_on_lldpad()
>  {
>  	local reason1="$1"; shift
>  	local reason2="$1"; shift
> +	local caller=${FUNCNAME[1]}
> +	local src=${BASH_SOURCE[1]}
>  
>  	if systemctl is-active --quiet lldpad; then
>  
> @@ -2158,7 +2160,8 @@ bail_on_lldpad()
>  				an environment variable ALLOW_LLDPAD to a
>  				non-empty string.
>  			EOF
> -			exit 1
> +			log_test_skip $src:$caller
> +			exit $EXIT_STATUS
>  		else
>  			return
>  		fi
> -- 
> 2.43.0
> 
Reviewed-by: Hangbin Liu <liuhangbin@gmail.com>
diff mbox series

Patch

diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh
index 3cbbc2fd4d7d..7913c6ee418d 100644
--- a/tools/testing/selftests/net/forwarding/lib.sh
+++ b/tools/testing/selftests/net/forwarding/lib.sh
@@ -2138,6 +2138,8 @@  bail_on_lldpad()
 {
 	local reason1="$1"; shift
 	local reason2="$1"; shift
+	local caller=${FUNCNAME[1]}
+	local src=${BASH_SOURCE[1]}
 
 	if systemctl is-active --quiet lldpad; then
 
@@ -2158,7 +2160,8 @@  bail_on_lldpad()
 				an environment variable ALLOW_LLDPAD to a
 				non-empty string.
 			EOF
-			exit 1
+			log_test_skip $src:$caller
+			exit $EXIT_STATUS
 		else
 			return
 		fi