* [PATCH net-next v1] selftests/tls: Add test for recv(PEEK) spanning across multiple records
@ 2018-08-29 10:00 Vakul Garg
2018-09-01 1:00 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Vakul Garg @ 2018-08-29 10:00 UTC (permalink / raw)
To: netdev; +Cc: borisp, aviadye, davejwatson, davem, Vakul Garg
Added test case to receive multiple records with a single recvmsg()
operation with a MSG_PEEK set.
---
tools/testing/selftests/net/tls.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/tools/testing/selftests/net/tls.c b/tools/testing/selftests/net/tls.c
index b3ebf2646e52..07daff076ce0 100644
--- a/tools/testing/selftests/net/tls.c
+++ b/tools/testing/selftests/net/tls.c
@@ -502,6 +502,28 @@ TEST_F(tls, recv_peek_multiple)
EXPECT_EQ(memcmp(test_str, buf, send_len), 0);
}
+TEST_F(tls, recv_peek_large_buf_mult_recs)
+{
+ char const *test_str = "test_read_peek_mult_recs";
+ char const *test_str_first = "test_read_peek";
+ char const *test_str_second = "_mult_recs";
+ int len;
+ char buf[64];
+
+ len = strlen(test_str_first);
+ EXPECT_EQ(send(self->fd, test_str_first, len, 0), len);
+
+ len = strlen(test_str_second) + 1;
+ EXPECT_EQ(send(self->fd, test_str_second, len, 0), len);
+
+ len = sizeof(buf);
+ memset(buf, 0, len);
+ EXPECT_NE(recv(self->cfd, buf, len, MSG_PEEK), -1);
+
+ len = strlen(test_str) + 1;
+ EXPECT_EQ(memcmp(test_str, buf, len), 0);
+}
+
TEST_F(tls, pollin)
{
char const *test_str = "test_poll";
--
2.13.6
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next v1] selftests/tls: Add test for recv(PEEK) spanning across multiple records
2018-08-29 10:00 [PATCH net-next v1] selftests/tls: Add test for recv(PEEK) spanning across multiple records Vakul Garg
@ 2018-09-01 1:00 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-09-01 1:00 UTC (permalink / raw)
To: vakul.garg; +Cc: netdev, borisp, aviadye, davejwatson
From: Vakul Garg <vakul.garg@nxp.com>
Date: Wed, 29 Aug 2018 15:30:14 +0530
> Added test case to receive multiple records with a single recvmsg()
> operation with a MSG_PEEK set.
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-09-01 5:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-29 10:00 [PATCH net-next v1] selftests/tls: Add test for recv(PEEK) spanning across multiple records Vakul Garg
2018-09-01 1:00 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.