Skip to contentSkip to conversation

syscalls/send02: Improve message

PATCH New Yang Xu 2 participants 5 messages Oct 16, 2020 – Oct 19, 2020

lore
Share & tools
lore

Yang Xu

author
#0 lore raw

PATCH 1/1 syscalls/send02: Improve message

This case sometimes fails, output as below:

tst_test.c:1250: TINFO: Timeout per run is 0h 05m 00s send02.c:86: TFAIL: recv() error: EAGAIN/EWOULDBLOCK (11) send02.c:86: TFAIL: recv() error: EAGAIN/EWOULDBLOCK (11) send02.c:86: TFAIL: recv() error: EAGAIN/EWOULDBLOCK (11) send02.c:86: TFAIL: recv() error: EAGAIN/EWOULDBLOCK (11)

From this output, we don't know which subcase fails(tcp,udp,send,sendto). So add some message and make this clear.

Now this case fails as below:
tst_test.c:1250: TINFO: Timeout per run is 0h 05m 00s
send02.c:124: TINFO: Testing TCP send
send02.c:87: TFAIL: recv() error at the 776 times(expsize 17): EAGAIN/EWOULDBLOCK (11) send02.c:124: TINFO: Testing UDP send
send02.c:87: TFAIL: recv() error at the 1 times(expsize 16): EAGAIN/EWOULDBLOCK (11) send02.c:124: TINFO: Testing UDP sendto
send02.c:87: TFAIL: recv() error at the 1 times(expsize 16): EAGAIN/EWOULDBLOCK (11) send02.c:124: TINFO: Testing UDP sendmsg
send02.c:87: TFAIL: recv() error at the 1 times(expsize 16): EAGAIN/EWOULDBLOCK (11)

---
 testcases/kernel/syscalls/send/send02.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)
testcases/kernel/syscalls/send/send02.c +11 -9
index 5630230fa..719e86a90 100644
@@ -71,7 +71,7 @@ static void setup(void)
 	memset(sendbuf, 0x42, SENDSIZE);
 }
 
-static int check_recv(int sock, long expsize)
+static int check_recv(int sock, long expsize, int loop)
 {
 	char recvbuf[RECVSIZE] = {0};
 
@@ -83,19 +83,20 @@ static int check_recv(int sock, long expsize)
 			return 1;
 
 		/* unexpected error */
-		tst_res(TFAIL | TTERRNO, "recv() error");
+		tst_res(TFAIL | TTERRNO, "recv() error at the %d times(expsize"
+			" %ld)", loop, expsize);
 		return 0;
 	}
 
 	if (TST_RET < 0) {
-		tst_res(TFAIL | TTERRNO, "Invalid recv() return value %ld",
-			TST_RET);
+		tst_res(TFAIL | TTERRNO, "Invalid recv() return value %ld at"
+			" the %d times(expsize %ld)", TST_RET, loop, expsize);
 		return 0;
 	}
 
 	if (TST_RET != expsize) {
-		tst_res(TFAIL, "recv() read %ld bytes, expected %ld", TST_RET,
-			expsize);
+		tst_res(TFAIL, "recv() read %ld bytes, expected %ld@the"
+			" %d times", TST_RET, expsize, loop);
 		return 0;
 	}
 
@@ -120,6 +121,7 @@ static void run(unsigned int n)
 	struct test_case *tc = testcase_list + n;
 	socklen_t len = sizeof(addr);
 
+	tst_res(TINFO, "Testing %s", tc->name);
 	tst_init_sockaddr_inet_bin(&addr, INADDR_LOOPBACK, 0);
 	listen_sock = SAFE_SOCKET(tc->domain, tc->type, tc->protocol);
 	dst_sock = listen_sock;
@@ -139,19 +141,19 @@ static void run(unsigned int n)
 			dst_sock = SAFE_ACCEPT(listen_sock, NULL, NULL);
 
 		tc->send(sock, sendbuf, SENDSIZE, 0);
-		ret = check_recv(dst_sock, SENDSIZE);
+		ret = check_recv(dst_sock, SENDSIZE, i + 1);
 
 		if (!ret)
 			break;
 
 		tc->send(sock, sendbuf, SENDSIZE, MSG_MORE);
-		ret = check_recv(dst_sock, 0);
+		ret = check_recv(dst_sock, 0, i + 1);
 
 		if (!ret)
 			break;
 
 		tc->send(sock, sendbuf, 1, 0);
-		ret = check_recv(dst_sock, SENDSIZE + 1);
+		ret = check_recv(dst_sock, SENDSIZE + 1, i + 1);
 
 		if (!ret)
 			break;
Signature · 1 line
2.23.0
#1 lore raw

PATCH 1/1 syscalls/send02: Improve message

Quoted 8 lines · Yang Xu

This case sometimes fails, output as below:

tst_test.c:1250: TINFO: Timeout per run is 0h 05m 00s send02.c:86: TFAIL: recv() error: EAGAIN/EWOULDBLOCK (11) send02.c:86: TFAIL: recv() error: EAGAIN/EWOULDBLOCK (11) send02.c:86: TFAIL: recv() error: EAGAIN/EWOULDBLOCK (11) send02.c:86: TFAIL: recv() error: EAGAIN/EWOULDBLOCK (11)

Quoted 7 lines

From this output, we don't know which subcase fails(tcp,udp,send,sendto). So add some message and make this clear.

Now this case fails as below:
tst_test.c:1250: TINFO: Timeout per run is 0h 05m 00s
send02.c:124: TINFO: Testing TCP send
send02.c:87: TFAIL: recv() error at the 776 times(expsize 17): EAGAIN/EWOULDBLOCK (11)

recv(..., MSG_DONTWAIT) can fail with EAGAIN/EWOULDBLOCK at any time, so it should be a valid error... why it is a failure in the test?

If we expect some message to receive, we should call recv() again for EAGAIN/EWOULDBLOCK errors. And with MSG_MORE case, just return immediately, i.e. something like this:

       while (1) {
                TEST(recv(sock, recvbuf, RECVSIZE, MSG_DONTWAIT));

                if (TST_RET == -1) {
                        if (TST_ERR == EAGAIN || TST_ERR == EWOULDBLOCK) {
                                if (expsize)
                                        continue;
                                else
                                        break;
                        }

                        /* unexpected error */
                        tst_res(TFAIL | TTERRNO, "recv() error, expsize %ld, it %d", expsize, i);
                        return 0;
                }

		if (TST_RET < 0) {
                        tst_res(TFAIL | TTERRNO, "Invalid recv() return value %ld",
                                TST_RET);
                        return 0;
                }

                if (!expsize || TST_RET != expsize) {
                        tst_res(TFAIL, "recv() read %ld bytes, expected %ld", TST_RET,
                                expsize);
                        return 0;
                }

		break;
	}
Quoted 26 lines

send02.c:124: TINFO: Testing UDP send
send02.c:87: TFAIL: recv() error at the 1 times(expsize 16): EAGAIN/EWOULDBLOCK (11) send02.c:124: TINFO: Testing UDP sendto
send02.c:87: TFAIL: recv() error at the 1 times(expsize 16): EAGAIN/EWOULDBLOCK (11) send02.c:124: TINFO: Testing UDP sendmsg
send02.c:87: TFAIL: recv() error at the 1 times(expsize 16): EAGAIN/EWOULDBLOCK (11)

---
 testcases/kernel/syscalls/send/send02.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)
testcases/kernel/syscalls/send/send02.c +1 -1
index 5630230fa..719e86a90 100644
@@ -71,7 +71,7 @@ static void setup(void)
 	memset(sendbuf, 0x42, SENDSIZE);
 }
 
-static int check_recv(int sock, long expsize)
+static int check_recv(int sock, long expsize, int loop)
 {
 	char recvbuf[RECVSIZE] = {0};
 

testcases/kernel/syscalls/send/send02.c static int check_recv(int sock, long expsize) · line 87

Quoted 6 lines
testcases/kernel/syscalls/send/send02.c +2 -1
@@ -83,19 +83,20 @@ static int check_recv(int sock, long expsize)
 			return 1;
 
 		/* unexpected error */
-		tst_res(TFAIL | TTERRNO, "recv() error");
+		tst_res(TFAIL | TTERRNO, "recv() error at the %d times(expsize"
+			" %ld)", loop, expsize);

It's better to have a single line message, and arguments on another one:
tst_res(TFAIL | TTERRNO, "recv() error at step %d, expsize %ld",

        ...);
Quoted 51 lines
testcases/kernel/syscalls/send/send02.c +8 -7
 		return 0;
 	}
 
 	if (TST_RET < 0) {
-		tst_res(TFAIL | TTERRNO, "Invalid recv() return value %ld",
-			TST_RET);
+		tst_res(TFAIL | TTERRNO, "Invalid recv() return value %ld at"
+			" the %d times(expsize %ld)", TST_RET, loop, expsize);
 		return 0;
 	}
 
 	if (TST_RET != expsize) {
-		tst_res(TFAIL, "recv() read %ld bytes, expected %ld", TST_RET,
-			expsize);
+		tst_res(TFAIL, "recv() read %ld bytes, expected %ld at the"
+			" %d times", TST_RET, expsize, loop);
 		return 0;
 	}
 
@@ -120,6 +121,7 @@ static void run(unsigned int n)
 	struct test_case *tc = testcase_list + n;
 	socklen_t len = sizeof(addr);
 
+	tst_res(TINFO, "Testing %s", tc->name);
 	tst_init_sockaddr_inet_bin(&addr, INADDR_LOOPBACK, 0);
 	listen_sock = SAFE_SOCKET(tc->domain, tc->type, tc->protocol);
 	dst_sock = listen_sock;
@@ -139,19 +141,19 @@ static void run(unsigned int n)
 			dst_sock = SAFE_ACCEPT(listen_sock, NULL, NULL);
 
 		tc->send(sock, sendbuf, SENDSIZE, 0);
-		ret = check_recv(dst_sock, SENDSIZE);
+		ret = check_recv(dst_sock, SENDSIZE, i + 1);
 
 		if (!ret)
 			break;
 
 		tc->send(sock, sendbuf, SENDSIZE, MSG_MORE);
-		ret = check_recv(dst_sock, 0);
+		ret = check_recv(dst_sock, 0, i + 1);
 
 		if (!ret)
 			break;
 
 		tc->send(sock, sendbuf, 1, 0);
-		ret = check_recv(dst_sock, SENDSIZE + 1);
+		ret = check_recv(dst_sock, SENDSIZE + 1, i + 1);
 
 		if (!ret)
 			break;
author
#2 lore raw

PATCH 1/1 syscalls/send02: Improve message

Hi Alexey

Quoted 12 lines · Yang Xu
Quoted 11 lines

This case sometimes fails, output as below:

tst_test.c:1250: TINFO: Timeout per run is 0h 05m 00s send02.c:86: TFAIL: recv() error: EAGAIN/EWOULDBLOCK (11) send02.c:86: TFAIL: recv() error: EAGAIN/EWOULDBLOCK (11) send02.c:86: TFAIL: recv() error: EAGAIN/EWOULDBLOCK (11) send02.c:86: TFAIL: recv() error: EAGAIN/EWOULDBLOCK (11)

From this output, we don't know which subcase fails(tcp,udp,send,sendto).
So add some message and make this clear.

Quoted 7 lines
Quoted 4 lines

Now this case fails as below:
tst_test.c:1250: TINFO: Timeout per run is 0h 05m 00s
send02.c:124: TINFO: Testing TCP send
send02.c:87: TFAIL: recv() error at the 776 times(expsize 17): EAGAIN/EWOULDBLOCK (11)

recv(..., MSG_DONTWAIT) can fail with EAGAIN/EWOULDBLOCK at any time, so it should be a valid error... why it is a failure in the test?

I guess it only sends a small data and works well on most machines, so we think it is a failure.

Quoted 27 lines

If we expect some message to receive, we should call recv() again for EAGAIN/EWOULDBLOCK errors. And with MSG_MORE case, just return immediately, i.e. something like this:

        while (1) {
                 TEST(recv(sock, recvbuf, RECVSIZE, MSG_DONTWAIT));

                 if (TST_RET == -1) {
                         if (TST_ERR == EAGAIN || TST_ERR == EWOULDBLOCK) {
                                 if (expsize)
                                         continue;
                                 else
                                         break;
                         }

                         /* unexpected error */
                         tst_res(TFAIL | TTERRNO, "recv() error, expsize %ld, it %d", expsize, i);
                         return 0;
                 }

		if (TST_RET<  0) {
                         tst_res(TFAIL | TTERRNO, "Invalid recv() return value %ld",
                                 TST_RET);
                         return 0;
                 }
Quoted 8 lines
                 if (!expsize || TST_RET != expsize) {
                         tst_res(TFAIL, "recv() read %ld bytes, expected %ld", TST_RET,
                                 expsize);
                         return 0;
                 }

		break;
	}

It looks ok. This test only checks MSG_MORE whether can get EAGAIN/EWOULDBLOCK erro immediately, so for other situations, we just ensure it can receive message sucessfully.

Quoted 30 lines
Quoted 30 lines

send02.c:124: TINFO: Testing UDP send
send02.c:87: TFAIL: recv() error at the 1 times(expsize 16): EAGAIN/EWOULDBLOCK (11) send02.c:124: TINFO: Testing UDP sendto
send02.c:87: TFAIL: recv() error at the 1 times(expsize 16): EAGAIN/EWOULDBLOCK (11) send02.c:124: TINFO: Testing UDP sendmsg
send02.c:87: TFAIL: recv() error at the 1 times(expsize 16): EAGAIN/EWOULDBLOCK (11)

---
  testcases/kernel/syscalls/send/send02.c | 20 +++++++++++---------
  1 file changed, 11 insertions(+), 9 deletions(-)
testcases/kernel/syscalls/send/send02.c +1 -1
index 5630230fa..719e86a90 100644
@@ -71,7 +71,7 @@ static void setup(void)
  	memset(sendbuf, 0x42, SENDSIZE);
  }
 
-static int check_recv(int sock, long expsize)
+static int check_recv(int sock, long expsize, int loop)
  {
  	char recvbuf[RECVSIZE] = {0};
 
@@ -83,19 +83,20 @@ static int check_recv(int sock, long expsize)
  			return 1;
 
Quoted 8 lines

testcases/kernel/syscalls/send/send02.c static int check_recv(int sock, long expsize) · line 87

Quoted 4 lines
testcases/kernel/syscalls/send/send02.c +2 -1
  		/* unexpected error */
-		tst_res(TFAIL | TTERRNO, "recv() error");
+		tst_res(TFAIL | TTERRNO, "recv() error at the %d times(expsize"
+			" %ld)", loop, expsize);

It's better to have a single line message, and arguments on another one:
tst_res(TFAIL | TTERRNO, "recv() error at step %d, expsize %ld",

         ...);

OK. Will do it in v2 patch

Best Regards
Yang Xu

Quoted 57 lines
Quoted 42 lines
testcases/kernel/syscalls/send/send02.c +7 -6
  		return 0;
  	}
 
  	if (TST_RET<  0) {
-		tst_res(TFAIL | TTERRNO, "Invalid recv() return value %ld",
-			TST_RET);
+		tst_res(TFAIL | TTERRNO, "Invalid recv() return value %ld at"
+			" the %d times(expsize %ld)", TST_RET, loop, expsize);
  		return 0;
  	}
 
  	if (TST_RET != expsize) {
-		tst_res(TFAIL, "recv() read %ld bytes, expected %ld", TST_RET,
-			expsize);
+		tst_res(TFAIL, "recv() read %ld bytes, expected %ld at the"
+			" %d times", TST_RET, expsize, loop);
  		return 0;
  	}
 
@@ -120,6 +121,7 @@ static void run(unsigned int n)
  	struct test_case *tc = testcase_list + n;
  	socklen_t len = sizeof(addr);
 
+	tst_res(TINFO, "Testing %s", tc->name);
  	tst_init_sockaddr_inet_bin(&addr, INADDR_LOOPBACK, 0);
  	listen_sock = SAFE_SOCKET(tc->domain, tc->type, tc->protocol);
  	dst_sock = listen_sock;
@@ -139,19 +141,19 @@ static void run(unsigned int n)
  			dst_sock = SAFE_ACCEPT(listen_sock, NULL, NULL);
 
  		tc->send(sock, sendbuf, SENDSIZE, 0);
-		ret = check_recv(dst_sock, SENDSIZE);
+		ret = check_recv(dst_sock, SENDSIZE, i + 1);
 
  		if (!ret)
  			break;
 
  		tc->send(sock, sendbuf, SENDSIZE, MSG_MORE);
-		ret = check_recv(dst_sock, 0);
+		ret = check_recv(dst_sock, 0, i + 1);

testcases/kernel/syscalls/send/send02.c static void run(unsigned int n) · line 159

Quoted 10 lines
testcases/kernel/syscalls/send/send02.c +1 -1
 
  		if (!ret)
  			break;
 
  		tc->send(sock, sendbuf, 1, 0);
-		ret = check_recv(dst_sock, SENDSIZE + 1);
+		ret = check_recv(dst_sock, SENDSIZE + 1, i + 1);
 
  		if (!ret)
  			break;

.

author
#3 lore raw

PATCH v2 1/1 syscalls/send02: Ensure recv() succeed when not using MSG_MORE flag

In reply to Alexey Kodanev

In this test, we only check send()/sendto()/sendmsg() calls with MSG_MORE flag whether get EAGAIN/EWOULDBLOCK error immediately.

For other flag, we just call recv again when meeting EAGAIN/EWOULDBLOCK error.

Also, improve message and make this case more clean when failed.

---
 testcases/kernel/syscalls/send/send02.c | 65 +++++++++++++++----------
 1 file changed, 38 insertions(+), 27 deletions(-)
testcases/kernel/syscalls/send/send02.c +38 -27
index 5630230fa..b2ab3b79c 100644
@@ -71,32 +71,41 @@ static void setup(void)
 	memset(sendbuf, 0x42, SENDSIZE);
 }
 
-static int check_recv(int sock, long expsize)
+static int check_recv(int sock, long expsize, int loop)
 {
 	char recvbuf[RECVSIZE] = {0};
 
-	TEST(recv(sock, recvbuf, RECVSIZE, MSG_DONTWAIT));
-
-	if (TST_RET == -1) {
-		/* expected error immediately after send(MSG_MORE) */
-		if (!expsize && (TST_ERR == EAGAIN || TST_ERR == EWOULDBLOCK))
-			return 1;
-
-		/* unexpected error */
-		tst_res(TFAIL | TTERRNO, "recv() error");
-		return 0;
-	}
-
-	if (TST_RET < 0) {
-		tst_res(TFAIL | TTERRNO, "Invalid recv() return value %ld",
-			TST_RET);
-		return 0;
-	}
-
-	if (TST_RET != expsize) {
-		tst_res(TFAIL, "recv() read %ld bytes, expected %ld", TST_RET,
-			expsize);
-		return 0;
+	while (1) {
+		TEST(recv(sock, recvbuf, RECVSIZE, MSG_DONTWAIT));
+
+		if (TST_RET == -1) {
+			/* expected error immediately after send(MSG_MORE) */
+			if (TST_ERR == EAGAIN || TST_ERR == EWOULDBLOCK) {
+				if (expsize)
+					continue;
+				else
+					break;
+			}
+
+			/* unexpected error */
+			tst_res(TFAIL | TTERRNO, "recv() error at step %d, expsize %ld",
+				loop, expsize);
+			return 0;
+		}
+
+		if (TST_RET < 0) {
+			tst_res(TFAIL | TTERRNO, "Invalid recv() return value %ld"
+				" at step %d, expsize is %ld",
+				TST_RET, loop, expsize);
+			return 0;
+		}
+
+		if (TST_RET != expsize) {
+			tst_res(TFAIL, "recv() read %ld bytes, expected %ld"
+				"@step %d ", TST_RET, expsize, loop);
+			return 0;
+		}
+		return 1;
 	}
 
 	return 1;
@@ -120,6 +129,8 @@ static void run(unsigned int n)
 	struct test_case *tc = testcase_list + n;
 	socklen_t len = sizeof(addr);
 
+	tst_res(TINFO, "Tesing %s", tc->name);
+
 	tst_init_sockaddr_inet_bin(&addr, INADDR_LOOPBACK, 0);
 	listen_sock = SAFE_SOCKET(tc->domain, tc->type, tc->protocol);
 	dst_sock = listen_sock;
@@ -139,19 +150,19 @@ static void run(unsigned int n)
 			dst_sock = SAFE_ACCEPT(listen_sock, NULL, NULL);
 
 		tc->send(sock, sendbuf, SENDSIZE, 0);
-		ret = check_recv(dst_sock, SENDSIZE);
+		ret = check_recv(dst_sock, SENDSIZE, i + 1);
 
 		if (!ret)
 			break;
 
 		tc->send(sock, sendbuf, SENDSIZE, MSG_MORE);
-		ret = check_recv(dst_sock, 0);
+		ret = check_recv(dst_sock, 0, i + 1);
 
 		if (!ret)
 			break;
 
 		tc->send(sock, sendbuf, 1, 0);
-		ret = check_recv(dst_sock, SENDSIZE + 1);
+		ret = check_recv(dst_sock, SENDSIZE + 1, i + 1);
 
 		if (!ret)
 			break;
@@ -163,7 +174,7 @@ static void run(unsigned int n)
 	}
 
 	if (ret)
-		tst_res(TPASS, "%s(MSG_MORE) works correctly", tc->name);
+		tst_res(TPASS, "MSG_MORE works correctly");
 
 	cleanup();
 	dst_sock = -1;
Signature · 1 line
2.23.0
#4 lore raw

PATCH v2 1/1 syscalls/send02: Ensure recv() succeed when not using MSG_MORE flag

Quoted 8 lines · Yang Xu

In this test, we only check send()/sendto()/sendmsg() calls with MSG_MORE flag whether get EAGAIN/EWOULDBLOCK error immediately.

For other flag, we just call recv again when meeting EAGAIN/EWOULDBLOCK error.

Also, improve message and make this case more clean when failed.

Hi Yang,

Fixed quoted strings and applied, thanks!

Quoted 116 lines
---
 testcases/kernel/syscalls/send/send02.c | 65 +++++++++++++++----------
 1 file changed, 38 insertions(+), 27 deletions(-)
testcases/kernel/syscalls/send/send02.c +38 -27
index 5630230fa..b2ab3b79c 100644
@@ -71,32 +71,41 @@ static void setup(void)
 	memset(sendbuf, 0x42, SENDSIZE);
 }
 
-static int check_recv(int sock, long expsize)
+static int check_recv(int sock, long expsize, int loop)
 {
 	char recvbuf[RECVSIZE] = {0};
 
-	TEST(recv(sock, recvbuf, RECVSIZE, MSG_DONTWAIT));
-
-	if (TST_RET == -1) {
-		/* expected error immediately after send(MSG_MORE) */
-		if (!expsize && (TST_ERR == EAGAIN || TST_ERR == EWOULDBLOCK))
-			return 1;
-
-		/* unexpected error */
-		tst_res(TFAIL | TTERRNO, "recv() error");
-		return 0;
-	}
-
-	if (TST_RET < 0) {
-		tst_res(TFAIL | TTERRNO, "Invalid recv() return value %ld",
-			TST_RET);
-		return 0;
-	}
-
-	if (TST_RET != expsize) {
-		tst_res(TFAIL, "recv() read %ld bytes, expected %ld", TST_RET,
-			expsize);
-		return 0;
+	while (1) {
+		TEST(recv(sock, recvbuf, RECVSIZE, MSG_DONTWAIT));
+
+		if (TST_RET == -1) {
+			/* expected error immediately after send(MSG_MORE) */
+			if (TST_ERR == EAGAIN || TST_ERR == EWOULDBLOCK) {
+				if (expsize)
+					continue;
+				else
+					break;
+			}
+
+			/* unexpected error */
+			tst_res(TFAIL | TTERRNO, "recv() error at step %d, expsize %ld",
+				loop, expsize);
+			return 0;
+		}
+
+		if (TST_RET < 0) {
+			tst_res(TFAIL | TTERRNO, "Invalid recv() return value %ld"
+				" at step %d, expsize is %ld",
+				TST_RET, loop, expsize);
+			return 0;
+		}
+
+		if (TST_RET != expsize) {
+			tst_res(TFAIL, "recv() read %ld bytes, expected %ld"
+				" at step %d ", TST_RET, expsize, loop);
+			return 0;
+		}
+		return 1;
 	}
 
 	return 1;
@@ -120,6 +129,8 @@ static void run(unsigned int n)
 	struct test_case *tc = testcase_list + n;
 	socklen_t len = sizeof(addr);
 
+	tst_res(TINFO, "Tesing %s", tc->name);
+
 	tst_init_sockaddr_inet_bin(&addr, INADDR_LOOPBACK, 0);
 	listen_sock = SAFE_SOCKET(tc->domain, tc->type, tc->protocol);
 	dst_sock = listen_sock;
@@ -139,19 +150,19 @@ static void run(unsigned int n)
 			dst_sock = SAFE_ACCEPT(listen_sock, NULL, NULL);
 
 		tc->send(sock, sendbuf, SENDSIZE, 0);
-		ret = check_recv(dst_sock, SENDSIZE);
+		ret = check_recv(dst_sock, SENDSIZE, i + 1);
 
 		if (!ret)
 			break;
 
 		tc->send(sock, sendbuf, SENDSIZE, MSG_MORE);
-		ret = check_recv(dst_sock, 0);
+		ret = check_recv(dst_sock, 0, i + 1);
 
 		if (!ret)
 			break;
 
 		tc->send(sock, sendbuf, 1, 0);
-		ret = check_recv(dst_sock, SENDSIZE + 1);
+		ret = check_recv(dst_sock, SENDSIZE + 1, i + 1);
 
 		if (!ret)
 			break;
@@ -163,7 +174,7 @@ static void run(unsigned int n)
 	}
 
 	if (ret)
-		tst_res(TPASS, "%s(MSG_MORE) works correctly", tc->name);
+		tst_res(TPASS, "MSG_MORE works correctly");
 
 	cleanup();
 	dst_sock = -1;