Ejemplo n.º 1
0
    def create_vpp_startup_config(self,
                                  config_filename='/etc/vpp/startup.conf'):
        """Create base startup configuration of VPP on container.

        :param config_filename: Startup configuration file name.
        :type config_filename: str
        """
        cpuset_cpus = self.container.cpuset_cpus

        # Create config instance
        vpp_config = VppConfigGenerator()
        vpp_config.set_node(self.container.node)
        vpp_config.add_unix_cli_listen()
        vpp_config.add_unix_nodaemon()
        vpp_config.add_unix_exec('/tmp/running.exec')
        # We will pop first core from list to be main core
        vpp_config.add_cpu_main_core(str(cpuset_cpus.pop(0)))
        # if this is not only core in list, the rest will be used as workers.
        if cpuset_cpus:
            corelist_workers = ','.join(str(cpu) for cpu in cpuset_cpus)
            vpp_config.add_cpu_corelist_workers(corelist_workers)
        vpp_config.add_plugin_disable('dpdk_plugin.so')

        self.execute('mkdir -p /etc/vpp/')
        self.execute('echo "{c}" | tee {f}'.format(
            c=vpp_config.get_config_str(), f=config_filename))
Ejemplo n.º 2
0
    def create_vpp_startup_config_func_dev(self):
        """Create startup configuration of VPP on container for functional
        vpp_device tests.
        """
        # Create config instance
        vpp_config = VppConfigGenerator()
        vpp_config.set_node(self.container.node)
        vpp_config.add_unix_cli_listen()
        vpp_config.add_unix_nodaemon()
        vpp_config.add_unix_exec('/tmp/running.exec')
        vpp_config.add_plugin('disable', 'dpdk_plugin.so')

        # Apply configuration
        self.execute('mkdir -p /etc/vpp/')
        self.execute('echo "{config}" | tee /etc/vpp/startup.conf'
                     .format(config=vpp_config.get_config_str()))