projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c004b0e
)
selftests/net/tls: add test for MSG_EOR
author
Hannes Reinecke
<hare@suse.de>
Wed, 26 Jul 2023 19:15:53 +0000
(21:15 +0200)
committer
Jakub Kicinski
<kuba@kernel.org>
Fri, 28 Jul 2023 02:49:34 +0000
(19:49 -0700)
As the recent patch is modifying the behaviour for TLS re MSG_EOR
handling we should be having a test for it.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Link:
https://lore.kernel.org/r/20230726191556.41714-4-hare@suse.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/tls.c
patch
|
blob
|
history
diff --git
a/tools/testing/selftests/net/tls.c
b/tools/testing/selftests/net/tls.c
index
a3c5700
..
4b63708
100644
(file)
--- a/
tools/testing/selftests/net/tls.c
+++ b/
tools/testing/selftests/net/tls.c
@@
-486,6
+486,17
@@
TEST_F(tls, msg_more_unsent)
EXPECT_EQ(recv(self->cfd, buf, send_len, MSG_DONTWAIT), -1);
}
+TEST_F(tls, msg_eor)
+{
+ char const *test_str = "test_read";
+ int send_len = 10;
+ char buf[10];
+
+ EXPECT_EQ(send(self->fd, test_str, send_len, MSG_EOR), send_len);
+ EXPECT_EQ(recv(self->cfd, buf, send_len, MSG_WAITALL), send_len);
+ EXPECT_EQ(memcmp(buf, test_str, send_len), 0);
+}
+
TEST_F(tls, sendmsg_single)
{
struct msghdr msg;