X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FVppConfigGenerator.py;h=15e8ffb3b54e528c343e7a85f1884395ffc032aa;hb=20cc67d5f23a7f4e05b08012bf3d3a63be4bcf63;hp=179e4a02c888a54d14fe87729e413754bb5c0e1e;hpb=0903fff5fdd647e4b5357c107219142738d377e9;p=csit.git diff --git a/resources/libraries/python/VppConfigGenerator.py b/resources/libraries/python/VppConfigGenerator.py index 179e4a02c8..15e8ffb3b5 100644 --- a/resources/libraries/python/VppConfigGenerator.py +++ b/resources/libraries/python/VppConfigGenerator.py @@ -11,10 +11,16 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""VPP Configuration File Generator library.""" +"""VPP Configuration File Generator library. + +TODO: Support initialization with default values, +so that we do not need to have block of 6 "Add Unix" commands +in 7 various places of CSIT code. +""" import re +from resources.libraries.python.Constants import Constants from resources.libraries.python.ssh import exec_cmd_no_error from resources.libraries.python.topology import NodeType from resources.libraries.python.topology import Topology @@ -191,6 +197,11 @@ class VppConfigGenerator(object): path = ['unix', 'exec'] self.add_config_item(self._nodeconfig, value, path) + def add_socksvr(self, socket=Constants.SOCKSVR_PATH): + """Add socksvr configuration.""" + path = ['socksvr', 'socket-name'] + self.add_config_item(self._nodeconfig, socket, path) + def add_api_segment_gid(self, value='vpp'): """Add API-SEGMENT gid configuration. @@ -436,6 +447,15 @@ class VppConfigGenerator(object): path = ['statseg', 'size'] self.add_config_item(self._nodeconfig, value, path) + def add_statseg_per_node_counters(self, value): + """Add stats per-node-counters configuration. + + :param value: "on" to switch the counters on. + :type value: str + """ + path = ['statseg', 'per-node-counters'] + self.add_config_item(self._nodeconfig, value, path) + def add_plugin(self, state, *plugins): """Add plugin section for specific plugin(s).