From 4ff09ae3483593f51faa160829fbcad4c77ed5b3 Mon Sep 17 00:00:00 2001 From: Ole Troan Date: Mon, 15 Apr 2019 11:27:22 +0200 Subject: API: Python and Unix domain socket improvement Handle the case where buffer overflows. Then SOCK_SEQPACKET assumption that multiple API messages are not returned by recv() is broken. Use SOCK_STREAM for API exchanges instead. Add support for running tests over sockets. make test SOCKET=1 Change-Id: Ibe5fd69b1bf617de4c7ba6cce0a7c2b3f97a2821 Signed-off-by: Ole Troan --- test/framework.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'test/framework.py') diff --git a/test/framework.py b/test/framework.py index 8a92229249b..25db2b72b34 100644 --- a/test/framework.py +++ b/test/framework.py @@ -313,8 +313,10 @@ class VppTestCase(unittest.TestCase): 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", + "main-core", str(cpu_core_number), "}", + "statseg", "{", "socket-name", cls.stats_sock, "}", + "socksvr", "{", "socket-name", cls.api_sock, "}", + "plugins", "{", "plugin", "dpdk_plugin.so", "{", "disable", "}", "plugin", "rdma_plugin.so", "{", "disable", "}", "plugin", "unittest_plugin.so", "{", "enable", @@ -415,6 +417,7 @@ class VppTestCase(unittest.TestCase): cls.tempdir = tempfile.mkdtemp( prefix='vpp-unittest-%s-' % cls.__name__) cls.stats_sock = "%s/stats.sock" % cls.tempdir + cls.api_sock = "%s/api.sock" % cls.tempdir cls.file_handler = FileHandler("%s/log.txt" % cls.tempdir) cls.file_handler.setFormatter( Formatter(fmt='%(asctime)s,%(msecs)03d %(message)s', -- cgit 1.2.3-korg