MSG_ERRQUEUE support for tcp has been added in 3.17. [1][2][3]
Skip testing this combination on prior kernels.

[1] https://lkml.org/lkml/2006/9/18/182
[2] f4713a3dfad045d46afcb9c2a7d0bba288920ed4
[3] 4ed2d765dfaccff5ebdac68e2064b59125033a3b

Signed-off-by: Jan Stancek <jstan...@redhat.com>
---
 testcases/kernel/syscalls/recv/recv01.c         |    9 ++++++++-
 testcases/kernel/syscalls/recvfrom/recvfrom01.c |    9 ++++++++-
 testcases/kernel/syscalls/recvmsg/recvmsg01.c   |    9 ++++++++-
 3 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/testcases/kernel/syscalls/recv/recv01.c 
b/testcases/kernel/syscalls/recv/recv01.c
index 3dc7a91..ad5f9f8 100644
--- a/testcases/kernel/syscalls/recv/recv01.c
+++ b/testcases/kernel/syscalls/recv/recv01.c
@@ -130,8 +130,15 @@ int main(int argc, char *argv[])
        for (lc = 0; TEST_LOOPING(lc); ++lc) {
                tst_count = 0;
                for (testno = 0; testno < TST_TOTAL; ++testno) {
-                       tdat[testno].setup();
+                       if ((tst_kvercmp(3, 17, 0) < 0)
+                           && (tdat[testno].flags & MSG_ERRQUEUE)
+                           && (tdat[testno].type & SOCK_STREAM)) {
+                               tst_resm(TINFO, "skip MSG_ERRQUEUE test, "
+                                               "it's supported from 3.17");
+                               continue;
+                       }
 
+                       tdat[testno].setup();
                        TEST(recv(s, tdat[testno].buf, tdat[testno].buflen,
                                  tdat[testno].flags));
                        if (TEST_RETURN > 0)
diff --git a/testcases/kernel/syscalls/recvfrom/recvfrom01.c 
b/testcases/kernel/syscalls/recvfrom/recvfrom01.c
index 8d0a2ee..843dfb1 100644
--- a/testcases/kernel/syscalls/recvfrom/recvfrom01.c
+++ b/testcases/kernel/syscalls/recvfrom/recvfrom01.c
@@ -152,8 +152,15 @@ int main(int argc, char *argv[])
        for (lc = 0; TEST_LOOPING(lc); ++lc) {
                tst_count = 0;
                for (testno = 0; testno < TST_TOTAL; ++testno) {
-                       tdat[testno].setup();
+                       if ((tst_kvercmp(3, 17, 0) < 0)
+                           && (tdat[testno].flags & MSG_ERRQUEUE)
+                           && (tdat[testno].type & SOCK_STREAM)) {
+                               tst_resm(TINFO, "skip MSG_ERRQUEUE test, "
+                                               "it's supported from 3.17");
+                               continue;
+                       }
 
+                       tdat[testno].setup();
                        TEST(recvfrom(s, tdat[testno].buf, tdat[testno].buflen,
                                      tdat[testno].flags, tdat[testno].from,
                                      tdat[testno].salen));
diff --git a/testcases/kernel/syscalls/recvmsg/recvmsg01.c 
b/testcases/kernel/syscalls/recvmsg/recvmsg01.c
index 42d4968..1216935 100644
--- a/testcases/kernel/syscalls/recvmsg/recvmsg01.c
+++ b/testcases/kernel/syscalls/recvmsg/recvmsg01.c
@@ -208,10 +208,17 @@ int main(int argc, char *argv[])
        for (lc = 0; TEST_LOOPING(lc); ++lc) {
                tst_count = 0;
                for (testno = 0; testno < TST_TOTAL; ++testno) {
+                       if ((tst_kvercmp(3, 17, 0) < 0)
+                           && (tdat[testno].flags & MSG_ERRQUEUE)
+                           && (tdat[testno].type & SOCK_STREAM)) {
+                               tst_resm(TINFO, "skip MSG_ERRQUEUE test, "
+                                               "it's supported from 3.17");
+                               continue;
+                       }
+
                        tdat[testno].setup();
 
                        /* setup common to all tests */
-
                        iov[0].iov_base = tdat[testno].buf;
                        iov[0].iov_len = tdat[testno].buflen;
                        msgdat.msg_name = tdat[testno].from;
-- 
1.7.1


------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to