aboutsummaryrefslogtreecommitdiffstats
path: root/test/framework.py
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2018-12-21 16:04:22 +0100
committerOle Trøan <otroan@employees.org>2018-12-21 16:14:15 +0000
commita45dc07c153c4dd350b02fd30de471bbdb838ac9 (patch)
treeeb1f71429e98c30fc30d75d3ec39eb060817d407 /test/framework.py
parentb7778b6310b57a13626041ed8613cea37d41c9ca (diff)
Revert "tests: Rework vpp config generation."
This reverts commit 919efad2671993d4c6d5a0dba8eeb99d5c60edf1. Change-Id: I5ec4fa08a03f508dac684dc1ddbd7e6b85c49b97 Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'test/framework.py')
-rw-r--r--test/framework.py50
1 files changed, 27 insertions, 23 deletions
diff --git a/test/framework.py b/test/framework.py
index 2505057472e..7633ca04d0b 100644
--- a/test/framework.py
+++ b/test/framework.py
@@ -20,10 +20,8 @@ from traceback import format_exception
from logging import FileHandler, DEBUG, Formatter
from scapy.packet import Raw
from hook import StepHook, PollHook, VppDiedError
-from vpp_config import VppTestCaseVppConfig
-from vpp_interface import VppInterface
-from vpp_sub_interface import VppSubInterface
from vpp_pg_interface import VppPGInterface
+from vpp_sub_interface import VppSubInterface
from vpp_lo_interface import VppLoInterface
from vpp_papi_provider import VppPapiProvider
from vpp_papi.vpp_stats import VPPStats
@@ -207,8 +205,8 @@ class VppTestCase(unittest.TestCase):
classes. It provides methods to create and run test case.
"""
- CLI_LISTEN_DEFAULT = 'localhost:5002'
- config = VppTestCaseVppConfig()
+ extra_vpp_punt_config = []
+ extra_vpp_plugin_config = []
@property
def packet_infos(self):
@@ -303,26 +301,32 @@ class VppTestCase(unittest.TestCase):
plugin_path = cls.plugin_path
elif cls.extern_plugin_path is not None:
plugin_path = cls.extern_plugin_path
-
+ debug_cli = ""
if cls.step or cls.debug_gdb or cls.debug_gdbserver:
- cls.config.add('unix', 'cli-listen', cls.CLI_LISTEN_DEFAULT)
-
+ debug_cli = "cli-listen localhost:5002"
coredump_size = None
size = os.getenv("COREDUMP_SIZE")
- cls.config.add('unix', 'coredump-size',
- size if size is not None else 'unlimited')
-
- cls.config.add('unix', 'runtime-dir', cls.tempdir)
- cls.config.add('api-segment', 'prefix', cls.shm_prefix)
- cls.config.add('cpu', 'main-core', str(cls.get_least_used_cpu()))
- cls.config.add('statseg', 'socket-name', cls.stats_sock)
-
+ if size is not None:
+ coredump_size = "coredump-size %s" % size
+ if coredump_size is None:
+ coredump_size = "coredump-size unlimited"
+
+ cpu_core_number = cls.get_least_used_cpu()
+
+ cls.vpp_cmdline = [cls.vpp_bin, "unix",
+ "{", "nodaemon", debug_cli, "full-coredump",
+ coredump_size, "runtime-dir", cls.tempdir, "}",
+ "api-trace", "{", "on", "}", "api-segment", "{",
+ "prefix", cls.shm_prefix, "}", "cpu", "{",
+ "main-core", str(cpu_core_number), "}", "statseg",
+ "{", "socket-name", cls.stats_sock, "}", "plugins",
+ "{", "plugin", "dpdk_plugin.so", "{", "disable",
+ "}", "plugin", "unittest_plugin.so", "{", "enable",
+ "}"] + cls.extra_vpp_plugin_config + ["}", ]
+ if cls.extra_vpp_punt_config is not None:
+ cls.vpp_cmdline.extend(cls.extra_vpp_punt_config)
if plugin_path is not None:
- cls.config.add('plugins', 'path', plugin_path)
- cls.config.add_plugin('dpdk_plugin.so', 'disable')
- cls.config.add_plugin('unittest_plugin.so', 'enable')
-
- cls.vpp_cmdline = [cls.vpp_bin] + cls.config.shlex()
+ cls.vpp_cmdline.extend(["plugin_path", plugin_path])
cls.logger.info("vpp_cmdline args: %s" % cls.vpp_cmdline)
cls.logger.info("vpp_cmdline: %s" % " ".join(cls.vpp_cmdline))
@@ -853,8 +857,8 @@ class VppTestCase(unittest.TestCase):
for cf in checksum_fields:
if hasattr(layer, cf):
if ignore_zero_udp_checksums and \
- 0 == getattr(layer, cf) and \
- layer.name in udp_layers:
+ 0 == getattr(layer, cf) and \
+ layer.name in udp_layers:
continue
delattr(layer, cf)
checksums.append((counter, cf))