summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-07-22 20:13:52 +0200
committerGitHub <noreply@github.com>2024-07-22 20:13:52 +0200
commit1f5cb9d01536f2005f80e94845972e90dfcdd0fd (patch)
treed4f9d9a812b627090f07b0e4401f88737762be58 /smoketest/scripts/cli
parent748fb96319cc700dec9e8838e7162ec60d9b2c25 (diff)
parent2f52106dc160f217d6e27da45674c0231a93382a (diff)
downloadvyos-1x-1f5cb9d01536f2005f80e94845972e90dfcdd0fd.tar.gz
vyos-1x-1f5cb9d01536f2005f80e94845972e90dfcdd0fd.zip
Merge pull request #3827 from HollyGurza/T6525
T6525: Add default dir for ext-scripts without absolute path
Diffstat (limited to 'smoketest/scripts/cli')
-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)