summaryrefslogtreecommitdiff
path: root/smoketest
diff options
context:
space:
mode:
authormergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-10-09 10:14:30 +0300
committerGitHub <noreply@github.com>2024-10-09 10:14:30 +0300
commitbb2fa1da6aac5786976614136ec34dfb0854eee4 (patch)
tree471d08e50905af9828cb5023eff192c63accd7a4 /smoketest
parent65991f7f4d79b0c9255776a4160946e52e7da320 (diff)
downloadvyos-1x-bb2fa1da6aac5786976614136ec34dfb0854eee4.tar.gz
vyos-1x-bb2fa1da6aac5786976614136ec34dfb0854eee4.zip
T6525: Add default dir for ext-scripts without absolute path (#4144)
(cherry picked from commit 2f52106dc160f217d6e27da45674c0231a93382a) Co-authored-by: khramshinr <khramshinr@gmail.com>
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)