diff options
author | Klement Sekera <ksekera@cisco.com> | 2016-11-18 07:38:42 +0100 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2016-12-05 18:44:45 +0000 |
commit | 7bb873a4cc068a6cc3c9d0e1d32987c5f8003904 (patch) | |
tree | 991f04ba994779140f98bdcf44af09d63d8c69c8 /test/vpp_papi_provider.py | |
parent | 86fb04db3ec3979f20111bf4dfa945a1fa2275d4 (diff) |
make test: fix missing log/packet messages
Change-Id: Idb3119792943664748c4abc3829ad723f4156dfe
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'test/vpp_papi_provider.py')
-rw-r--r-- | test/vpp_papi_provider.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/test/vpp_papi_provider.py b/test/vpp_papi_provider.py index dc90289ecb2..51cc20bad28 100644 --- a/test/vpp_papi_provider.py +++ b/test/vpp_papi_provider.py @@ -1,6 +1,5 @@ import os import array -from logging import error from hook import Hook do_import = True @@ -32,10 +31,11 @@ class VppPapiProvider(object): """ - def __init__(self, name, shm_prefix): + def __init__(self, name, shm_prefix, test_class): self.hook = Hook("vpp-papi-provider") self.name = name self.shm_prefix = shm_prefix + self.test_class = test_class def register_hook(self, hook): """Replace hook registration with new hook @@ -68,7 +68,7 @@ class VppPapiProvider(object): if hasattr(reply, 'retval') and reply.retval != expected_retval: msg = "API call failed, expected retval == %d, got %s" % ( expected_retval, repr(reply)) - error(msg) + self.test_class.test_instance.logger.error(msg) raise Exception(msg) self.hook.after_api(api_fn.__name__, api_args) return reply @@ -497,7 +497,8 @@ class VppPapiProvider(object): ) ) - def sw_interface_span_enable_disable(self, sw_if_index_from, sw_if_index_to, enable=1): + def sw_interface_span_enable_disable( + self, sw_if_index_from, sw_if_index_to, enable=1): """ :param sw_if_index_from: @@ -683,3 +684,5 @@ class VppPapiProvider(object): next_hop_table_id, stack)) + return self.api(vpp_papi.sw_interface_span_enable_disable, + (sw_if_index_from, sw_if_index_to, enable)) |