From c03afda96f7988d496b864169dc0300d96ebd2bf Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Fri, 13 Aug 2021 13:26:11 -0700 Subject: [PATCH] test-runner: start dmesg early with --follow dmesg was being called at the very end of testing and dumped into a log file. If many tests were run this could take quite a long time and was timing out the default process wait. Instead --follow can be used (basically like 'tail') which prints messages as they come and avoids the time consuming full dump at the end. --- tools/test-runner | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/test-runner b/tools/test-runner index 90a5f87a..5b8bdaf5 100755 --- a/tools/test-runner +++ b/tools/test-runner @@ -604,8 +604,9 @@ class Namespace: if not env: env = os.environ.copy() - # In case this process needs DBus... - env['DBUS_SYSTEM_BUS_ADDRESS'] = self.dbus_address + if hasattr(self, "dbus_address"): + # In case this process needs DBus... + env['DBUS_SYSTEM_BUS_ADDRESS'] = self.dbus_address p = Process(args, ctx=self, namespace=ns, env=env, **kwargs) @@ -1403,10 +1404,6 @@ def run_auto_tests(ctx, args): shutil.rmtree('/tmp/secrets') os.remove('/tmp/phonesim.conf') - # Write out kernel log - if ctx.args.log: - ctx.start_process(["dmesg"], wait=True) - def run_unit_tests(ctx, args): os.chdir(args.testhome + '/unit') units = build_unit_list(args) @@ -1484,6 +1481,9 @@ def run_tests(): shutil.rmtree(f) else: os.remove(f) + + # Start writing out kernel log + config.ctx.start_process(["dmesg", '--follow']) elif args.monitor: parent = os.path.abspath(os.path.join(args.monitor, os.pardir)) mount('mondir', parent, '9p', 0, 'trans=virtio,version=9p2000.L,msize=10240')