X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Fframework.py;h=c73b46c491b05d76ae95b63d096093136a3290ad;hb=e64e5fff4;hp=46f7542ea547ed596ca2d5e3ec0aacc6f94186e0;hpb=d498c9eb2b70b744b6231d5db714422f8745caaf;p=vpp.git diff --git a/test/framework.py b/test/framework.py index 46f7542ea54..c73b46c491b 100644 --- a/test/framework.py +++ b/test/framework.py @@ -381,6 +381,12 @@ class VppTestCase(unittest.TestCase): if not hasattr(cls, "worker_config"): cls.worker_config = "" + default_variant = os.getenv("VARIANT") + if default_variant is not None: + default_variant = "defaults { %s 100 }" % default_variant + else: + default_variant = "" + cls.vpp_cmdline = [cls.vpp_bin, "unix", "{", "nodaemon", debug_cli, "full-coredump", coredump_size, "runtime-dir", cls.tempdir, "}", @@ -391,11 +397,13 @@ class VppTestCase(unittest.TestCase): "physmem", "{", "max-size", "32m", "}", "statseg", "{", "socket-name", cls.stats_sock, "}", "socksvr", "{", "socket-name", cls.api_sock, "}", + "node { ", default_variant, "}", "plugins", "{", "plugin", "dpdk_plugin.so", "{", "disable", "}", "plugin", "rdma_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: @@ -574,9 +582,12 @@ class VppTestCase(unittest.TestCase): "VPP-API connection failed, did you forget " "to 'continue' VPP from within gdb?", RED)) raise + except vpp_papi.VPPRuntimeError as e: + cls.logger.debug("%s" % e) + cls.quit() + raise except Exception as e: cls.logger.debug("Exception connecting to VPP: %s" % e) - cls.quit() raise @@ -758,7 +769,12 @@ class VppTestCase(unittest.TestCase): @classmethod def get_vpp_time(cls): - return float(cls.vapi.cli('show clock').replace("Time now ", "")) + # processes e.g. "Time now 2.190522, Wed, 11 Mar 2020 17:29:54 GMT" + # returns float("2.190522") + timestr = cls.vapi.cli('show clock') + head, sep, tail = timestr.partition(',') + head, sep, tail = head.partition('Time now') + return float(tail) @classmethod def sleep_on_vpp_time(cls, sec):