summaryrefslogtreecommitdiff
path: root/smoketest
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2024-10-10 16:15:54 +0100
committerGitHub <noreply@github.com>2024-10-10 16:15:54 +0100
commit9cb3ba7dc81401894c1f2ea281715048043da997 (patch)
tree37f824246a2de341f4be20cf6445495c850ab7bf /smoketest
parentded9fa21622b12e762aba230b094608a8cbc54cc (diff)
parent4cbf3b87503bd40b045c6bb1ef3893cefda896fc (diff)
downloadvyos-1x-9cb3ba7dc81401894c1f2ea281715048043da997.tar.gz
vyos-1x-9cb3ba7dc81401894c1f2ea281715048043da997.zip
Merge pull request #4145 from vyos/mergify/bp/sagitta/pr-3827
T6525: Add default dir for ext-scripts without absolute path (backport #3827)
Diffstat (limited to 'smoketest')
-rwxr-xr-xsmoketest/scripts/cli/test_service_snmp.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_service_snmp.py b/smoketest/scripts/cli/test_service_snmp.py
index b3daa90d0..7d5eaa440 100755
--- a/smoketest/scripts/cli/test_service_snmp.py
+++ b/smoketest/scripts/cli/test_service_snmp.py
@@ -246,5 +246,19 @@ class TestSNMPService(VyOSUnitTestSHIM.TestCase):
for excluded in snmpv3_view_oid_exclude:
self.assertIn(f'view {snmpv3_view} excluded .{excluded}', tmp)
+ def test_snmp_script_extensions(self):
+ extensions = {
+ 'default': 'snmp_smoketest_extension_script.sh',
+ 'external': '/run/external_snmp_smoketest_extension_script.sh'
+ }
+
+ for key, val in extensions.items():
+ self.cli_set(base_path + ['script-extensions', 'extension-name', key, 'script', val])
+ self.cli_commit()
+
+ self.assertEqual(get_config_value('extend default'), f'/config/user-data/{extensions["default"]}')
+ self.assertEqual(get_config_value('extend external'), extensions["external"])
+
+
if __name__ == '__main__':
unittest.main(verbosity=2)