[PATCH testsuite] tests/key_socket: skip the test if CONFIG_NET_KEY is not enabled

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Ondrej Mosnacek <omosnace@xxxxxxxxxx>
---
 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 a13327f..3f371fe 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 #############
-- 
2.46.0





[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux