Merge pull request 'docs: no services restart reading on the BSDs, and a test that keeps it so (NetOrk/netork#2750)' (#34) from docs/no-services-restart into main
driver / standard (push) Successful in 20s
driver / lint (push) Successful in 16s
driver / types (push) Successful in 58s
driver / test (3.12) (push) Successful in 1m7s
driver / test (3.13) (push) Successful in 1m3s
driver / lowest (push) Successful in 34s
driver / build (push) Successful in 31s
driver / security (push) Successful in 1m13s
CI / driver (push) Successful in 2m56s
driver / publish (push) Skipped

This commit was merged in pull request #34.
This commit is contained in:
christianmanivong committed 2026-11-26 18:56:45 +00:00
commit 41f253dafd
2 files changed
+18

No files matched your search

+7
View File
@@ -55,6 +55,13 @@ There is deliberately no `get_kernel_facts`: `KernelFactsMixin` reports a
Linux kernel's modules and `CONFIG_*` options, which a BSD kernel does not Linux kernel's modules and `CONFIG_*` options, which a BSD kernel does not
have, and `hasattr(driver, "get_kernel_facts")` has to stay truthful. have, and `hasattr(driver, "get_kernel_facts")` has to stay truthful.
Nor is there a `get_services_need_restart` (napalm-device-types'
`ServicesRestartMixin`, NetOrk/netork#2750): it reads `needrestart` or each
process's `/proc/<pid>/maps` and names systemd units by cgroup, none of which a
BSD has. Mixed in, it would read nothing, or read clean; without it the caller
knows the reading was not made. A FreeBSD reading of its own (`procstat -v`, the
rc.d service behind each PID) is #33.
**Updates.** `security` on FreeBSD comes from VuXML (`pkg audit`): True for a **Updates.** `security` on FreeBSD comes from VuXML (`pkg audit`): True for a
package it lists as vulnerable, False for one it does not, None when the audit package it lists as vulnerable, False for one it does not, None when the audit
could not run. OpenBSD's tools do not say, so it is None there. Base-system could not run. OpenBSD's tools do not say, so it is None there. Base-system
+11
View File
@@ -791,3 +791,14 @@ class TestSshServerAuth:
driver = _channel(FreeBSDDriver, {(SSHD_EFFECTIVE_COMMAND, True): ("", 1)}) driver = _channel(FreeBSDDriver, {(SSHD_EFFECTIVE_COMMAND, True): ("", 1)})
with pytest.raises(RuntimeError, match="sshd -T"): with pytest.raises(RuntimeError, match="sshd -T"):
driver.get_ssh_server_auth() driver.get_ssh_server_auth()
class TestNoServicesRestartReading:
"""napalm-device-types' ``ServicesRestartMixin`` reads Linux's ``/proc`` and systemd's
cgroups (NetOrk/netork#2750). A BSD host has neither, so the drivers do not offer it,
and the caller shows the reading as not made rather than as clean."""
@pytest.mark.parametrize("cls", [FreeBSDDriver, OpenBSDDriver])
def test_it_is_not_offered(self, cls):
assert not hasattr(cls, "get_services_need_restart")
assert not hasattr(cls, "_run_services_restart_command")