From nobody Sat May 2 15:20:41 2026 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 4g7BSG0VKrz6c6xJ for ; Sat, 02 May 2026 15:20:46 +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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4g7BSF3l2nz3D1k for ; Sat, 02 May 2026 15:20:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1777735245; 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=nRWgic/Tk+vP3Oj2EJxks848MqmZcZVyaJzFF39zLNQ=; b=w6IwUwoeAT8Wf8OEo+ymYWeX5OlNFffbxtdRbc5AkRIdsivGIwX5LfLj8oZvlgBZ1k1Jtu IRe5NvrbbZifkPDuMLfU7zjcaK6+2xB3EjsOn3Mj1X8bxyyL6LEUReu7RT5H4rj4e6eJs/ HuxU5gAwLG8eh2TxZ2xBfMDzSuzomMT4MTowX3kM/ZGHKqLMcJSa5vmedmWZ2SnbnJ8P8E PEJMInksgCXtTIXy3eqQ8YeTtAhekZYWo5E4vYNUAFUBQHm34K0w8MiV3w2eMyD9DIxSgI lPXjKtLZGq5QXGfCVzaCyJducR1Sf+NTbTMLW487w8iyZzuUYrUIkoaXrMyRXQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1777735245; a=rsa-sha256; cv=none; b=Bhf26h7wClfYEiTSDwFMUGMx0CjjN2sorSFGyYexaWD30HyWDq8MPUBVfD9FnDHTVbZnC6 A7iU71dy1zP9kcN6ovpNwZXjHNdXQY6a9PmLiAE69Eb1a81WiDEWw5lw5UkEIRsA7ouoWx payj/TiirCZoLdo5wr2JUZG8AMwHavgo2meUdHaBN0lJQT3CrFum5p1AI+vhrNQyryRvbE qGP5B3pQJ6ppyHV2tV+Jq/7cJHpQgtLQh59qFhHdytTr0c3kXBHQLYM5UzFtzuat7IPfRM cKtGyhaE7XsI6czt6sB3JcvBly8+SBVgIGoT5nai7yNneGtHD2aMoxAuQRZl9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1777735245; 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=nRWgic/Tk+vP3Oj2EJxks848MqmZcZVyaJzFF39zLNQ=; b=H/4TKJoE/0QAnQaoFDsGTyRzTGIVbxPQJFeCtN7josMDGYYm15stpmK0ubDzPvzAcAT3ZR TTx4JoqGPOjuhWJxu8RuT4LScAwN9/SOmxWKkJUo5AK8IzfE100ZURJAAuWQJ6QURV44lI VFrOdkqmYEtwfUT57PBkIPnGhfIuPU3txVhH8+Ho/fHUTBrKM9gSti+6+huNHabHJsKKvK jivDfyedcM1o2W0Isa7XuNrCiERcQcEsAjFJsUNFdhJbHF16hUo7b8/PHUBe6Na79kyOrG w+rsOxKJO0dgYbhlyUlnjRrW3qWjlMWsDG3EVKIioVhqEIKtcDAvhpeVRScRuw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4g7BS94d71zrdd for ; Sat, 02 May 2026 15:20:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1c022 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 02 May 2026 15:20:41 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: 3e845b109056 - main - ping: fix listing test cases when scapy is not installed 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3e845b1090565912375c5578cf0399d27b7fa70c Auto-Submitted: auto-generated Date: Sat, 02 May 2026 15:20:41 +0000 Message-Id: <69f61649.1c022.73b2a773@gitrepo.freebsd.org> The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=3e845b1090565912375c5578cf0399d27b7fa70c commit 3e845b1090565912375c5578cf0399d27b7fa70c Author: Alan Somers AuthorDate: 2026-05-01 23:06:35 +0000 Commit: Alan Somers CommitDate: 2026-05-02 15:20:16 +0000 ping: fix listing test cases when scapy is not installed The ATF-python test program was attempting to list test cases that require scapy. But it attempted to import the scapy module before the test cases had been listed, resulting in an ImportError that kyua interpreted as a test program crash. Fix this behavior by handling that ImportError well enough to list test cases, but not run them. If scapy isn't present, Kyua will refuse to run the test cases. But it needs to be able to list them in order to know to skip them. Sponsored by: ConnectWise MFC after: 2 weeks Reviewed by: maxim Differential Revision: https://reviews.freebsd.org/D56765 --- sbin/ping/tests/test_ping.py | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/sbin/ping/tests/test_ping.py b/sbin/ping/tests/test_ping.py index 3f9a3aecf924..fdf9c875329c 100644 --- a/sbin/ping/tests/test_ping.py +++ b/sbin/ping/tests/test_ping.py @@ -12,7 +12,31 @@ from typing import List from typing import Optional logging.getLogger("scapy").setLevel(logging.CRITICAL) -import scapy.all as sc +try: + import scapy.all as sc +except ImportError as e: + # Fake scapy well enough to be able to list test cases + from types import SimpleNamespace + sc = SimpleNamespace( + scapy=SimpleNamespace( + fields=SimpleNamespace( + SourceIPField=0, + ByteEnumField=0, + MultiEnumField=0, + BitField=0, + FlagsField=0, + ByteField=0, + IPField=0, + ShortField=0, + ), + layers=SimpleNamespace( + inet=SimpleNamespace( + DestIPField=0, + ICMPTimeStampField=0, + ) + ) + ) + ) def build_response_packet(echo, ip, icmp, oip_ihl, special):