Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Oct 2023 13:37:29 GMT
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 24fe0cb84d71 - main - ping tests: Fix test on i386 platforms
Message-ID:  <202310191337.39JDbTv3094500@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=24fe0cb84d71a0e9d648c43f92b5c3a730c3855a

commit 24fe0cb84d71a0e9d648c43f92b5c3a730c3855a
Author:     Jose Luis Duran <jlduran@gmail.com>
AuthorDate: 2023-10-17 11:35:38 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2023-10-19 13:35:39 +0000

    ping tests: Fix test on i386 platforms
    
    Actually use INT_MAX (0x7fffffff), not UINT_MAX (0xffffffff) to avoid
    overflowing time_t and missing the test.
    
    Reported by:    Jenkins
    Reviewed by:    markj
    Fixes:          5b8af90fe332 ("ping: Add ATF-Python tests")
    Pull Request:   https://github.com/freebsd/freebsd-src/pull/874
    Differential Revision: https://reviews.freebsd.org/D42268
---
 sbin/ping/tests/test_ping.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sbin/ping/tests/test_ping.py b/sbin/ping/tests/test_ping.py
index 900fbf45d52d..3c66e6c54c4d 100644
--- a/sbin/ping/tests/test_ping.py
+++ b/sbin/ping/tests/test_ping.py
@@ -51,7 +51,7 @@ def build_response_packet(echo, ip, icmp, oip_ihl, special):
         # Build a package with a timestamp of INT_MAX
         # (time-warped package)
         payload_no_timestamp = sc.bytes_hex(load)[16:]
-        load = (b"\xff" * 8) + sc.hex_bytes(payload_no_timestamp)
+        load = b"\x7f" + (b"\xff" * 7) + sc.hex_bytes(payload_no_timestamp)
     if special == "wrong":
         # Build a package with a wrong last byte
         payload_no_last_byte = sc.bytes_hex(load)[:-2]



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202310191337.39JDbTv3094500>