selftests/tls: close the socket with open record
Add test which sends some data with MSG_MORE and then closes the socket (never calling send without MSG_MORE). This should make sure we clean up open records correctly. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
This commit is contained in:
parent
65d41fb317
commit
8051bb7f2c
|
@ -239,6 +239,16 @@ TEST_F(tls, msg_more)
|
|||
EXPECT_EQ(memcmp(buf, test_str, send_len), 0);
|
||||
}
|
||||
|
||||
TEST_F(tls, msg_more_unsent)
|
||||
{
|
||||
char const *test_str = "test_read";
|
||||
int send_len = 10;
|
||||
char buf[10];
|
||||
|
||||
EXPECT_EQ(send(self->fd, test_str, send_len, MSG_MORE), send_len);
|
||||
EXPECT_EQ(recv(self->cfd, buf, send_len, MSG_DONTWAIT), -1);
|
||||
}
|
||||
|
||||
TEST_F(tls, sendmsg_single)
|
||||
{
|
||||
struct msghdr msg;
|
||||
|
|
Loading…
Reference in New Issue