From a9e631f0f1d5b11756a62679e8da073b3cc85b13 Mon Sep 17 00:00:00 2001 From: Ondrej Mosnacek Date: Tue, 27 Aug 2024 11:48:38 +0200 Subject: [PATCH] tests/key_socket: skip the test if CONFIG_NET_KEY is not enabled RHEL/CentOS Stream 10+ and Fedora ELN will have CONFIG_NET_KEY disabled [1]. Make the test skip itself when it detects that PF_KEY is not supported so that the testsuite can still pass out-of-the-box on these platforms. [1] https://gitlab.com/cki-project/kernel-ark/-/commit/99d6d1c86fe1bb1df5c0b80f4717826c2330e291 Acked-by: Stephen Smalley Signed-off-by: Ondrej Mosnacek --- tests/key_socket/test | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/key_socket/test b/tests/key_socket/test index a13327fd..3f371fe4 100755 --- a/tests/key_socket/test +++ b/tests/key_socket/test @@ -16,7 +16,13 @@ BEGIN { $v = " "; } - plan tests => 5; + $result = system "$basedir/key_sock $v 2>&1"; + if ( $result >> 8 eq 97 ) { # EAFNOSUPPORT + plan skip_all => "PF_KEY not supported by kernel"; + } + else { + plan tests => 5; + } } ############ Test key_socket #############