"""Where the SSH server's algorithm lists are set (NetOrk/netork#1769). OPNsense writes sshd_config from config.xml (````), and no API controller reads or writes that section: the lists are set on the legacy Administration page. The driver therefore does not harden the SSH server; it says, as data, where a person sets the lists by hand. """ from __future__ import annotations from napalm_device_types.ssh_server import SSH_ALGORITHM_CLASSES from napalm_opnsense import OPNsenseDriver def test_the_page_that_sets_the_lists(): assert OPNsenseDriver.SSH_SETTINGS_MENU == ( "System", "Settings", "Administration", "Secure Shell", ) def test_a_field_for_every_algorithm_class(): assert OPNsenseDriver.SSH_SETTINGS_FIELDS == { "kex": "Key exchange algorithms", "cipher": "Ciphers", "mac": "MACs", "hostkey": "Host key algorithms", } assert set(OPNsenseDriver.SSH_SETTINGS_FIELDS) == set(SSH_ALGORITHM_CLASSES) def test_the_driver_does_not_harden_the_ssh_server_itself(): assert not callable(getattr(OPNsenseDriver, "harden_ssh_server", None))