From f9f4137d09564da90a18fec9c9d7ceb64cb6c736 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Mon, 6 Jan 2025 18:05:06 +0100 Subject: configd: T6747: use one long-lived instance of FRRender (#4274) * smoketest: T6747: call wait after commit() only for FRR related tests Commit 702a60a8de28 ("smoketest: T6746: wait after commit() until frr-reload is no longer running") added a guard timeout for every commit executed via CLI smoketests. This commit changes the bahavior to only add the guard timeout for FRR related testscases. This improves the overall smoketest time. * configd: T6747: use one long-lived instance of FRRender Previously there was one FRRender() instance per config session. This resulted in re-rendering the FRR configuration every time a new config session was created. Example: vyos@vyos:~$ configure vyos@vyos# set interfaces dummy dum0 description foo vyos@vyos# commit vyos@vyos# exit vyos@vyos:~$ configure vyos@vyos# set interfaces dummy dum0 description bar vyos@vyos# commit vyos@vyos# exit In the past this caused a re-render of the FRR configuration as the delta check added in commit ec80c75d6776 ("frrender: T6746: only re-render FRR config if config_dict did change") evaluated to false, as it operated on a new instance of the FRRender class. With this change there is no FRR re-render, as there is nothing to update in FRR. --- smoketest/scripts/cli/test_protocols_pim.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'smoketest/scripts/cli/test_protocols_pim.py') diff --git a/smoketest/scripts/cli/test_protocols_pim.py b/smoketest/scripts/cli/test_protocols_pim.py index 1ba24c196..cc62769b3 100755 --- a/smoketest/scripts/cli/test_protocols_pim.py +++ b/smoketest/scripts/cli/test_protocols_pim.py @@ -17,6 +17,7 @@ import unittest from base_vyostest_shim import VyOSUnitTestSHIM +from base_vyostest_shim import CSTORE_GUARD_TIME from vyos.configsession import ConfigSessionError from vyos.frrender import pim_daemon @@ -26,6 +27,16 @@ from vyos.utils.process import process_named_running base_path = ['protocols', 'pim'] class TestProtocolsPIM(VyOSUnitTestSHIM.TestCase): + @classmethod + def setUpClass(cls): + # call base-classes classmethod + super(TestProtocolsPIM, cls).setUpClass() + # ensure we can also run this test on a live system - so lets clean + # out the current configuration :) + cls.cli_delete(cls, base_path) + # Enable CSTORE guard time required by FRR related tests + cls._commit_guard_time = CSTORE_GUARD_TIME + def tearDown(self): # pimd process must be running self.assertTrue(process_named_running(pim_daemon)) -- cgit v1.2.3