Page MenuHomeFreeBSD

ping tests: Add a regression test
ClosedPublic

Authored by jlduran on Mar 24 2023, 3:38 AM.
Tags
None
Referenced Files
F102616352: D39244.diff
Thu, Nov 14, 8:49 PM
Unknown Object (File)
Wed, Nov 6, 3:48 PM
Unknown Object (File)
Wed, Nov 6, 3:48 PM
Unknown Object (File)
Wed, Nov 6, 3:48 PM
Unknown Object (File)
Tue, Nov 5, 3:13 AM
Unknown Object (File)
Wed, Oct 16, 4:44 PM
Unknown Object (File)
Sep 30 2024, 9:04 AM
Unknown Object (File)
Sep 21 2024, 5:08 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 Skipped
Unit
Tests Skipped

Event Timeline

jlduran 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.