| 5797a03f | 05-Nov-2024 |
Jose Luis Duran <jlduran@FreeBSD.org> |
ping tests: Run tests unprivileged inside a vnet
In order to create vnet jails, atf_python needs root privileges. However, once the vnet is created, its privileges inside the vnet can be demoted, as
ping tests: Run tests unprivileged inside a vnet
In order to create vnet jails, atf_python needs root privileges. However, once the vnet is created, its privileges inside the vnet can be demoted, as these tests should not require root in order to pass.
Reviewed by: markj Approved by: emaste (mentor) Fixes: 4efaf43c6fa7 ("ping: Require root user for pytests") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42175
show more ...
|
| 8b13cb9d | 05-Nov-2024 |
Jose Luis Duran <jlduran@FreeBSD.org> |
ping tests: Silence deprecation warnings
Declare some regex patterns as a raw string by prepending `r`.
Reviewed by: markj Approved by: emaste (mentor) Differential Revision: https://reviews.freebs
ping tests: Silence deprecation warnings
Declare some regex patterns as a raw string by prepending `r`.
Reviewed by: markj Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D42174
show more ...
|
| 4859030e | 05-Nov-2024 |
Jose Luis Duran <jlduran@FreeBSD.org> |
ping: tests: Align with Scapy defaults
Align some of pinger() defaults with Scapy to facilitate debugging when printing packets.
No functional change intended.
Reviewed by: emaste, kp Approved by:
ping: tests: Align with Scapy defaults
Align some of pinger() defaults with Scapy to facilitate debugging when printing packets.
No functional change intended.
Reviewed by: emaste, kp Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D47159
show more ...
|
| c4ffb80e | 11-Oct-2023 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
ping: Consistently use EX_NOHOST for DNS failures.
Traditionally, ping returned exit code EX_NOHOST if a DNS lookup failed. That is still the case for the legacy code in the new merged ping, but not
ping: Consistently use EX_NOHOST for DNS failures.
Traditionally, ping returned exit code EX_NOHOST if a DNS lookup failed. That is still the case for the legacy code in the new merged ping, but not for IPv6 targets, nor when a DNS lookup is performed in order to determine which version of the tool to invoke.
While here, also make sure that the error message is consistent.
Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D42159
show more ...
|
| 4efaf43c | 11-Oct-2023 |
Jose Luis Duran <jlduran@gmail.com> |
ping: Require root user for pytests
atf_python may use vnet jails for creating an isolated test environment. Mark these tests that require root user privileges.
Reviewed by: markj MFC after: 1 week
ping: Require root user for pytests
atf_python may use vnet jails for creating an isolated test environment. Mark these tests that require root user privileges.
Reviewed by: markj MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/863
show more ...
|
| b86e4812 | 13-Apr-2023 |
Jose Luis Duran <jlduran@gmail.com> |
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.
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 ef9e6dc7eebe9830511602904d3ef5218d964080.
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 25b86f8559c2e7076daff56933217e95cd4398d4).
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
show more ...
|
| 8db2c580 | 10-Apr-2023 |
Jose Luis Duran <jlduran@gmail.com> |
ping: Fix the spacing between the time stamp and cp/dp
When an echo reply packet is received, the data is compared with the sent data. When a wrong byte is detected the command displays a report wi
ping: Fix the spacing between the time stamp and cp/dp
When an echo reply packet is received, the data is compared with the sent data. When a wrong byte is detected the command displays a report with the differences.
The first row (the first 8-bytes of data after the ICMP header) should include the time stamp (if data is at least 8-bytes), this value is not taken into consideration for the comparison. The remaining rows represent the data (padded pattern) received/sent, with each byte being compared for differences.
Print the space before (not after), to add an extra space after cp:/dp: for better readability when the first time stamp octet is not zero-padded, and to remove trailing spaces in the output.
Before: cp:99 0 0 c 1 5 c 0␣ ab cd ab cd ab cd ab cd ab cd ab cd ab cd ab cd␣ ...
After: cp: 99 0 0 c 1 5 c 0 ab cd ab cd ab cd ab cd ab cd ab cd ab cd ab cd ...
Reviewed by: markj MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/863 Differential Revision: https://reviews.freebsd.org/D39492
show more ...
|
| 03d4d1c7 | 21-Nov-2022 |
Jose Luis Duran <jlduran@gmail.com> |
ping: Unify ping/ping6 statistics section
This is a first step towards a unification/simplification of ping/ping6 (internally). The end goal is to produce a standardized user-facing output.
Before
ping: Unify ping/ping6 statistics section
This is a first step towards a unification/simplification of ping/ping6 (internally). The end goal is to produce a standardized user-facing output.
Before (ping6):
PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2 16 bytes from ::1, icmp_seq=0 hlim=64 time=0.168 ms 16 bytes from ::1, icmp_seq=1 hlim=64 time=0.068 ms
--- 2001:db8::2 ping6 statistics --- round-trip min/avg/max/std-dev = 0.068/0.118/0.168/0.050 ms
After (ping6):
PING(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2 16 bytes from ::1, icmp_seq=0 hlim=64 time=0.168 ms 16 bytes from ::1, icmp_seq=1 hlim=64 time=0.068 ms
--- 2001:db8::2 ping statistics --- round-trip min/avg/max/stddev = 0.068/0.118/0.168/0.050 ms
This has the nice side-effect of adding units to SIGINFO's statistics, as printing numbers without units may not be of much help. Also mentions the fact that these times are round-trip.
Before (ping/ping6 SIGINFO):
2/2 packets received (100.0%) 0.068 min / 0.118 avg / 0.168 max
After (ping/ping6 SIGINFO):
--- <ipv4/ipv6 address> ping statistics --- 2 packets transmitted, 2 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 0.068/0.118/0.168/0.050 ms
In the case of a SIGINFO, the output will be printed to stderr, for both ping and ping6.
Reviewed by: markj MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/863 Differential Revision: https://reviews.freebsd.org/D39126
show more ...
|
| d2c9a140 | 09-Feb-2023 |
Jose Luis Duran <jlduran@gmail.com> |
ping: Remove an extra new line character
This matches the behavior when an RR truncated route is printed.
Reviewed by: markj MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/p
ping: Remove an extra new line character
This matches the behavior when an RR truncated route is printed.
Reviewed by: markj MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/863 Differential Revision: https://reviews.freebsd.org/D39485
show more ...
|