Skip to contentSkip to conversation

selftests: tls: skip cmsg_to_pipe tests with TLS=n

PATCH Applied Jakub Kicinski 3 participants 3 messages Mar 25, 2022 – Mar 26, 2022

Subsystems (4)
lore
Share & tools
lore

Jakub Kicinski

author maintainer
#0 lore raw

PATCH 1/1 selftests: tls: skip cmsg_to_pipe tests with TLS=n

These are negative tests, testing TLS code rejects certain operations. They won't pass without TLS enabled, pure TCP accepts those operations.

Fixes d87d67fd61ef ("selftests: tls: test splicing cmsgs")
---
 tools/testing/selftests/net/tls.c | 6 ++++++
 1 file changed, 6 insertions(+)
tools/testing/selftests/net/tls.c +6 -0
index 6e468e0f42f7..5d70b04c482c 100644
@@ -683,6 +683,9 @@ TEST_F(tls, splice_cmsg_to_pipe)
 	char buf[10];
 	int p[2];
 
+	if (self->notls)
+		SKIP(return, "no TLS support");
+
 	ASSERT_GE(pipe(p), 0);
 	EXPECT_EQ(tls_send_cmsg(self->fd, 100, test_str, send_len, 0), 10);
 	EXPECT_EQ(splice(self->cfd, NULL, p[1], NULL, send_len, 0), -1);
@@ -703,6 +706,9 @@ TEST_F(tls, splice_dec_cmsg_to_pipe)
 	char buf[10];
 	int p[2];
 
+	if (self->notls)
+		SKIP(return, "no TLS support");
+
 	ASSERT_GE(pipe(p), 0);
 	EXPECT_EQ(tls_send_cmsg(self->fd, 100, test_str, send_len, 0), 10);
 	EXPECT_EQ(recv(self->cfd, buf, send_len, 0), -1);
Signature · 1 line
2.34.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 27 lines · Jakub Kicinski

These are negative tests, testing TLS code rejects certain operations. They won't pass without TLS enabled, pure TCP accepts those operations.

Fixes d87d67fd61ef ("selftests: tls: test splicing cmsgs")
---
  tools/testing/selftests/net/tls.c | 6 ++++++
  1 file changed, 6 insertions(+)
tools/testing/selftests/net/tls.c +3 -0
index 6e468e0f42f7..5d70b04c482c 100644
@@ -683,6 +683,9 @@ TEST_F(tls, splice_cmsg_to_pipe)
  	char buf[10];
  	int p[2];
 
+	if (self->notls)
+		SKIP(return, "no TLS support");
+
  	ASSERT_GE(pipe(p), 0);
  	EXPECT_EQ(tls_send_cmsg(self->fd, 100, test_str, send_len, 0), 10);
  	EXPECT_EQ(splice(self->cfd, NULL, p[1], NULL, send_len, 0), -1);

tools/testing/selftests/net/tls.c TEST_F(tls, splice_dec_cmsg_to_pipe) · line 714

Quoted 9 lines
tools/testing/selftests/net/tls.c +3 -0
@@ -703,6 +706,9 @@ TEST_F(tls, splice_dec_cmsg_to_pipe)
  	char buf[10];
  	int p[2];
 
+	if (self->notls)
+		SKIP(return, "no TLS support");
+
  	ASSERT_GE(pipe(p), 0);
  	EXPECT_EQ(tls_send_cmsg(self->fd, 100, test_str, send_len, 0), 10);
  	EXPECT_EQ(recv(self->cfd, buf, send_len, 0), -1);

Looks good to me. Thanks for the fix.

thanks,
-- Shuah

#2 lore raw
In reply to Jakub Kicinski
This patch was applied to netdev/net.git (master) by David S. Miller <[email protected]>:

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <[email protected]>:

Quoted 9 lines · On Fri, 25 Mar 2022 16:27:09 -0700 you wrote:

These are negative tests, testing TLS code rejects certain operations. They won't pass without TLS enabled, pure TCP accepts those operations.

Fixes d87d67fd61ef ("selftests: tls: test splicing cmsgs")

[...]

Here is the summary with links:
- [net] selftests: tls: skip cmsg_to_pipe tests with TLS=n

    https://git.kernel.org/netdev/net/c/5c7e49be96ea

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html