feat(zabbix): an active-only agent closes the port netOrk opened for it (NetOrk/netork#2693)

Every rule the firewall step adds in ufw is recorded in napalm-device-types'
opened_ports record, only when ufw did not have it before. For an active-only
agent, _revoke_zabbix_agent_sources removes exactly the agent's recorded rules
and reports what ufw has left for the port.
This commit is contained in:
Christian Manivong committed 2026-11-26 08:21:53 +01:00
1 parent bc3eb86723
commit 370aeed482
6 files changed
+183 -8

No files matched your search

+2 -1
View File
@@ -82,7 +82,8 @@ class TestSnmpAgent:
def test_no_temp_file_with_an_application_name(self, driver, node):
driver.configure_snmp_agent(SETTINGS)
assert not any("netork" in c for c in node.ran)
# The record of opened rules (/var/lib/netork, NetOrk/netork#2693) is no temp file.
assert not any(re.search(r"/tmp/\S*netork", c) for c in node.ran)
def test_ufw_opens_only_for_the_allowed_sources(self, driver, node):
node.status["command -v ufw"] = 0