Page MenuHomeFreeBSD

ping tests: Add a regression test
ClosedPublic

Authored by jlduran_gmail.com on Mar 24 2023, 3:38 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 22 2024, 9:53 PM
Unknown Object (File)
Mar 22 2024, 9:53 PM
Unknown Object (File)
Mar 8 2024, 10:57 PM
Unknown Object (File)
Mar 8 2024, 4:22 AM
Unknown Object (File)
Jan 4 2024, 10:23 PM
Unknown Object (File)
Jan 4 2024, 10:23 PM
Unknown Object (File)
Jan 4 2024, 8:43 PM
Unknown Object (File)
Dec 12 2023, 5:56 AM

Details

Summary

Test regression fixed in 4630a3252ac8ad2f5acddf0d1efb26795cb3190b.
Add two tests that do not use the verbose flag, so the code path in question can be reached:

  1. Respond with a proper ICMP destination host unreachable packet.
  2. Respond with a doctored ICMP destination host unreachable packet, that has the ICMP Identifier field modified (+1 bit).
Test Plan
kyua test -k /usr/tests/Kyuafile sbin/ping/ping_test
kyua test -k /usr/tests/Kyuafile sbin/ping/test_ping.py

Without the code that was accidentally removed, test 1 should fail.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jlduran_gmail.com edited the test plan for this revision. (Show Details)
sbin/ping/tests/test_ping.py
1234

Minor nit: git apply complains about trailing space here.

sbin/ping/tests/test_ping.py
1234

slippy$ git apply /tmp/D39244.diff
/tmp/D39244.diff:71: trailing whitespace.
4 5 00 0054 0001 0 0000 40 01 f6a4 192.0.2.1 192.0.2.2
warning: 1 line adds whitespace errors.
slippy$

sbin/ping/tests/test_ping.py
1234

The trailing space is needed, otherwise the test will fail. I have a number of cosmetic changes planned for ping, which remove the trailing space, among other fixes.

I'm happy with it.

This revision is now accepted and ready to land.Mar 24 2023, 10:04 PM
This revision was automatically updated to reflect the committed changes.