diff options
author | Christian Breunig <christian@breunig.cc> | 2023-01-19 08:06:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-19 08:06:54 +0100 |
commit | 56074c22eb7420bdaa12b41e42b61ef1d9583cd3 (patch) | |
tree | ea788f5e51533996e0b9eca4730719ddcb40e507 /smoketest/scripts | |
parent | 1f34027a1cb85c289da0f3b2b74263a80118bee7 (diff) | |
parent | 67fa5f55ac79838768b4b0a5f6d2c4b3b4c8e762 (diff) | |
download | vyos-1x-56074c22eb7420bdaa12b41e42b61ef1d9583cd3.tar.gz vyos-1x-56074c22eb7420bdaa12b41e42b61ef1d9583cd3.zip |
Merge pull request #1697 from nicolas-fort/snmp_rework
T4857: SNMP: Implement FRR SNMP Recomendations
Diffstat (limited to 'smoketest/scripts')
-rwxr-xr-x | smoketest/scripts/cli/test_service_snmp.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_service_snmp.py b/smoketest/scripts/cli/test_service_snmp.py index e80c689cc..b18b9e7a1 100755 --- a/smoketest/scripts/cli/test_service_snmp.py +++ b/smoketest/scripts/cli/test_service_snmp.py @@ -123,6 +123,28 @@ class TestSNMPService(VyOSUnitTestSHIM.TestCase): self.assertTrue(process_named_running(PROCESS_NAME)) self.cli_delete(['interfaces', 'dummy', dummy_if]) + ## Check communities and default view RESTRICTED + for auth in ['ro', 'rw']: + community = 'VyOS' + auth + for addr in clients: + if is_ipv4(addr): + entry = auth + 'community ' + community + ' ' + addr + ' -V' + else: + entry = auth + 'community6 ' + community + ' ' + addr + ' -V' + config = get_config_value(entry) + expected = 'RESTRICTED' + self.assertIn(expected, config) + for addr in networks: + if is_ipv4(addr): + entry = auth + 'community ' + community + ' ' + addr + ' -V' + else: + entry = auth + 'community6 ' + community + ' ' + addr + ' -V' + config = get_config_value(entry) + expected = 'RESTRICTED' + self.assertIn(expected, config) + # And finally check global entry for RESTRICTED view + config = get_config_value('view RESTRICTED included .1') + self.assertIn('80', config) def test_snmpv3_sha(self): # Check if SNMPv3 can be configured with SHA authentication |