"""
self._vpp_config_filename = filename
+ def get_config_filename(self):
+ """Get startup configuration filename.
+
+ :returns: Startup configuration filename.
+ :rtype: str
+ """
+ return self._vpp_config_filename
+
+ def get_config_str(self):
+ """Get dumped startup configuration in VPP config format.
+
+ :returns: Startup configuration in VPP config format.
+ :rtype: str
+ """
+ self.dump_config(self._nodeconfig)
+ return self._vpp_config
+
def add_config_item(self, config, value, path):
"""Add startup configuration item.
"""
path = ['unix', 'cli-listen']
self.add_config_item(self._nodeconfig, value, path)
- self._nodeconfig = {'unix': {'nodaemon': ''}}
def add_unix_nodaemon(self):
"""Add UNIX nodaemon configuration."""
path = ['unix', 'nodaemon']
self.add_config_item(self._nodeconfig, '', path)
+ def add_unix_exec(self, value):
+ """Add UNIX exec configuration."""
+ path = ['unix', 'exec']
+ self.add_config_item(self._nodeconfig, value, path)
+
def add_dpdk_dev(self, *devices):
"""Add DPDK PCI device configuration.
path = ['dpdk', 'dev default', 'num-tx-queues']
self.add_config_item(self._nodeconfig, value, path)
+ def add_dpdk_dev_default_rxd(self, value):
+ """Add DPDK dev default rxd configuration.
+
+ :param value: Default number of rxds.
+ :type value: str
+ """
+ path = ['dpdk', 'dev default', 'num-rx-desc']
+ self.add_config_item(self._nodeconfig, value, path)
+
+ def add_dpdk_dev_default_txd(self, value):
+ """Add DPDK dev default txd configuration.
+
+ :param value: Default number of txds.
+ :type value: str
+ """
+ path = ['dpdk', 'dev default', 'num-tx-desc']
+ self.add_config_item(self._nodeconfig, value, path)
+
+
def add_dpdk_socketmem(self, value):
"""Add DPDK socket memory configuration.
def add_api_trace(self):
"""Add API trace configuration."""
path = ['api-trace', 'on']
- self.add_config_item(self._nodeconfig, path, '')
+ self.add_config_item(self._nodeconfig, '', path)
def add_ip6_hash_buckets(self, value):
"""Add IP6 hash buckets configuration.
path = ['ip6', 'heap-size']
self.add_config_item(self._nodeconfig, value, path)
+ def add_plugin_disable(self, *plugins):
+ """Add plugin disable for specific plugin.
+
+ :param plugins: Plugin(s) to disable.
+ :type plugins: list
+ """
+ for plugin in plugins:
+ path = ['plugins', 'plugin {0}'.format(plugin), 'disable']
+ self.add_config_item(self._nodeconfig, ' ', path)
+
def add_dpdk_no_multi_seg(self):
"""Add DPDK no-multi-seg configuration."""
path = ['dpdk', 'no-multi-seg']
self.add_config_item(self._nodeconfig, '', path)
- def add_snat(self, value='deterministic'):
- """Add SNAT configuration.
+ def add_nat(self, value='deterministic'):
+ """Add NAT configuration.
- :param value: SNAT mode.
+ :param value: NAT mode.
:type value: str
"""
- path = ['snat']
+ path = ['nat']
self.add_config_item(self._nodeconfig, value, path)
def apply_config(self, waittime=5, retries=12):