Skip to content

Commit e1ca44e

Browse files
q2venPaolo Abeni
authored andcommitted
af_unix: Add test for consecutive consumed OOB.
Let's add a test case where consecutive concumed OOB skbs stay at the head of the queue. Without the previous patch, ioctl(SIOCATMARK) assertion fails. Before: # RUN msg_oob.no_peek.ex_oob_ex_oob_oob ... # msg_oob.c:305:ex_oob_ex_oob_oob:Expected answ[0] (0) == oob_head (1) # ex_oob_ex_oob_oob: Test terminated by assertion # FAIL msg_oob.no_peek.ex_oob_ex_oob_oob not ok 12 msg_oob.no_peek.ex_oob_ex_oob_oob After: # RUN msg_oob.no_peek.ex_oob_ex_oob_oob ... # OK msg_oob.no_peek.ex_oob_ex_oob_oob ok 12 msg_oob.no_peek.ex_oob_ex_oob_oob Signed-off-by: Kuniyuki Iwashima <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent 32ca245 commit e1ca44e

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tools/testing/selftests/net/af_unix/msg_oob.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,29 @@ TEST_F(msg_oob, ex_oob_oob)
548548
siocatmarkpair(false);
549549
}
550550

551+
TEST_F(msg_oob, ex_oob_ex_oob_oob)
552+
{
553+
sendpair("x", 1, MSG_OOB);
554+
epollpair(true);
555+
siocatmarkpair(true);
556+
557+
recvpair("x", 1, 1, MSG_OOB);
558+
epollpair(false);
559+
siocatmarkpair(true);
560+
561+
sendpair("y", 1, MSG_OOB);
562+
epollpair(true);
563+
siocatmarkpair(true);
564+
565+
recvpair("y", 1, 1, MSG_OOB);
566+
epollpair(false);
567+
siocatmarkpair(true);
568+
569+
sendpair("z", 1, MSG_OOB);
570+
epollpair(true);
571+
siocatmarkpair(true);
572+
}
573+
551574
TEST_F(msg_oob, ex_oob_ahead_break)
552575
{
553576
sendpair("hello", 5, MSG_OOB);

0 commit comments

Comments
 (0)