balena-os / leviathan-worker

The worker layer for Leviathan including worker plugins QemuKit & AutoKit
Apache License 2.0
6 stars 4 forks source link

qemu: write serial TX to file again #72

Closed rcooke-warwick closed 1 year ago

rcooke-warwick commented 1 year ago

https://github.com/balena-os/leviathan-worker/pull/63 introduced a regression that would cause the secureboot test to fail. The cause was that this test assumed that the DUT serial output was still being written to a file https://github.com/balena-os/meta-balena/blob/master/tests/suites/os/tests/secureboot/index.js#L39 , when it in fact was no longer.

This PR now writes the serial output to a file, as well as connects it to a terminal interface to allow for serial commands to be sent to the DUT. This is done by creating a pty chardev - with a logfile, and then outputting the serial to that cahrdev. This way we still have a terminal to connect to and have a file with all output, achieving both the old and new behaviour.

Additionally, the QEMU_DEBUG option was causing a problem after https://github.com/balena-os/leviathan-worker/pull/63 because it would make the parent process inherit the qemu subprocess stdio if enabled - and after the aforementioned PR, we were assuming that this stdio would be piped. As QEMU stdout is being printed anyway now, I've removed the inherit case.

Change-type: patch

rcooke-warwick commented 1 year ago

passes with all 3 suites in meta-balena

rcooke-warwick commented 1 year ago

@balena-ci I self-certify!

jakogut commented 1 year ago

@rcooke-warwick Doesn't this remove the functionality of the QEMU_DEBUG variable? If this is the case, can we please remove this variable instead of leaving it in place without any functionality?