[Bug 299641] sbin.dhclient.functional.py: fails when listing testcases in CI

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 23 Oct 2026 15:51:54 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299641

--- Comment #9 from Enji Cooper <ngie@FreeBSD.org> ---
```
functional.py:__test_cases_list__  ->  broken: Test program did not exit
cleanly: exit status: 2; stdout:
Content-Type: application/X-atf-tp; version="1"

  [0.001s]
option-domain-search_test:main  ->  broken: Received signal 6  [0.020s]
pcp:normal  ->  skipped: Requires root privileges  [0.001s]
pcp:pcp  ->  skipped: Requires root privileges  [0.001s]

Results file id is usr_tests_sbin_dhclient.20261021-152358-386265
Results saved to
/home/ngie/.kyua/store/results.usr_tests_sbin_dhclient.20261021-152358-386265.db

0/4 passed (2 broken, 0 failed, 2 skipped)
```
Huh... so, the test program output the header, but failed to output any
testcases.

Well, let's try the theory of delaying the import (added the code below):

```python
sp = None

@pytest.fixture(autouse=True)
def delayed_imports():
    global sp
    sp = pytest.importorskip("scapy.all", reason="scapy.all did not import
cleanly")
```

Tada!
```
% kyua list -k /usr/tests/sbin/dhclient/Kyuafile
functional.py:TestDhclient::test_classless_routes_truncated
functional.py:TestDhclient::test_filename_backslash
functional.py:TestDhclient::test_sname_quote
functional.py:TestDhclient::test_sname_valid
option-domain-search_test:main
pcp:normal
pcp:pcp
```

There are a few easy fixes to make here:
- tools/ci needs to install scapy beforehand (not sure why this isn't being
done today).
- The import needs to be delayed, like I showed above.

I'll open up a differential for the second item.

-- 
You are receiving this mail because:
You are the assignee for the bug.