From e8c6a8f37470416e72a26fbbdfad24f8dcea7208 Mon Sep 17 00:00:00 2001 From: Oleksandr Kuchmystyi Date: Tue, 24 Feb 2026 15:12:44 +0300 Subject: 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. --- smoketest/scripts/cli/test_vpp.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'smoketest/scripts/cli') 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()) -- cgit v1.2.3