docs: no services restart reading on the BSDs, and a test that keeps it so (NetOrk/netork#2750) #34
No files matched your search
@@ -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
|
||||||
|
|||||||
@@ -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")
|
||||||
Reference in new issue
Block a user