Skip to content

Commit

Permalink
kunit: tool: Force the use of the 'tty' console for UML
Browse files Browse the repository at this point in the history
kunit_tool relies on the UML console outputting printk() output to the
tty in order to get results. Since the default console driver could
change, pass 'console=tty' to the kernel.

This is triggered by a change[1] to use ttynull as a fallback console
driver which -- by chance or by design -- seems to have changed the
default console output on UML, breaking kunit_tool. While this may be
fixed, we should be less fragile to such changes in the default.

[1]:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=757055ae8dedf5333af17b3b5b4b70ba9bc9da4e

Signed-off-by: David Gow <[email protected]>
Fixes: 757055a ("init/console: Use ttynull as a fallback when there is no console")
Reported-by: Andy Shevchenko <[email protected]>
Tested-by: Andy Shevchenko <[email protected]>
Acked-by: Brendan Higgins <[email protected]>
Signed-off-by: Shuah Khan <[email protected]>
  • Loading branch information
sulix authored and shuahkh committed Jan 4, 2021
1 parent e71ba94 commit 65a4e52
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/testing/kunit/kunit_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def build_um_kernel(self, alltests, jobs, build_dir, make_options):
return self.validate_config(build_dir)

def run_kernel(self, args=[], build_dir='', timeout=None):
args.extend(['mem=1G'])
args.extend(['mem=1G', 'console=tty'])
self._ops.linux_bin(args, timeout, build_dir)
outfile = get_outfile_path(build_dir)
subprocess.call(['stty', 'sane'])
Expand Down

0 comments on commit 65a4e52

Please sign in to comment.