diff options
author | Peter Mikus <pmikus@cisco.com> | 2019-01-30 14:04:40 +0000 |
---|---|---|
committer | Peter Mikus <pmikus@cisco.com> | 2019-02-04 12:43:02 +0000 |
commit | 1634e19d9adb70b634c80b760aabac81fd4bfdd1 (patch) | |
tree | 3684386fbdecf33bca2a69a1acd5455ed37848f0 /resources/libraries/python/VPPUtil.py | |
parent | 9510e2ca6dbca1ab16b9db8054e9968facf4b699 (diff) |
CSIT-1411 Implement manual rx-placement override for bug in VPP
Change-Id: Ie3d2b1f40a607ce5190ccfea6a372bc072d0a3b9
Signed-off-by: Peter Mikus <pmikus@cisco.com>
Diffstat (limited to 'resources/libraries/python/VPPUtil.py')
-rw-r--r-- | resources/libraries/python/VPPUtil.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/resources/libraries/python/VPPUtil.py b/resources/libraries/python/VPPUtil.py index 63d9aaca86..82fded30b4 100644 --- a/resources/libraries/python/VPPUtil.py +++ b/resources/libraries/python/VPPUtil.py @@ -317,3 +317,36 @@ class VPPUtil(object): for node in nodes.values(): if node['type'] == NodeType.DUT: VPPUtil.show_event_logger_on_dut(node) + + @staticmethod + def vpp_show_threads(node): + """Show VPP threads on node. + + :param node: Node to run command on. + :type node: dict + :returns: VPP thread data. + :rtype: list + :raises RuntimeError: If failed to run command on host. + :raises PapiError: If no API reply received. + """ + api_data = list() + api = dict(api_name='show_threads') + api_args = dict() + api['api_args'] = api_args + api_data.append(api) + + with PapiExecutor(node) as papi_executor: + papi_executor.execute_papi(api_data) + try: + papi_executor.papi_should_have_passed() + api_reply = papi_executor.get_papi_reply() + except AssertionError: + raise RuntimeError('Failed to run {api_name} on host ' + '{host}!'.format(host=node['host'], **api)) + + if api_reply: + return \ + api_reply[0]['api_reply']['show_threads_reply']['thread_data'] + else: + raise PapiError('No reply received for {api_name} on host {host}!'. + format(host=node['host'], **api)) |