tests: fix test cov for PG Stream and Session SDL 84/42584/2
authorIvan Ivanets <[email protected]>
Thu, 27 Mar 2025 13:53:04 +0000 (15:53 +0200)
committerIvan Ivanets <[email protected]>
Thu, 27 Mar 2025 14:41:33 +0000 (16:41 +0200)
Type: test

Localized cli response waiting time configuration only for
test_pg_stream and test_session_sdl instead of asfframework conf

Change-Id: Iabeccdda97e518662f1243edd91217c02cdc8711
Signed-off-by: Ivan Ivanets <[email protected]>
test/asf/asfframework.py
test/asf/test_session_sdl.py
test/test_pg_stream.py

index 8e565d2..7670a07 100644 (file)
@@ -652,8 +652,6 @@ class VppAsfTestCase(CPUInterface, unittest.TestCase):
                 cls.pump_thread.start()
             if cls.debug_gdb or cls.debug_gdbserver or cls.debug_attach:
                 cls.vapi_response_timeout = 0
-            elif config.gcov:
-                cls.vapi_response_timeout = 20
             cls.vapi = VppPapiProvider(cls.__name__, cls, cls.vapi_response_timeout)
             if cls.step:
                 hook = hookmodule.StepHook(cls)
index 53301f7..d2e30da 100644 (file)
@@ -5,6 +5,7 @@ import unittest
 from framework import VppTestCase
 from asfframework import VppTestRunner, tag_fixme_vpp_workers
 from ipaddress import IPv4Network, IPv6Network
+from config import config
 
 from vpp_ip_route import (
     VppIpRoute,
@@ -25,6 +26,10 @@ class TestSessionSDL(VppTestCase):
 
     @classmethod
     def setUpClass(cls):
+        # increase vapi timeout, to avoid
+        # failures reported on test-cov
+        if config.gcov:
+            cls.vapi_response_timeout = 20
         super(TestSessionSDL, cls).setUpClass()
 
     @classmethod
index 471c85c..915a5aa 100644 (file)
@@ -11,6 +11,7 @@ from scapy.layers.inet6 import IPv6
 
 from framework import VppTestCase
 from asfframework import VppTestRunner
+from config import config
 
 
 class TestPgStream(VppTestCase):
@@ -19,6 +20,18 @@ class TestPgStream(VppTestCase):
     def __init__(self, *args):
         VppTestCase.__init__(self, *args)
 
+    @classmethod
+    def setUpClass(cls):
+        # increase vapi timeout, to avoid
+        # failures reported on test-cov
+        if config.gcov:
+            cls.vapi_response_timeout = 20
+        super(TestPgStream, cls).setUpClass()
+
+    @classmethod
+    def tearDownClass(cls):
+        super(TestPgStream, cls).tearDownClass()
+
     def setUp(self):
         super(TestPgStream, self).setUp()