diff options
author | Christian Breunig <christian@breunig.cc> | 2023-12-25 11:11:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-25 11:11:08 +0100 |
commit | 7f16fffe0afc76fa780f5044d06dfc754332860e (patch) | |
tree | a764448c31a4b0a15ecb488331bca6c8c30d4b5e /smoketest | |
parent | b1a35b8ae02c7a72ee29bf3e1595fedf254479ee (diff) | |
parent | 1902f252c4c270cf7981fecd486e293ec2182fd9 (diff) | |
download | vyos-1x-7f16fffe0afc76fa780f5044d06dfc754332860e.tar.gz vyos-1x-7f16fffe0afc76fa780f5044d06dfc754332860e.zip |
Merge pull request #2688 from vyos/mergify/bp/sagitta/pr-2687
snmp: T5855: migrate "set service lldp snmp enable" to "set service lldp snmp" (backport #2687)
Diffstat (limited to 'smoketest')
-rw-r--r-- | smoketest/configs/ospf-small | 3 | ||||
-rwxr-xr-x | smoketest/scripts/cli/test_service_lldp.py | 16 |
2 files changed, 18 insertions, 1 deletions
diff --git a/smoketest/configs/ospf-small b/smoketest/configs/ospf-small index 767f4e21f..b3002b1af 100644 --- a/smoketest/configs/ospf-small +++ b/smoketest/configs/ospf-small @@ -81,6 +81,9 @@ service { lldp { interface all { } + snmp { + enable + } } snmp { community public { diff --git a/smoketest/scripts/cli/test_service_lldp.py b/smoketest/scripts/cli/test_service_lldp.py index ee26844ab..7e30b43f5 100755 --- a/smoketest/scripts/cli/test_service_lldp.py +++ b/smoketest/scripts/cli/test_service_lldp.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright (C) 2022 VyOS maintainers and contributors +# Copyright (C) 2022-2023 VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as @@ -122,6 +122,20 @@ class TestServiceLLDP(VyOSUnitTestSHIM.TestCase): self.assertIn(f'configure ports {interface} med location elin "{elin}"', config) self.assertIn(f'configure system interface pattern "{interface}"', config) + def test_06_lldp_snmp(self): + self.cli_set(base_path + ['snmp']) + + # verify - can not start lldp snmp without snmp beeing configured + with self.assertRaises(ConfigSessionError): + self.cli_commit() + self.cli_set(['service', 'snmp']) + self.cli_commit() + + # SNMP required process to be started with -x option + tmp = read_file('/etc/default/lldpd') + self.assertIn('-x', tmp) + + self.cli_delete(['service', 'snmp']) if __name__ == '__main__': unittest.main(verbosity=2) |