selftests: add txtimestamp kselftest
authorWillem de Bruijn <willemb@google.com>
Thu, 20 Dec 2018 21:22:54 +0000 (16:22 -0500)
committerDavid S. Miller <davem@davemloft.net>
Fri, 21 Dec 2018 01:01:17 +0000 (17:01 -0800)
commitcda261f421ba2682e25f46beb229172706fc7fcd
tree150736910e957ee253eeb18fde79c245656e3d18
parentb52354aa068ee362a58ebb92e8bd0d0e18008364
selftests: add txtimestamp kselftest

Run the transmit timestamp tests as part of kselftests.

Add a txtimestamp.sh test script that runs most variants:
ipv4/ipv6, tcp/udp/raw/raw_ipproto/pf_packet, data/nodata,
setsockopt/cmsg. The script runs tests with netem delays.

Refine txtimestamp.c to validate results. Take expected
netem delays as input and compare against real timestamps.

To run without dependencies, add a listener socket to be
able to connect in the case of TCP.

Add the timestamping directory to the kselftests Makefile.
Build all the binaries. Only run verified txtimestamp.sh.

Signed-off-by: Willem de Bruijn <willemb@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/Makefile
tools/testing/selftests/networking/timestamping/Makefile
tools/testing/selftests/networking/timestamping/config [new file with mode: 0644]
tools/testing/selftests/networking/timestamping/txtimestamp.c
tools/testing/selftests/networking/timestamping/txtimestamp.sh [new file with mode: 0755]