papi: add a per-call _timeout option

add the ability to override the default timeout value on a per-call
 basis.
 Use:
   rv = self.vapi.papi.cli_inband(cmd='wait 10', _timeout=15)

Type: feature

Change-Id: Ia90a58586a1f63e02118599a2a4b7141e5a0b90d
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
This commit is contained in:
Paul Vinciguerra
2019-12-02 13:40:33 -05:00
committed by Ole Trøan
parent 5d440d9cb6
commit e2ccdf0316
4 changed files with 20 additions and 9 deletions

View File

@@ -17,7 +17,7 @@ class TestCLI(VppTestCase):
@classmethod
def setUpClass(cls):
# using the framework default
# cls.vapi_response_timeout = 5
cls.vapi_response_timeout = 5
super(TestCLI, cls).setUpClass()
@classmethod
@@ -44,6 +44,11 @@ class TestCLI(VppTestCase):
vpp_transport_shmem.VppTransportShmemIOError) as ctx:
rv = self.vapi.papi.cli_inband(cmd='wait 10')
def test_long_cli_delay_override(self):
""" Test per-command _timeout option.""" # noqa
rv = self.vapi.papi.cli_inband(cmd='wait 10', _timeout=15)
self.assertEqual(rv.retval, 0)
class TestCLIExtendedVapiTimeout(VppTestCase):
maxDiff = None