summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli/test_protocols_ospf.py
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-10-04 07:25:53 +0200
committerGitHub <noreply@github.com>2024-10-04 07:25:53 +0200
commita305ebba559a2c3283e6b72b40edbb92e76b9cec (patch)
treea2d3ae1800708a3f2bfad217466f97cc8831e089 /smoketest/scripts/cli/test_protocols_ospf.py
parent5b10912a00ef5621c84aed2129ba3daaa7f06b98 (diff)
parent23e4ab655e3ef428250763150ae0a6a69fa59859 (diff)
downloadvyos-1x-a305ebba559a2c3283e6b72b40edbb92e76b9cec.tar.gz
vyos-1x-a305ebba559a2c3283e6b72b40edbb92e76b9cec.zip
Merge pull request #4125 from sever-sever/T6761
T6761: Add timeout for OSPF smoketest fail
Diffstat (limited to 'smoketest/scripts/cli/test_protocols_ospf.py')
-rwxr-xr-xsmoketest/scripts/cli/test_protocols_ospf.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_protocols_ospf.py b/smoketest/scripts/cli/test_protocols_ospf.py
index 905eaf2e9..c3ae54e12 100755
--- a/smoketest/scripts/cli/test_protocols_ospf.py
+++ b/smoketest/scripts/cli/test_protocols_ospf.py
@@ -15,6 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import unittest
+import time
from base_vyostest_shim import VyOSUnitTestSHIM
@@ -558,6 +559,22 @@ class TestProtocolsOSPF(VyOSUnitTestSHIM.TestCase):
# Verify FRR ospfd configuration
frrconfig = self.getFRRconfig('router ospf', daemon=PROCESS_NAME)
+ # Required to prevent the race condition T6761
+ retry_count = 0
+ max_retries = 60
+
+ while not frrconfig and retry_count < max_retries:
+ # Log every 10 seconds
+ if retry_count % 10 == 0:
+ print(f"Attempt {retry_count}: FRR config is still empty. Retrying...")
+
+ retry_count += 1
+ time.sleep(1)
+ frrconfig = self.getFRRconfig('router ospf', daemon=PROCESS_NAME)
+
+ if not frrconfig:
+ print("Failed to retrieve FRR config after 60 seconds")
+
self.assertIn(f'router ospf', frrconfig)
self.assertIn(f' network {network} area {area1}', frrconfig)