freebsd-src/sbin/ping/tests
Jose Luis Duran b86e4812cc ping: pr_iph() improvements
Very early on, the Src/Dst IP addresses were printed in hex notation
(%08x), which will always be 8-characters wide.  It was later changed to
use a dot-decimal notation.  Depending on the IP address length, the Src
and Dst headers may require a different padding.  Use the source and
destination IP lengths as padding for the headers.

Also, print an Opts (options) header, if there are options present.  It
has been abbreviated to Opts to match the length of the previous Data
header, removed in ef9e6dc7ee.

Print the header info such that no trailing spaces are produced.  As
some git workflows may automatically trim them, and make the tests fail
(see 25b86f8559).

Before

    Vr HL TOS  Len   ID Flg  off TTL Pro  cks      Src      Dst
     4  f  00 007c 0001   0 0000  40  01 d868 192.0.2.1  192.0.2.2␣

After

    Vr HL TOS  Len   ID Flg  off TTL Pro  cks       Src       Dst
     4  f  00 007c 0001   0 0000  40  01 d868 192.0.2.1 192.0.2.2

And with options:

Before

    Vr HL TOS  Len   ID Flg  off TTL Pro  cks      Src      Dst
     4  f  00 007c 0001   0 0000  40  01 d868 192.0.2.1  192.0.2.2 01...

After

    Vr HL TOS  Len   ID Flg  off TTL Pro  cks       Src       Dst Opts
     4  f  00 007c 0001   0 0000  40  01 d868 192.0.2.1 192.0.2.2 01...

Reviewed by:	markj
MFC after:	1 week
Pull Request:	https://github.com/freebsd/freebsd-src/pull/863
Differential Revision:	https://reviews.freebsd.org/D39561
2023-10-11 13:48:28 -04:00
..
in_cksum_test.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
injection.py Add test cases for ping with IP options in the response 2022-12-25 22:59:58 -07:00
Makefile Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
ping_6_c1_s8_t1.out ping: Unify ping/ping6 statistics section 2023-10-11 13:48:28 -04:00
ping_c1_s8_t1_S1.out ping: Unify ping/ping6 statistics section 2023-10-11 13:48:28 -04:00
ping_c1_s56_t1.out
ping_c1_s56_t1_S127.out
ping_test.sh ping: Simplify protocol selection. 2023-10-11 00:47:59 +02:00
test_ping.py ping: pr_iph() improvements 2023-10-11 13:48:28 -04:00