tests/key_socket: skip the test if CONFIG_NET_KEY is not enabled
PATCH 1/1 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
--- tests/key_socket/test | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
tests/key_socket/test +7 -1
@@ -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 #############
Signature · 1 line
2.46.0
Quoted 9 lines · Ondrej Mosnacek
RHEL/CentOS Stream 10+ and Fedora ELN will have
CONFIG_NET_KEYdisabled [1]. Make the test skip itself when it detects thatPF_KEYis 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 <[email protected]>
Wondering if we should drop NET_KEY from the testsuite defconfig too then.
Quoted 27 lines
--- tests/key_socket/test | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)tests/key_socket/test +7
-2@@ -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
Paul Moore
maintainerQuoted 8 lines · Stephen Smalley
Quoted 6 lines · Ondrej Mosnacek
RHEL/CentOS Stream 10+ and Fedora ELN will have
CONFIG_NET_KEYdisabled [1]. Make the test skip itself when it detects thatPF_KEYis not supported so that the testsuite can still pass out-of-the-box on these platforms.
Quoted 7 lines
Quoted 3 lines
[1] https://gitlab.com/cki-project/kernel-ark/-/commit/99d6d1c86fe1bb1df5c0b80f4717826c2330e291
Signed-off-by Ondrej Mosnacek <[email protected]>Acked-by Stephen Smalley <[email protected]>Wondering if we should drop
NET_KEYfrom the testsuite defconfig too then.
If we have a test for it, it seems like it might be worthwhile keeping it as long as the upstream kernel still supports PF_KEY. I'm not sure if Fedora plans to disable CONFIG_NET_KEY, but as of kernel v6.11.0-0.rc5.20240827xxx CONFIG_NET_KEY is still enabled as a module. Even if Fedora does disable it in their build I can enable it in my testing, I already do that now for a few things.
--
paul-moore.com
Quoted 17 lines · Paul Moore
Quoted 14 lines · Stephen Smalley
Quoted 9 lines · Ondrej Mosnacek
RHEL/CentOS Stream 10+ and Fedora ELN will have
CONFIG_NET_KEYdisabled [1]. Make the test skip itself when it detects thatPF_KEYis 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 <[email protected]>Acked-by Stephen Smalley <[email protected]>
Quoted 8 lines
Quoted 1 line
Wondering if we should drop
NET_KEYfrom the testsuite defconfig too then.If we have a test for it, it seems like it might be worthwhile keeping it as long as the upstream kernel still supports
PF_KEY. I'm not sure if Fedora plans to disableCONFIG_NET_KEY, but as of kernel v6.11.0-0.rc5.20240827xxxCONFIG_NET_KEYis still enabled as a module. Even if Fedora does disable it in their build I can enable it in my testing, I already do that now for a few things.
No, Fedora doesn't have any plans to disable it as far as I know. Fedora doesn't have any contractual obligation for maintenance and mostly just tracks the upstream kernel, so there is little motivation to disable functionality because of the lack of maintenance upstream. ("If it works, why risk breaking users? And if it doesn't, then upstream should be the one to remove it." seems to be the general philosophy in such cases.)
I agree with keeping it in defconfig - after all, CONFIG_ANDROID=y is also there, even though it isn't strictly required (and so are other configs).
Signature · 3 lines
Ondrej Mosnacek Senior Software Engineer, Linux Security - SELinux kernel Red Hat, Inc.
Quoted 36 lines · Ondrej Mosnacek
Quoted 17 lines · Paul Moore
Quoted 14 lines · Stephen Smalley
Quoted 9 lines · Ondrej Mosnacek
RHEL/CentOS Stream 10+ and Fedora ELN will have
CONFIG_NET_KEYdisabled [1]. Make the test skip itself when it detects thatPF_KEYis 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 <[email protected]>Acked-by Stephen Smalley <[email protected]>Quoted 8 lines
Quoted 1 line
Wondering if we should drop
NET_KEYfrom the testsuite defconfig too then.If we have a test for it, it seems like it might be worthwhile keeping it as long as the upstream kernel still supports
PF_KEY. I'm not sure if Fedora plans to disableCONFIG_NET_KEY, but as of kernel v6.11.0-0.rc5.20240827xxxCONFIG_NET_KEYis still enabled as a module. Even if Fedora does disable it in their build I can enable it in my testing, I already do that now for a few things.No, Fedora doesn't have any plans to disable it as far as I know. Fedora doesn't have any contractual obligation for maintenance and mostly just tracks the upstream kernel, so there is little motivation to disable functionality because of the lack of maintenance upstream. ("If it works, why risk breaking users? And if it doesn't, then upstream should be the one to remove it." seems to be the general philosophy in such cases.)
Quoted 3 lines
I agree with keeping it in defconfig - after all,
CONFIG_ANDROID=yis also there, even though it isn't strictly required (and so are other configs).
Now applied:
https://github.com/SELinuxProject/selinux-testsuite/commit/a9e631f0f1d5b11756a62679e8da073b3cc85b13
Signature · 3 lines
Ondrej Mosnacek Senior Software Engineer, Linux Security - SELinux kernel Red Hat, Inc.