git: 8fa55fdcae4e - main - tests/dhclient: Skip tests if scapy is not installed

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Wed, 28 Oct 2026 20:27:40 UTC
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=8fa55fdcae4ecbd2ec13ef91cc9d172095e21189

commit 8fa55fdcae4ecbd2ec13ef91cc9d172095e21189
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2026-10-28 20:26:44 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2026-10-28 20:26:44 +0000

    tests/dhclient: Skip tests if scapy is not installed
    
    Fixes:  a143197801c6 ("dhclient: Add some regression tests")
---
 sbin/dhclient/tests/functional.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sbin/dhclient/tests/functional.py b/sbin/dhclient/tests/functional.py
index 205bd11a76ef..518d1050aba7 100644
--- a/sbin/dhclient/tests/functional.py
+++ b/sbin/dhclient/tests/functional.py
@@ -20,8 +20,6 @@ def mac_to_chaddr(mac_str):
     return mac_bytes + b"\x00" * (16 - len(mac_bytes))
 
 
-
-
 class TestDhclient(VnetTestTemplate):
     _SERVER_IP = "192.0.2.1"
     _CLIENT_IP = "192.0.2.10"
@@ -169,6 +167,7 @@ class TestDhclient(VnetTestTemplate):
         )
 
     @pytest.mark.require_user("root")
+    @pytest.mark.require_progs(["scapy"])
     def test_classless_routes_truncated(self):
         """
         Verify that dhclient rejects a DHCPOFFER containing a truncated
@@ -198,6 +197,7 @@ class TestDhclient(VnetTestTemplate):
         assert "inet {}".format(self._CLIENT_IP) in result["ifconfig"]
 
     @pytest.mark.require_user("root")
+    @pytest.mark.require_progs(["scapy"])
     def test_filename_backslash(self):
         """
         Verify that backslashes in the BOOTP filename don't cause the
@@ -212,6 +212,7 @@ class TestDhclient(VnetTestTemplate):
         assert "inet {}".format(self._CLIENT_IP) in result["ifconfig"]
 
     @pytest.mark.require_user("root")
+    @pytest.mark.require_progs(["scapy"])
     def test_sname_valid(self):
         """
         Verify that a valid server name is preserved in the lease file.
@@ -225,6 +226,7 @@ class TestDhclient(VnetTestTemplate):
         assert "dhcp.example.com" in result["lease"]
 
     @pytest.mark.require_user("root")
+    @pytest.mark.require_progs(["scapy"])
     def test_sname_quote(self):
         """
         Verify that a double quote in the BOOTP server name causes the