summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli
diff options
context:
space:
mode:
authorOleksandr Kuchmystyi <o.kuchmystyi@vyos.io>2026-02-24 15:12:44 +0300
committerOleksandr Kuchmystyi <o.kuchmystyi@vyos.io>2026-02-25 10:35:55 +0300
commite8c6a8f37470416e72a26fbbdfad24f8dcea7208 (patch)
tree45b563d25a7d0f8035ad87fad21038b388c461ee /smoketest/scripts/cli
parent662b45c159393aa9451c93b168da415021949857 (diff)
downloadvyos-1x-e8c6a8f37470416e72a26fbbdfad24f8dcea7208.tar.gz
vyos-1x-e8c6a8f37470416e72a26fbbdfad24f8dcea7208.zip
vpp: T8297: Fixed double enabling of VPP
When trying to configure the VPP interface using `set vpp settings interface eth0` and `commit`, user first see a success. Upon repeating the configuration after deleting and re-adding it, the commit fails with an error: - `FileExistsError: Cannot open locked storage: /run/vpp/vpp_conf.json` This indicates that another process is using the file or a previous operation did not release the lock, preventing new changes from being written. The commit adds context manager support and safe close to `JSONStorage` and refactor VPP config handling.
Diffstat (limited to 'smoketest/scripts/cli')
-rwxr-xr-xsmoketest/scripts/cli/test_vpp.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_vpp.py b/smoketest/scripts/cli/test_vpp.py
index a7bb19882..88c146022 100755
--- a/smoketest/scripts/cli/test_vpp.py
+++ b/smoketest/scripts/cli/test_vpp.py
@@ -1730,6 +1730,29 @@ class TestVPP(VyOSUnitTestSHIM.TestCase):
_, out = rc_cmd('sudo vppctl show flowprobe feature')
self.assertIn(required_str, out)
+ def test_22_double_enabling_vpp(self):
+ # Verify double enabling of VPP
+
+ # Delete already defined settings from 'setUp' method
+ self.cli_delete(base_path)
+
+ # First commit changes
+ self.cli_set(base_path + ['settings', 'interface', interface])
+ self.cli_set(base_path + ['settings', 'poll-sleep-usec', '20'])
+ self.cli_commit()
+
+ # Delete all VPP changes
+ self.cli_delete(base_path)
+ self.cli_commit()
+
+ # Second commit changes
+ self.cli_set(base_path + ['settings', 'interface', interface])
+ self.cli_set(base_path + ['settings', 'poll-sleep-usec', '30'])
+ self.cli_commit()
+
+ # Ensure that VPP process is active
+ self.assertTrue(process_named_running(PROCESS_NAME))
+
if __name__ == '__main__':
unittest.main(verbosity=2, failfast=VyOSUnitTestSHIM.TestCase.debug_on())