From nobody Sun Mar 19 16:33:28 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pfk2J3BxKz40P2t; Sun, 19 Mar 2023 16:33:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Pfk2J2mSZz4T6J; Sun, 19 Mar 2023 16:33:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679243608; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EG5tUPBfrwbJxlH6wDAR9MU0Clqmxax2q0Fb/3PtAS8=; b=AgOkHDQtl24Nxj6/8mN9zWRbMAqqIKVKzyIyc0AgoSq85HFWw1yBuGG4shYOT8GXiqspF3 DEQfUiOewuHYKRS5CUxBopGYLyIf4HeFr0aBd1BmeYGoIp0dp65Cx23pCyuDz0SsPWzyZf zACdTSaiyYPweq+STRUEHSk+nlveLXHCP8nUJ+YHkI2wLXbCdSWt5FXlOBVwDzv9bvnBlI 4EQv67ytv4TsDMQcvPt7mY88UZurthZdDPRpHtXwhSmeBRS37SFBQxhUIhMTxxQgQqSfUQ bzVAzzvUduYSbqBIw3FkjXhEAoweMSrF3KJXmmYO4I89HYs7wzgpr7wQf5yyiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679243608; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EG5tUPBfrwbJxlH6wDAR9MU0Clqmxax2q0Fb/3PtAS8=; b=wmevy02Dms4meE1iMyqlTSoEP35343HJIt9pJXVnEHFHjrCBulltfySELRhf7frsSjj02X 6TVP4kine+rmQD7QQfNR3YQNz2hR4h8ooJ/9Jt7mQaRbzf9POkg8jqnR2EvEbeH5RD2VVe qzNgiiui8LLZhqQkkkFomu5JrcV/A+iBCm+TgHqLEj3fPYmpPwBnWRdNo4EGRNg/U9UV4G wZ1UZyiXP0x6WPsPSvDK8zCzmXuGy6cxAXczuOM43v2NexRJUWH8hqQlE3nU72bDYc+phV X9H9IwLqyTgt2bNfsu8ORzuO5mRLSUkBzCG9N3CvNbxrMorI/JvuTY9rK+667A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679243608; a=rsa-sha256; cv=none; b=fM81KTbTGiberWBPxg+iekaAja5/r+oQgJzAFgyeK9dDJXU28OZswZUfF3e2J30886zgi3 LUZlhHFlnINlKXvmjl4SawQd1YX5ObPBQD5hytWOuWN2bnuR98KDvniqwJ0zeUqpe3EhNu fCTH2pusM8OX+SBDO+mhEzxiJ3rCrpujWZ+v8ucye96ZnXAPATpRU9LNLBGyRUziYgcgUn UtC8LxS2BNEfaGAkyS9Ims07uXCkcvbsMt9JZDvghxN+NheBUm45wy+larALAqge8ZpiJQ 0gRg6mJBbDFdEQhOoHAnyKPST94zGn6oe5QYTHxBp43UQs+8XRO0IWQQH/C0bw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pfk2J1gDlzw8F; Sun, 19 Mar 2023 16:33:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32JGXSTw003208; Sun, 19 Mar 2023 16:33:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32JGXSEU003207; Sun, 19 Mar 2023 16:33:28 GMT (envelope-from git) Date: Sun, 19 Mar 2023 16:33:28 GMT Message-Id: <202303191633.32JGXSEU003207@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 076b718d9e25 - main - ping tests: Add tests for IP header options List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 076b718d9e259a214abeb4b4f7289680b1a62ddf Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=076b718d9e259a214abeb4b4f7289680b1a62ddf commit 076b718d9e259a214abeb4b4f7289680b1a62ddf Author: Jose Luis Duran AuthorDate: 2023-02-09 16:41:02 +0000 Commit: Mark Johnston CommitDate: 2023-03-19 16:23:44 +0000 ping tests: Add tests for IP header options The function pr_pack() prints out a packet, if the IP packet contains options, these are printed as well. Test the functionality fixed in 70960bb86a3ba5b6f5c4652e613e6313a7ed1ac1. Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D38470 --- sbin/ping/tests/test_ping.py | 243 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 242 insertions(+), 1 deletion(-) diff --git a/sbin/ping/tests/test_ping.py b/sbin/ping/tests/test_ping.py index 639973d093d4..7040faa71a5d 100644 --- a/sbin/ping/tests/test_ping.py +++ b/sbin/ping/tests/test_ping.py @@ -780,6 +780,248 @@ round-trip min/avg/max/stddev = /// ms }, id="_0_0", ), + pytest.param( + { + "src": "192.0.2.1", + "dst": "192.0.2.2", + "icmp_type": 0, + "icmp_code": 0, + "opts": "EOL", + }, + { + "returncode": 0, + "stdout": """\ +PING 192.0.2.2 (192.0.2.2): 56 data bytes +64 bytes from: icmp_seq=0 ttl= time= ms +wrong total length 88 instead of 84 + +--- 192.0.2.2 ping statistics --- +1 packets transmitted, 1 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = /// ms +""", + "stderr": "", + "redacted": True, + }, + id="_0_0_opts_EOL", + ), + pytest.param( + { + "src": "192.0.2.1", + "dst": "192.0.2.2", + "icmp_type": 0, + "icmp_code": 0, + "opts": "LSRR", + }, + { + "returncode": 0, + "stdout": """\ +PING 192.0.2.2 (192.0.2.2): 56 data bytes +64 bytes from: icmp_seq=0 ttl= time= ms +LSRR: 192.0.2.10 + 192.0.2.20 + 192.0.2.30 + 192.0.2.40 + 192.0.2.50 + 192.0.2.60 + 192.0.2.70 + 192.0.2.80 + 192.0.2.90 + +--- 192.0.2.2 ping statistics --- +1 packets transmitted, 1 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = /// ms +""", + "stderr": "", + "redacted": True, + }, + id="_0_0_opts_LSRR", + ), + pytest.param( + { + "src": "192.0.2.1", + "dst": "192.0.2.2", + "icmp_type": 0, + "icmp_code": 0, + "opts": "LSRR-trunc", + }, + { + "returncode": 0, + "stdout": """\ +PING 192.0.2.2 (192.0.2.2): 56 data bytes +64 bytes from: icmp_seq=0 ttl= time= ms +LSRR: (truncated route) + + +--- 192.0.2.2 ping statistics --- +1 packets transmitted, 1 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = /// ms +""", + "stderr": "", + "redacted": True, + }, + id="_0_0_opts_LSRR_trunc", + ), + pytest.param( + { + "src": "192.0.2.1", + "dst": "192.0.2.2", + "icmp_type": 0, + "icmp_code": 0, + "opts": "SSRR", + }, + { + "returncode": 0, + "stdout": """\ +PING 192.0.2.2 (192.0.2.2): 56 data bytes +64 bytes from: icmp_seq=0 ttl= time= ms +SSRR: 192.0.2.10 + 192.0.2.20 + 192.0.2.30 + 192.0.2.40 + 192.0.2.50 + 192.0.2.60 + 192.0.2.70 + 192.0.2.80 + 192.0.2.90 + +--- 192.0.2.2 ping statistics --- +1 packets transmitted, 1 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = /// ms +""", + "stderr": "", + "redacted": True, + }, + id="_0_0_opts_SSRR", + ), + pytest.param( + { + "src": "192.0.2.1", + "dst": "192.0.2.2", + "icmp_type": 0, + "icmp_code": 0, + "opts": "SSRR-trunc", + }, + { + "returncode": 0, + "stdout": """\ +PING 192.0.2.2 (192.0.2.2): 56 data bytes +64 bytes from: icmp_seq=0 ttl= time= ms +SSRR: (truncated route) + + +--- 192.0.2.2 ping statistics --- +1 packets transmitted, 1 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = /// ms +""", + "stderr": "", + "redacted": True, + }, + id="_0_0_opts_SSRR_trunc", + ), + pytest.param( + { + "src": "192.0.2.1", + "dst": "192.0.2.2", + "icmp_type": 0, + "icmp_code": 0, + "opts": "RR", + }, + { + "returncode": 0, + "stdout": """\ +PING 192.0.2.2 (192.0.2.2): 56 data bytes +64 bytes from: icmp_seq=0 ttl= time= ms +RR: 192.0.2.10 + 192.0.2.20 + 192.0.2.30 + 192.0.2.40 + 192.0.2.50 + 192.0.2.60 + 192.0.2.70 + 192.0.2.80 + 192.0.2.90 + +--- 192.0.2.2 ping statistics --- +1 packets transmitted, 1 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = /// ms +""", + "stderr": "", + "redacted": True, + }, + id="_0_0_opts_RR", + ), + pytest.param( + { + "src": "192.0.2.1", + "dst": "192.0.2.2", + "icmp_type": 0, + "icmp_code": 0, + "opts": "RR-same", + }, + { + "returncode": 0, + "stdout": """\ +PING 192.0.2.2 (192.0.2.2): 56 data bytes +64 bytes from: icmp_seq=0 ttl= time= ms (same route) + +--- 192.0.2.2 ping statistics --- +1 packets transmitted, 1 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = /// ms +""", + "stderr": "", + "redacted": True, + }, + id="_0_0_opts_RR_same", + ), + pytest.param( + { + "src": "192.0.2.1", + "dst": "192.0.2.2", + "icmp_type": 0, + "icmp_code": 0, + "opts": "RR-trunc", + }, + { + "returncode": 0, + "stdout": """\ +PING 192.0.2.2 (192.0.2.2): 56 data bytes +64 bytes from: icmp_seq=0 ttl= time= ms +RR: (truncated route) + +--- 192.0.2.2 ping statistics --- +1 packets transmitted, 1 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = /// ms +""", + "stderr": "", + "redacted": True, + }, + id="_0_0_opts_RR_trunc", + ), + pytest.param( + { + "src": "192.0.2.1", + "dst": "192.0.2.2", + "icmp_type": 0, + "icmp_code": 0, + "opts": "NOP", + }, + { + "returncode": 0, + "stdout": """\ +PING 192.0.2.2 (192.0.2.2): 56 data bytes +64 bytes from: icmp_seq=0 ttl= time= ms +wrong total length 88 instead of 84 +NOP + +--- 192.0.2.2 ping statistics --- +1 packets transmitted, 1 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = /// ms +""", + "stderr": "", + "redacted": True, + }, + id="_0_0_opts_NOP", + ), pytest.param( { "src": "192.0.2.1", @@ -867,7 +1109,6 @@ round-trip min/avg/max/stddev = /// ms "stderr": "", "redacted": True, }, - marks=pytest.mark.skip("XXX currently failing"), id="_0_0_opts_unk", ), pytest.param(