X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Fframework.py;h=4f7c76a69394eee2208d86102f4eb463379db6d1;hb=8b5dc4fd5e6698870ca33f50079b7277aa11f24e;hp=fdaba2b84d93fb42a8befc4f38c04662964651d4;hpb=4c5422ee52960fa151611aa94a76e363e1be98bd;p=vpp.git diff --git a/test/framework.py b/test/framework.py index fdaba2b84d9..4f7c76a6939 100644 --- a/test/framework.py +++ b/test/framework.py @@ -83,7 +83,7 @@ def pump_output(testclass): """ pump output from vpp stdout/stderr to proper queues """ stdout_fragment = "" stderr_fragment = "" - while not testclass.pump_thread_stop_flag.wait(0): + while not testclass.pump_thread_stop_flag.is_set(): readable = select.select([testclass.vpp.stdout.fileno(), testclass.vpp.stderr.fileno(), testclass.pump_thread_wakeup_pipe[0]], @@ -246,7 +246,8 @@ class VppTestCase(unittest.TestCase): coredump_size, "}", "api-trace", "{", "on", "}", "api-segment", "{", "prefix", cls.shm_prefix, "}", "plugins", "{", "plugin", "dpdk_plugin.so", "{", - "disable", "}", "}", ] + "disable", "}", "plugin", "unittest_plugin.so", + "{", "enable", "}", "}", ] if plugin_path is not None: cls.vpp_cmdline.extend(["plugin_path", plugin_path]) cls.logger.info("vpp_cmdline: %s" % cls.vpp_cmdline) @@ -391,8 +392,8 @@ class VppTestCase(unittest.TestCase): raw_input("When done debugging, press ENTER to kill the " "process and finish running the testcase...") - os.write(cls.pump_thread_wakeup_pipe[1], 'ding dong wake up') cls.pump_thread_stop_flag.set() + os.write(cls.pump_thread_wakeup_pipe[1], 'ding dong wake up') if hasattr(cls, 'pump_thread'): cls.logger.debug("Waiting for pump thread to stop") cls.pump_thread.join() @@ -837,12 +838,13 @@ class VppTestCase(unittest.TestCase): "Finished sleep (%s) - slept %ss (wanted %ss)" % ( remark, after - before, timeout)) - def send_and_assert_no_replies(self, intf, pkts, remark=""): + def send_and_assert_no_replies(self, intf, pkts, remark="", timeout=None): self.vapi.cli("clear trace") intf.add_stream(pkts) self.pg_enable_capture(self.pg_interfaces) self.pg_start() - timeout = 1 + if not timeout: + timeout = 1 for i in self.pg_interfaces: i.get_capture(0, timeout=timeout) i.assert_nothing_captured(remark=remark)