X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FDUTSetup.py;h=e0479cfb6070269c924955692a78a047815ab546;hp=d76a2f40962938bcd793f9ef85d50ad421c90a4a;hb=95998a67270ffd72f09ce6f3d43235c723edf36b;hpb=e81d599029f31fb433089eecf0d160ab01719383 diff --git a/resources/libraries/python/DUTSetup.py b/resources/libraries/python/DUTSetup.py index d76a2f4096..e0479cfb60 100644 --- a/resources/libraries/python/DUTSetup.py +++ b/resources/libraries/python/DUTSetup.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016 Cisco and/or its affiliates. +# Copyright (c) 2018 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -26,7 +26,11 @@ class DUTSetup(object): """Contains methods for setting up DUTs.""" @staticmethod def start_vpp_service_on_all_duts(nodes): - """Start up the VPP service on all nodes.""" + """Start up the VPP service on all nodes. + + :param nodes: Nodes in the topology. + :type nodes: dict + """ ssh = SSH() for node in nodes.values(): if node['type'] == NodeType.DUT: @@ -402,3 +406,26 @@ class DUTSetup(object): if int(ret_code) != 0: raise RuntimeError('Failed to load {0} kernel module on host {1}'. format(module, node['host'])) + + @staticmethod + def vpp_enable_traces_on_all_duts(nodes): + """Enable vpp packet traces on all DUTs in the given topology. + + :param nodes: Nodes in the topology. + :type nodes: dict + """ + for node in nodes.values(): + if node['type'] == NodeType.DUT: + DUTSetup.vpp_enable_traces_on_dut(node) + + @staticmethod + def vpp_enable_traces_on_dut(node): + """Enable vpp packet traces on the DUT node. + + :param node: DUT node to set up. + :type node: dict + """ + + vat = VatExecutor() + vat.execute_script("enable_dpdk_traces.vat", node, json_out=False) + vat.execute_script("enable_vhost_user_traces.vat", node, json_out=False)