summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli/test_service_snmp.py
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2024-03-14 17:10:47 +0100
committerGitHub <noreply@github.com>2024-03-14 17:10:47 +0100
commit713b2f3702134abd9a34c539019a83d0e354eb22 (patch)
tree403500571455f7a01ada0d9b12b1648c2d2f9af4 /smoketest/scripts/cli/test_service_snmp.py
parentc2e66922c93b60d12f1f30bded3cd6d4bae7e117 (diff)
parent1fb746332602fd53eb5412c8f3c7fc38c09b7d26 (diff)
downloadvyos-1x-713b2f3702134abd9a34c539019a83d0e354eb22.tar.gz
vyos-1x-713b2f3702134abd9a34c539019a83d0e354eb22.zip
Merge pull request #3121 from natali-rs1985/T2998-equuleus
snmp: T2998: SNMP v3 oid "exclude" option fix
Diffstat (limited to 'smoketest/scripts/cli/test_service_snmp.py')
-rwxr-xr-xsmoketest/scripts/cli/test_service_snmp.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_service_snmp.py b/smoketest/scripts/cli/test_service_snmp.py
index 864097771..5066b7942 100755
--- a/smoketest/scripts/cli/test_service_snmp.py
+++ b/smoketest/scripts/cli/test_service_snmp.py
@@ -225,5 +225,25 @@ class TestSNMPService(VyOSUnitTestSHIM.TestCase):
# Check for running process
self.assertTrue(process_named_running(PROCESS_NAME))
+ def test_snmpv3_view_exclude(self):
+ snmpv3_group = 'default_group'
+ snmpv3_view = 'default_view'
+ snmpv3_view_oid = '1'
+ snmpv3_view_oid_exclude = ['1.3.6.1.2.1.4.21', '1.3.6.1.2.1.4.24']
+
+ self.cli_set(base_path + ['v3', 'group', snmpv3_group, 'view', snmpv3_view])
+ self.cli_set(base_path + ['v3', 'view', snmpv3_view, 'oid', snmpv3_view_oid])
+
+ for excluded in snmpv3_view_oid_exclude:
+ self.cli_set(base_path + ['v3', 'view', snmpv3_view, 'oid', snmpv3_view_oid, 'exclude', excluded])
+
+ self.cli_commit()
+
+ tmp = read_file(SNMPD_CONF)
+ # views
+ self.assertIn(f'view {snmpv3_view} included .{snmpv3_view_oid}', tmp)
+ for excluded in snmpv3_view_oid_exclude:
+ self.assertIn(f'view {snmpv3_view} excluded .{excluded}', tmp)
+
if __name__ == '__main__':
unittest.main(verbosity=2)