I'm rarely seeing tests like bind01, connect01, recv01,
recvfrom01, recvmsg01, send01, sendfile0X, sendmsg01
and sendto01 failing. All these are picking ports with
formula: (getpid() % 32768) + 11000, which occasionally
collides with test harness (beah) used in automated environment,
which is running on ports 12432/12434.

This series removes that formula and lets kernel pick random
free unused port instead. If test has no intention of binding
any server on that port, but still needs some unused port number
it can use newly added tst_get_unused_port() function.

Jan Stancek (2):
  add tst_get_unused_port()
  do not pick free/unused port by chance

 include/test.h                                  |    7 ++
 lib/tst_net.c                                   |   81 +++++++++++++++++++++++
 testcases/kernel/syscalls/bind/bind01.c         |    2 +-
 testcases/kernel/syscalls/connect/connect01.c   |   17 +++--
 testcases/kernel/syscalls/recv/recv01.c         |   15 +++--
 testcases/kernel/syscalls/recvfrom/recvfrom01.c |   15 +++--
 testcases/kernel/syscalls/recvmsg/recvmsg01.c   |   12 ++-
 testcases/kernel/syscalls/send/send01.c         |   15 +++--
 testcases/kernel/syscalls/sendfile/sendfile02.c |    6 ++-
 testcases/kernel/syscalls/sendfile/sendfile04.c |    6 ++-
 testcases/kernel/syscalls/sendfile/sendfile05.c |    6 ++-
 testcases/kernel/syscalls/sendfile/sendfile06.c |    6 ++-
 testcases/kernel/syscalls/sendmsg/sendmsg01.c   |   17 +++--
 testcases/kernel/syscalls/sendto/sendto01.c     |   15 +++--
 14 files changed, 173 insertions(+), 47 deletions(-)
 create mode 100644 lib/tst_net.c


------------------------------------------------------------------------------
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to