+ if 'enable_vhost_user' not in self._nodeconfig[hostname]:
+ self._nodeconfig[hostname]['enable_vhost_user'] = []
+ self._nodeconfig[hostname]['enable_vhost_user'].\
+ append("enable-vhost-user")
+ logger.debug('Setting hostname {} config with {}'.
+ format(hostname, "enable-vhost-user"))
+
+ def add_snat_config(self, node):
+ """Add SNAT configuration for the node.
+
+ :param node: DUT node.
+ :type node: dict
+ :returns: nothing
+ """
+ if node['type'] != NodeType.DUT:
+ raise ValueError('Node type is not a DUT')
+ hostname = Topology.get_node_hostname(node)
+ if hostname not in self._nodeconfig:
+ self._nodeconfig[hostname] = {}
+ if 'snat_config' not in self._nodeconfig[hostname]:
+ self._nodeconfig[hostname]['snat_config'] = []
+ self._nodeconfig[hostname]['snat_config'].append("deterministic")
+ logger.debug('Setting hostname {} config with {}'.
+ format(hostname, "SNAT"))
+
+ def add_cryptodev_config(self, node, count):
+ """Add cryptodev configuration for node.
+
+ :param node: DUT node.
+ :param count: Number of crypto devices to add.
+ :type node: dict
+ :type count: int
+ :returns: nothing
+ :raises ValueError: If node type is not a DUT
+ """
+ if node['type'] != NodeType.DUT:
+ raise ValueError('Node type is not a DUT')
+ hostname = Topology.get_node_hostname(node)
+ if hostname not in self._nodeconfig:
+ self._nodeconfig[hostname] = {}
+
+ cryptodev = Topology.get_cryptodev(node)
+ cryptodev_config = ''
+
+ for i in range(count):
+ cryptodev_config += 'dev {}\n'.format(
+ re.sub(r'\d.\d$', '1.'+str(i), cryptodev))
+
+ self._nodeconfig[hostname]['cryptodev_config'] = cryptodev_config
+ logger.debug('Setting hostname {} Cryptodev config to {}'.
+ format(hostname, cryptodev_config))
+
+ uio_driver_config = 'uio-driver {}'.\
+ format(Topology.get_uio_driver(node))
+
+ self._nodeconfig[hostname]['uio_driver_config'] = uio_driver_config
+ logger.debug('Setting hostname {} uio_driver config to {}'.
+ format(hostname, uio_driver_config))