X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FPapiHistory.py;h=6a4f913d0389d316f287c593965e3907c16586ee;hp=eede0d250fe956fc799e62b99cc75a6c98f6bc24;hb=cc0c2870a18fb74a56410eca2d1870bddc945397;hpb=86af0b9a49b5513e328359241a11a1ca44075bc5 diff --git a/resources/libraries/python/PapiHistory.py b/resources/libraries/python/PapiHistory.py index eede0d250f..6a4f913d03 100644 --- a/resources/libraries/python/PapiHistory.py +++ b/resources/libraries/python/PapiHistory.py @@ -54,6 +54,23 @@ class PapiHistory(object): The argument name 'csit_papi_command' must be unique enough as it cannot be repeated in kwargs. + Examples of PAPI history items: + + Request without parameters: + show_threads() + + Request with parameters: + ipsec_select_backend(index=1,protocol=1) + + Dump: + sw_interface_rx_placement_dump(sw_if_index=4) + + VPP Stats: + vpp-stats(path=['^/if', '/err/ip4-input', '/sys/node/ip4-input']) + + VAT: + sw_interface_set_flags sw_if_index 3 admin-up link-up + :param node: DUT node to add command to PAPI command history for. :param csit_papi_command: Command to be added to PAPI command history. :param papi: Says if the command to store is PAPi or VAT. Remove when @@ -84,12 +101,12 @@ class PapiHistory(object): :param node: DUT node to show PAPI command history for. :type node: dict """ - history = "\nNo PAPI command executed" - if DICT__DUTS_PAPI_HISTORY[node['host']]: - history = "".join(["\n{}".format( - cmd) for cmd in DICT__DUTS_PAPI_HISTORY[node['host']]]) - logger.trace( - "{0} PAPI command history:\n{1}\n".format(node['host'], history)) + history_list = DICT__DUTS_PAPI_HISTORY[node['host']] + if not history_list: + history_list = ("No PAPI command executed", ) + logger.info( + "{0} PAPI command history:\n{1}\n".format( + node['host'], "\n".join(history_list))) @staticmethod def show_papi_history_on_all_duts(nodes):