X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FPapiHistory.py;h=c4ee4ee495d91081f163edbc8306401a37b6bbea;hb=20cc67d5f23a7f4e05b08012bf3d3a63be4bcf63;hp=ec5b1675eb654f02890af624f70b1e8dee5c93c5;hpb=1999c2ecc15760a57bdf34498635432ddb0321e0;p=csit.git diff --git a/resources/libraries/python/PapiHistory.py b/resources/libraries/python/PapiHistory.py index ec5b1675eb..c4ee4ee495 100644 --- a/resources/libraries/python/PapiHistory.py +++ b/resources/libraries/python/PapiHistory.py @@ -51,9 +51,28 @@ class PapiHistory(object): def add_to_papi_history(node, csit_papi_command, papi=True, **kwargs): """Add command to PAPI command history on DUT node. + Repr strings are used for argument values. + 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 @@ -67,7 +86,7 @@ class PapiHistory(object): if papi: args = list() for key, val in kwargs.iteritems(): - args.append("{key}={val}".format(key=key, val=val)) + args.append("{key}={val!r}".format(key=key, val=val)) item = "{cmd}({args})".format(cmd=csit_papi_command, args=",".join(args)) else: @@ -87,7 +106,7 @@ class PapiHistory(object): history_list = DICT__DUTS_PAPI_HISTORY[node['host']] if not history_list: history_list = ("No PAPI command executed", ) - logger.trace( + logger.info( "{0} PAPI command history:\n{1}\n".format( node['host'], "\n".join(history_list)))