Skip to contentSkip to conversation

recvmsg01: Skip unsupported test

PATCH In review Takuya Wakazono 2 participants 4 messages Sep 9, 2023 – Sep 11, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 recvmsg01: Skip unsupported test

Since it's already stated that MSQ_ERRQUEUE + SOCK_STREAM is not supported on kernels < 3.17, let's actually skip this test.

Fixes 7d365d72ba71 ("recvmsg01: Refactor using new LTP API")
---
 testcases/kernel/syscalls/recvmsg/recvmsg01.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
testcases/kernel/syscalls/recvmsg/recvmsg01.c +2 -2
index 2576e1572..80c1b3aa9 100644
@@ -220,14 +220,14 @@ static void run(unsigned int n)
 	struct tcase *tc = &tcases[n];
 	int ret = tc->exp_errno ? -1 : 0;
 
-	setup_all();
-
 	if ((tst_kvercmp(3, 17, 0) < 0)
 			&& (tc->flags & MSG_ERRQUEUE)
 			&& (tc->type & SOCK_STREAM)) {
 		tst_res(TCONF, "MSG_ERRQUEUE requires kernel >= 3.17");
+		return;
 	}
 
+	setup_all();
 	tc->setup(n);
 
 	iov[0].iov_base = tc->recv_buf;
Signature · 5 lines
2.42.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Reviewed-by on v1 1/1
#1 lore raw
Quoted 16 lines · Takuya Wakazono

Since it's already stated that MSQ_ERRQUEUE + SOCK_STREAM is not supported on kernels < 3.17, let's actually skip this test.

Fixes 7d365d72ba71 ("recvmsg01: Refactor using new LTP API")
---
 testcases/kernel/syscalls/recvmsg/recvmsg01.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
testcases/kernel/syscalls/recvmsg/recvmsg01.c +0 -0
index 2576e1572..80c1b3aa9 100644
@@ -220,14 +220,14 @@ static void run(unsigned int n)
        struct tcase *tc = &tcases[n];

testcases/kernel/syscalls/recvmsg/recvmsg01.c static void run(unsigned int n) · line 228

Quoted 10 lines
testcases/kernel/syscalls/recvmsg/recvmsg01.c +1 -2
        int ret = tc->exp_errno ? -1 : 0;
 
-       setup_all();
-
        if ((tst_kvercmp(3, 17, 0) < 0)
                        && (tc->flags & MSG_ERRQUEUE)
                        && (tc->type & SOCK_STREAM)) {
                tst_res(TCONF, "MSG_ERRQUEUE requires kernel >= 3.17");
+               return;
 

It'd be better to use tst_brk TCONF rather than tst_res + return.

The rest looks good.

Quoted 14 lines
testcases/kernel/syscalls/recvmsg/recvmsg01.c +1 -0
        }
 
+       setup_all();
        tc->setup(n);
 
        iov[0].iov_base = tc->recv_buf;

--
2.42.0

--
Mailing list info: https://lists.linux.it/listinfo/ltp

Signature · 5 lines
Regards,
Li Wang

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#2 lore raw

Hi Li,
Thanks for the review.

Quoted 8 lines
Quoted 6 lines
        if ((tst_kvercmp(3, 17, 0) < 0)
                        && (tc->flags & MSG_ERRQUEUE)
                        && (tc->type & SOCK_STREAM)) {
                tst_res(TCONF, "MSG_ERRQUEUE requires kernel >= 3.17");

+ return;

It'd be better to use tst_brk TCONF rather than tst_res + return.

Wouldn't that abort all subsequent test cases? We only want to skip the MSG_ERRQUEUE test cases.

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#3 lore raw
Quoted 10 lines · Takuya Wakazono

Hi Li,
Thanks for the review.

Quoted 7 lines
Quoted 6 lines
        if ((tst_kvercmp(3, 17, 0) < 0)
                        && (tc->flags & MSG_ERRQUEUE)
                        && (tc->type & SOCK_STREAM)) {
                tst_res(TCONF, "MSG_ERRQUEUE requires kernel >= 3.17");

+ return;

Quoted 5 lines
Quoted 1 line

It'd be better to use tst_brk TCONF rather than tst_res + return.

Wouldn't that abort all subsequent test cases? We only want to skip the MSG_ERRQUEUE test cases.

Ah, yes, I overlooked that tcases traverse. Sorry~

Signature · 5 lines
Regards,
Li Wang

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp