3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-25 01:19:23 +01:00

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.
This commit is contained in:
James Prestwood 2021-08-13 13:26:11 -07:00 committed by Denis Kenzior
parent 365f955318
commit c03afda96f

View File

@ -604,6 +604,7 @@ class Namespace:
if not env: if not env:
env = os.environ.copy() env = os.environ.copy()
if hasattr(self, "dbus_address"):
# In case this process needs DBus... # In case this process needs DBus...
env['DBUS_SYSTEM_BUS_ADDRESS'] = self.dbus_address env['DBUS_SYSTEM_BUS_ADDRESS'] = self.dbus_address
@ -1403,10 +1404,6 @@ def run_auto_tests(ctx, args):
shutil.rmtree('/tmp/secrets') shutil.rmtree('/tmp/secrets')
os.remove('/tmp/phonesim.conf') 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): def run_unit_tests(ctx, args):
os.chdir(args.testhome + '/unit') os.chdir(args.testhome + '/unit')
units = build_unit_list(args) units = build_unit_list(args)
@ -1484,6 +1481,9 @@ def run_tests():
shutil.rmtree(f) shutil.rmtree(f)
else: else:
os.remove(f) os.remove(f)
# Start writing out kernel log
config.ctx.start_process(["dmesg", '--follow'])
elif args.monitor: elif args.monitor:
parent = os.path.abspath(os.path.join(args.monitor, os.pardir)) parent = os.path.abspath(os.path.join(args.monitor, os.pardir))
mount('mondir', parent, '9p', 0, 'trans=virtio,version=9p2000.L,msize=10240') mount('mondir', parent, '9p', 0, 'trans=virtio,version=9p2000.L,msize=10240')