Skip to content

Commit

Permalink
contest: kunit: copy the log file to results
Browse files Browse the repository at this point in the history
KUnit puts kernel logs in a separate file. Make a copy of that file
in the results directory, so that it can be viewed.

Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
kuba-moo committed Sep 5, 2024
1 parent aab6fac commit 2965add
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion contest/remote/kunit.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import datetime
import json
import os
import shutil
import subprocess

from core import NipaLifetime
Expand Down Expand Up @@ -138,9 +139,11 @@ def summary_result(expected, got, link, sub_path=""):
def test(binfo, rinfo, config):
print("Run at", datetime.datetime.now())

tree_path = config.get('local', 'tree_path')

process = subprocess.Popen(['./tools/testing/kunit/kunit.py', 'run', '--alltests', '--json', '--arch=x86_64'],
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
cwd=config.get('local', 'tree_path'))
cwd=tree_path)
stdout, stderr = process.communicate()
stdout = stdout.decode("utf-8", "ignore")
stderr = stderr.decode("utf-8", "ignore")
Expand All @@ -160,6 +163,8 @@ def test(binfo, rinfo, config):
fp.write(stdout)
with open(os.path.join(results_path, 'stderr'), 'w') as fp:
fp.write(stderr)
shutil.copyfile(os.path.join(tree_path, '.kunit', 'test.log'),
os.path.join(results_path, 'kunit-test.log'))

try:
results_json = stdout_get_json(stdout)
Expand Down

0 comments on commit 2965add

Please sign in to comment.